Examples for Tools usage
I have noticed that the use of "functions" is now deprecated and was replaced for "tools".
Will be pretty nice to update the examples dir in the repo adding examples for usage of this, since I just found the functions example
The example https://github.com/tmc/langchaingo/blob/main/examples/googleai-tool-call-example/googleai-tool-call-example.go should show how to use tool calling.
Definitely agree we should have additional tool use examples, please consider contributing new examples!
Is there a schema definition for how to define tools?
For example here:
Function: &llms.FunctionDefinition{
Name: "getTitlesByTag",
Description: "Gets available titles associated with a set of tags defined by a tag key and value",
Parameters: map[string]any{
"type": "object",
"properties": map[string]any{
"key": map[string]any{
"type": "string",
"enum": []string{"actor", "genre"},
"description": "The tag key",
},
"unit": map[string]any{
"type": "string",
"enum": []string{"fahrenheit", "celsius"},
},
},
"required": []string{"location"},
},
},
What are the valid types of parameters.type? Or properties? It would be great to add in some more clear typing/enum here. I can submit a PR if I can find the definitions.