package llm import ( "errors" "github.com/tmc/langchaingo/llms" ) type ToDo struct {…
- User
package llm
import ( "errors"
code"github.com/tmc/langchaingo/llms")
type ToDo struct { Name string
json:"name"Items []stringjson:"items"}func createNewToDo(name string, items []string) (ToDo, error) { if name == "" { return ToDo{}, errors.New("name cannot be empty") } return ToDo{ Name: name, Items: items, }, nil }
var availableTools = []llms.Tool{ { Type: "function", Function: &llms.FunctionDefinition{ Name: "createNewToDo", Description: "Creates a new todo", Parameters: map[string]any{ "type": "object", "properties": map[string]any{ "name": map[string]any{ "type": "string", "description": "Name for the To-Do List", }, "items": map[string]any{ "type": "array", "description": "Array of ToDo items", }, }, "required": []string{"name", "items"}, }, }, }, }
ERRO[2024-11-18T18:03:28+02:00] Error processing audio with LLM: googleapi: Error 400: * GenerateContentRequest.tools[0].function_declarations[0].parameters.properties[items].items: missing field.
- Assistant