Skip to content

Commit 5aab871

Browse files
committed
feat: limit response size, use required context window
1 parent 3a26abe commit 5aab871

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

backend/src/main/java/ch/xxx/aidoclibchat/adapter/client/OpenLibraryRestClient.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ public Response apply(Request request) {
4444
var paramsStr = List.of(authorOpt, titleOpt, subjectOpt).stream()
4545
.filter(Optional::isPresent).map(Optional::get).collect(Collectors.joining("&"));
4646
var urlStr =
47-
String.format("%s?%s", this.baseUrl, paramsStr);
47+
String.format("%s?%s&limit=10", this.baseUrl, paramsStr);
4848
LOGGER.info(urlStr);
4949
var response = this.restClient.get().uri(urlStr).retrieve().body(Response.class);
5050
return response;

backend/src/main/resources/application-ollama.properties

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@ spring.ai.ollama.chat.options.num-ctx=12288
1818
#spring.ai.embedding.transformer.tokenizer.uri=https://huggingface.co/mixedbread-ai/mxbai-embed-large-v1/tree/main/tokenizer.json
1919

2020
# function calling
21-
#spring.ai.ollama.chat.model=mixtral:8x7b-text-v0.1-q6_K
21+
#spring.ai.ollama.chat.model=llama3.1:8b
22+
#spring.ai.ollama.chat.options.num-ctx=65535
2223

2324
# image processing
2425
#spring.ai.ollama.chat.model=llava:34b-v1.6-q6_K

0 commit comments

Comments
 (0)