Updated OllamaFunctionTool.toString to reflect what the Ollama API actually wants
build / build (push) Has been cancelled
build / build (push) Has been cancelled
Added @NotNull annotation to OllamaFunctionTool.name and OllamaFunctionTool.parameters since the documentation reports as these being required Made sure that OllamaFunctionTool.description is actually optional as the Ollama API docs define
This commit is contained in:
@@ -8,6 +8,8 @@ import me.zacharias.chat.ollama.OllamaFunctionTool;
|
||||
import me.zacharias.chat.ollama.OllamaPerameter;
|
||||
import me.zacharias.chat.ollama.OllamaToolRespnce;
|
||||
import me.zacharias.chat.ollama.exceptions.OllamaToolErrorException;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jspecify.annotations.NonNull;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.web.client.RestTemplate;
|
||||
import org.springframework.web.util.UriComponentsBuilder;
|
||||
@@ -45,7 +47,7 @@ public class APITool extends OllamaFunctionTool {
|
||||
}
|
||||
|
||||
@Override
|
||||
public String name() {
|
||||
public @NonNull String name() {
|
||||
return name;
|
||||
}
|
||||
|
||||
@@ -55,7 +57,7 @@ public class APITool extends OllamaFunctionTool {
|
||||
}
|
||||
|
||||
@Override
|
||||
public OllamaPerameter parameters() {
|
||||
public @NotNull OllamaPerameter parameters() {
|
||||
OllamaPerameter.OllamaPerameterBuilder parameter = OllamaPerameter.builder();
|
||||
for (ToolArgument argument : arguments) {
|
||||
parameter.addProperty(argument.getName(), argument.getType(), argument.getDescription(), argument.isRequired());
|
||||
|
||||
Reference in New Issue
Block a user