dev.langchain4j.model.ollama.Tool Maven / Gradle / Ivy
package dev.langchain4j.model.ollama;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.databind.PropertyNamingStrategies.SnakeCaseStrategy;
import com.fasterxml.jackson.databind.annotation.JsonNaming;
import static com.fasterxml.jackson.annotation.JsonInclude.Include.NON_NULL;
@JsonIgnoreProperties(ignoreUnknown = true)
@JsonInclude(NON_NULL)
@JsonNaming(SnakeCaseStrategy.class)
class Tool {
private String type;
private Function function;
Tool() {
}
Tool(String type, Function function) {
this.type = type;
this.function = function;
}
static Builder builder() {
return new Builder();
}
public String getType() {
return type;
}
public void setType(String type) {
this.type = type;
}
public Function getFunction() {
return function;
}
public void setFunction(Function function) {
this.function = function;
}
static class Builder {
private final String type = "function";
private Function function;
Builder function(Function function) {
this.function = function;
return this;
}
Tool build() {
return new Tool(type, function);
}
}
}