Skip to content

Commit 1610729

Browse files
committed
Add missing ChatRequest#template parameter
1 parent 2b8c992 commit 1610729

File tree

1 file changed

+3
-1
lines changed
  • models/spring-ai-ollama/src/main/java/org/springframework/ai/ollama/api

1 file changed

+3
-1
lines changed

models/spring-ai-ollama/src/main/java/org/springframework/ai/ollama/api/OllamaApi.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -402,6 +402,7 @@ public Message build() {
402402
* @param format The format to return the response in. Currently, the only accepted
403403
* value is "json".
404404
* @param keepAlive The duration to keep the model loaded in ollama while idle. https://pkg.go.dev/time#ParseDuration
405+
* @param template The prompt template (overrides what is defined in the Modelfile).
405406
* @param options Additional model parameters. You can use the {@link OllamaOptions} builder
406407
* to create the options then {@link OllamaOptions#toMap()} to convert the options into a
407408
* map.
@@ -413,6 +414,7 @@ public record ChatRequest(
413414
@JsonProperty("stream") Boolean stream,
414415
@JsonProperty("format") String format,
415416
@JsonProperty("keep_alive") String keepAlive,
417+
@JsonProperty("template") String template,
416418
@JsonProperty("options") Map<String, Object> options) {
417419

418420
public static Builder builder(String model) {
@@ -473,7 +475,7 @@ public Builder withOptions(OllamaOptions options) {
473475
}
474476

475477
public ChatRequest build() {
476-
return new ChatRequest(model, messages, stream, format, keepAlive, options);
478+
return new ChatRequest(model, messages, stream, format, keepAlive, template, options);
477479
}
478480
}
479481
}

0 commit comments

Comments
 (0)