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:
@@ -7,6 +7,7 @@ import me.zacharias.chat.ollama.exceptions.OllamaToolErrorException;
|
||||
import me.zacharias.neuro.dock.genius.GeniusEndpoint;
|
||||
import me.zacharias.neuro.dock.genius.GeniusEndpointTool;
|
||||
import me.zacharias.neuro.dock.genius.GeniusTools;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.json.JSONArray;
|
||||
import org.json.JSONObject;
|
||||
|
||||
@@ -21,7 +22,7 @@ public class FindSong extends GeniusEndpointTool {
|
||||
}
|
||||
|
||||
@Override
|
||||
public String name() {
|
||||
public @NotNull String name() {
|
||||
return "findsong";
|
||||
}
|
||||
|
||||
@@ -31,7 +32,7 @@ public class FindSong extends GeniusEndpointTool {
|
||||
}
|
||||
|
||||
@Override
|
||||
public OllamaPerameter parameters() {
|
||||
public @NotNull OllamaPerameter parameters() {
|
||||
return OllamaPerameter.builder()
|
||||
.addProperty("title", STRING, "The title, artitst, and song_id of the song to find.", true)
|
||||
.build();
|
||||
|
||||
@@ -7,6 +7,7 @@ import me.zacharias.chat.ollama.exceptions.OllamaToolErrorException;
|
||||
import me.zacharias.neuro.dock.genius.GeniusEndpoint;
|
||||
import me.zacharias.neuro.dock.genius.GeniusEndpointTool;
|
||||
import me.zacharias.neuro.dock.genius.GeniusTools;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.json.JSONObject;
|
||||
import org.jsoup.Jsoup;
|
||||
import org.jsoup.nodes.Document;
|
||||
@@ -15,8 +16,6 @@ import org.jsoup.nodes.Node;
|
||||
import org.jsoup.nodes.TextNode;
|
||||
import org.jsoup.select.Elements;
|
||||
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import static me.zacharias.chat.core.Core.writeLog;
|
||||
|
||||
/**
|
||||
@@ -40,7 +39,7 @@ public class GetLyrics extends GeniusEndpointTool {
|
||||
}
|
||||
|
||||
@Override
|
||||
public String name() {
|
||||
public @NotNull String name() {
|
||||
return "get_lyrics";
|
||||
}
|
||||
|
||||
@@ -50,7 +49,7 @@ public class GetLyrics extends GeniusEndpointTool {
|
||||
}
|
||||
|
||||
@Override
|
||||
public OllamaPerameter parameters() {
|
||||
public @NotNull OllamaPerameter parameters() {
|
||||
return OllamaPerameter.builder()
|
||||
.addProperty("song_id", OllamaPerameter.OllamaPerameterBuilder.Type.INT, "The ID of the song to get lyrics for.", true)
|
||||
.build();
|
||||
|
||||
Reference in New Issue
Block a user