Skip to content

Commit

Permalink
Add missing ChatRequest#template parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
tzolov committed Apr 6, 2024
1 parent 2b8c992 commit 1610729
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -402,6 +402,7 @@ public Message build() {
* @param format The format to return the response in. Currently, the only accepted
* value is "json".
* @param keepAlive The duration to keep the model loaded in ollama while idle. https://pkg.go.dev/time#ParseDuration
* @param template The prompt template (overrides what is defined in the Modelfile).
* @param options Additional model parameters. You can use the {@link OllamaOptions} builder
* to create the options then {@link OllamaOptions#toMap()} to convert the options into a
* map.
Expand All @@ -413,6 +414,7 @@ public record ChatRequest(
@JsonProperty("stream") Boolean stream,
@JsonProperty("format") String format,
@JsonProperty("keep_alive") String keepAlive,
@JsonProperty("template") String template,
@JsonProperty("options") Map<String, Object> options) {

public static Builder builder(String model) {
Expand Down Expand Up @@ -473,7 +475,7 @@ public Builder withOptions(OllamaOptions options) {
}

public ChatRequest build() {
return new ChatRequest(model, messages, stream, format, keepAlive, options);
return new ChatRequest(model, messages, stream, format, keepAlive, template, options);
}
}
}
Expand Down

0 comments on commit 1610729

Please sign in to comment.