File tree 5 files changed +14
-12
lines changed
main/java/ac/knu/likeknujobserver
java/ac/knu/likeknujobserver
5 files changed +14
-12
lines changed Original file line number Diff line number Diff line change 1
1
plugins {
2
2
id ' java'
3
- id ' org.springframework.boot' version ' 3.2.3 '
3
+ id ' org.springframework.boot' version ' 3.3.0 '
4
4
id ' io.spring.dependency-management' version ' 1.1.4'
5
5
}
6
6
@@ -34,9 +34,9 @@ dependencies {
34
34
implementation ' org.springframework.boot:spring-boot-starter-web'
35
35
implementation ' org.apache.commons:commons-csv:1.10.0'
36
36
implementation ' org.jsoup:jsoup:1.16.1'
37
- implementation ' redis.clients:jedis:4.4 .3'
38
- implementation ' com.google.firebase:firebase-admin:9.2 .0'
39
- implementation platform(" org.springframework.ai:spring-ai-bom:0.8.0 " )
37
+ implementation ' redis.clients:jedis:5.1 .3'
38
+ implementation ' com.google.firebase:firebase-admin:9.3 .0'
39
+ implementation platform(" org.springframework.ai:spring-ai-bom:1.0.0-SNAPSHOT " )
40
40
implementation ' org.springframework.ai:spring-ai-openai-spring-boot-starter'
41
41
compileOnly ' org.projectlombok:lombok'
42
42
testCompileOnly ' org.projectlombok:lombok'
Original file line number Diff line number Diff line change 2
2
3
3
import ac .knu .likeknujobserver .announcement .value .Tag ;
4
4
import lombok .extern .slf4j .Slf4j ;
5
- import org .springframework .ai .chat .ChatClient ;
6
- import org .springframework .ai .chat .ChatResponse ;
7
5
import org .springframework .ai .chat .messages .SystemMessage ;
8
6
import org .springframework .ai .chat .messages .UserMessage ;
7
+ import org .springframework .ai .chat .model .ChatModel ;
8
+ import org .springframework .ai .chat .model .ChatResponse ;
9
9
import org .springframework .ai .chat .prompt .Prompt ;
10
10
import org .springframework .stereotype .Component ;
11
11
15
15
@ Component
16
16
public class OpenAIFineTuning {
17
17
18
- private final ChatClient chatClient ;
18
+ private final ChatModel chatModel ;
19
19
20
- public OpenAIFineTuning (ChatClient chatClient ) {
21
- this .chatClient = chatClient ;
20
+ public OpenAIFineTuning (ChatModel chatModel ) {
21
+ this .chatModel = chatModel ;
22
22
}
23
23
24
24
public Tag abstractTagOfAnnouncement (String announcementTitle ) {
25
25
SystemMessage systemMessage = new SystemMessage ("A bot that only speaks words that tag the entered sentence." );
26
26
UserMessage userMessage = new UserMessage (announcementTitle );
27
- ChatResponse chatResponse = chatClient .call (new Prompt (List .of (systemMessage , userMessage )));
27
+ ChatResponse chatResponse = chatModel .call (new Prompt (List .of (systemMessage , userMessage )));
28
28
String content = chatResponse .getResult ()
29
29
.getOutput ()
30
30
.getContent ();
Original file line number Diff line number Diff line change 4
4
import com .google .firebase .FirebaseApp ;
5
5
import com .google .firebase .FirebaseOptions ;
6
6
import jakarta .annotation .PostConstruct ;
7
+ import org .springframework .context .annotation .Profile ;
7
8
import org .springframework .stereotype .Component ;
8
9
9
10
import java .io .FileInputStream ;
10
11
import java .io .IOException ;
11
12
13
+ @ Profile ("!test" )
12
14
@ Component
13
15
public class FirebaseInitializer {
14
16
Original file line number Diff line number Diff line change 2
2
3
3
import org .junit .jupiter .api .Test ;
4
4
import org .springframework .boot .test .context .SpringBootTest ;
5
+ import org .springframework .test .context .ActiveProfiles ;
5
6
7
+ @ ActiveProfiles ("test" )
6
8
@ SpringBootTest
7
9
class LikeKnuJobServerApplicationTests {
8
10
Original file line number Diff line number Diff line change @@ -17,5 +17,3 @@ rabbitmq.calendar-queue-name=knu.calendar
17
17
18
18
spring.ai.openai.api-key =test
19
19
spring.ai.openai.chat.options.model =test
20
-
21
- firebase.key-path =/Users/jcw1031/likeknu-2023-firebase-adminsdk-ehw5i-31d25209d8.json
You can’t perform that action at this time.
0 commit comments