File tree Expand file tree Collapse file tree 4 files changed +263
-521
lines changed
java/org/springframework/samples/petclinic/genai Expand file tree Collapse file tree 4 files changed +263
-521
lines changed Original file line number Diff line number Diff line change @@ -15,7 +15,7 @@ apply plugin: 'io.spring.javaformat'
1515gradle. startParameter. excludedTaskNames + = [ " checkFormatAot" , " checkFormatAotTest" ]
1616
1717group = ' org.springframework.samples'
18- version = ' 3.4.0 '
18+ version = ' 3.4.2 '
1919
2020java {
2121 sourceCompatibility = JavaVersion . VERSION_17
@@ -32,7 +32,7 @@ ext.webjarsLocatorLiteVersion = "1.0.1"
3232ext. webjarsFontawesomeVersion = " 4.7.0"
3333ext. webjarsBootstrapVersion = " 5.3.3"
3434ext. webjarsMarkedVersion = " 14.1.2"
35- ext. springAiVersion = " 1.0.0-M2 "
35+ ext. springAiVersion = " 1.0.0-M5 "
3636
3737dependencies {
3838 // Workaround for AOT issue (https://github.com/spring-projects/spring-framework/pull/33949) -->
Original file line number Diff line number Diff line change 3838 <maven-checkstyle .version>3.6.0</maven-checkstyle .version>
3939 <nohttp-checkstyle .version>0.0.11</nohttp-checkstyle .version>
4040 <spring-format .version>0.0.43</spring-format .version>
41- <spring-ai .version>1.0.0-M3 </spring-ai .version>
41+ <spring-ai .version>1.0.0-M5 </spring-ai .version>
4242 </properties >
4343
4444 <dependencies >
Original file line number Diff line number Diff line change @@ -59,11 +59,9 @@ public VetResponse getVets(VetRequest request) throws JsonProcessingException {
5959 ObjectMapper objectMapper = new ObjectMapper ();
6060 String vetAsJson = objectMapper .writeValueAsString (request .vet ());
6161
62- SearchRequest sr = SearchRequest .from (SearchRequest .defaults ()).withQuery (vetAsJson ).withTopK (20 );
63- if (request .vet () == null ) {
64- // Provide a limit of 50 results when zero parameters are sent
65- sr = sr .withTopK (50 );
66- }
62+ // Provide a limit of 50 results when zero parameters are sent
63+ int topK = (request .vet () == null ) ? 50 : 20 ;
64+ SearchRequest sr = SearchRequest .builder ().query (vetAsJson ).topK (topK ).build ();
6765
6866 List <Document > topMatches = this .vectorStore .similaritySearch (sr );
6967 List <String > results = topMatches .stream ().map (Document ::getContent ).toList ();
You can’t perform that action at this time.
0 commit comments