@@ -188,7 +188,7 @@ public Long storeDocument(Document document) {
188
188
record TikaDocumentAndContent (org .springframework .ai .document .Document document , String content ) {
189
189
}
190
190
var aiDocuments = tikaDocuments .stream ()
191
- .flatMap (myDocument1 -> this .splitStringToTokenLimit (myDocument1 .getContent (), embeddingTokenLimit )
191
+ .flatMap (myDocument1 -> this .splitStringToTokenLimit (myDocument1 .getText (), embeddingTokenLimit )
192
192
.stream ().map (myStr -> new TikaDocumentAndContent (myDocument1 , myStr )))
193
193
.map (myTikaRecord -> new org .springframework .ai .document .Document (myTikaRecord .content (),
194
194
myTikaRecord .document ().getMetadata ()))
@@ -226,10 +226,10 @@ public AiDocumentResult queryDocuments(SearchDto searchDto) {
226
226
this .getSystemMessage (mostSimilar .stream ().toList (), this .documentTokenLimit , searchDto .getSearchString ());
227
227
default -> this .getSystemMessage (documentChunks , this .documentTokenLimit , searchDto .getSearchString ());
228
228
};
229
- UserMessage userMessage = this .activeProfile .contains ("ollama" ) ? new UserMessage (systemMessage .getContent ())
229
+ UserMessage userMessage = this .activeProfile .contains ("ollama" ) ? new UserMessage (systemMessage .getText ())
230
230
: new UserMessage (searchDto .getSearchString ());
231
231
LocalDateTime start = LocalDateTime .now ();
232
- var response = chatClient .prompt ().system (s -> s .text (systemMessage .getContent ()))
232
+ var response = chatClient .prompt ().system (s -> s .text (systemMessage .getText ()))
233
233
.user (u -> u .text (userMessage .getContent ())).call ().chatResponse ();
234
234
LOGGER .info ("AI response time: {}ms" ,
235
235
ZonedDateTime .of (LocalDateTime .now (), ZoneId .systemDefault ()).toInstant ().toEpochMilli ()
@@ -251,7 +251,7 @@ public AiDocumentResult queryDocuments(SearchDto searchDto) {
251
251
private Message getSystemMessage (List <org .springframework .ai .document .Document > similarDocuments , int tokenLimit ,
252
252
String prompt ) {
253
253
String documentStr = this .cutStringToTokenLimit (
254
- similarDocuments .stream ().map (entry -> entry .getContent ())
254
+ similarDocuments .stream ().map (entry -> entry .getText ())
255
255
.filter (Predicate .not (Objects ::isNull ))
256
256
.filter (Predicate .not (String ::isBlank )).collect (Collectors .joining ("\n " )),
257
257
tokenLimit );
0 commit comments