File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed
backend/src/main/java/ch/xxx/aidoclibchat/usecase/service Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -139,16 +139,16 @@ public Optional<Book> findBookByUuid(String uuidStr) {
139
139
@ Async
140
140
public void addBookSummaries (Book book ) {
141
141
var myChapters = book .getChapters ().stream ().map (myChapter -> {
142
- Message systemMessage = new SystemPromptTemplate (this .bookPrompt )
143
- .createMessage (Map .of ("text" , myChapter .getChapterText ()));
144
- myChapter .setSummary (systemMessage . getContent () );
142
+ var answer = this . chatClient . call ( new SystemPromptTemplate (this .bookPrompt )
143
+ .createMessage (Map .of ("text" , myChapter .getChapterText ())). getContent ()) ;
144
+ myChapter .setSummary (answer );
145
145
return myChapter ;
146
146
}).toList ();
147
147
// LOGGER.info(myChapters.getLast().getSummary());
148
148
var summaries = myChapters .stream ().map (myChapter -> myChapter .getChapterText ())
149
149
.reduce ((acc , myChapter ) -> acc + "\n " + myChapter );
150
- book .setSummary (
151
- new SystemPromptTemplate (this .bookPrompt ).createMessage (Map .of ("text" , summaries )).getContent ());
150
+ book .setSummary (this . chatClient . call (
151
+ new SystemPromptTemplate (this .bookPrompt ).createMessage (Map .of ("text" , summaries )).getContent ())) ;
152
152
// LOGGER.info(myBook.getSummary());
153
153
this .bookRepository .save (book );
154
154
}
You can’t perform that action at this time.
0 commit comments