Skip to content

Commit 3a6a2a1

Browse files
committed
feat: spring update
1 parent fb9c02f commit 3a6a2a1

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

backend/src/main/java/ch/xxx/aidoclibchat/usecase/service/ImageService.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,10 +119,10 @@ private ResultData createAIResult(ImageQueryDto imageDto) {
119119
imageDto = this.resizeImage(imageDto);
120120
}
121121
var prompt = new Prompt(
122-
new UserMessage(this.systemPrompt, new Media(MimeType.valueOf(imageDto.getImageType().getMediaType()),
122+
new UserMessage(imageDto.getQuery(), new Media(MimeType.valueOf(imageDto.getImageType().getMediaType()),
123123
new ByteArrayResource(imageDto.getImageContent()))));
124124

125-
var response = this.chatClient.prompt(prompt).user(imageDto.getQuery()).call().chatResponse();
125+
var response = this.chatClient.prompt(prompt).call().chatResponse();
126126
var resultData = new ResultData(response.getResult().getOutput().getContent(), imageDto);
127127
return resultData;
128128
}

backend/src/main/java/ch/xxx/aidoclibchat/usecase/service/TableService.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ public SqlRowSet searchTables(SearchDto searchDto) {
124124

125125
private String createQuery(Prompt prompt) {
126126
var chatStart = new Date();
127-
ChatResponse response = chatClient.prompt().user(u -> u.text(prompt.getContents())).call().chatResponse();
127+
ChatResponse response = chatClient.prompt(prompt).call().chatResponse();
128128
String chatResult = response.getResults().stream().map(myGen -> myGen.getOutput().getContent())
129129
.collect(Collectors.joining(","));
130130
LOGGER.info("AI response time: {}ms", new Date().getTime() - chatStart.getTime());

0 commit comments

Comments
 (0)