Tool
Performing tasks with Tools
[edit]Tools are components that can be used to perform specific tasks. They can be used to automate, answer questions, and provide information. LinGoose offers a variety of tools that can be used to perform different actions.
LinGoose tools can be used to perform specific tasks. Here is an example of using the Python
and serpapi
tools to get information and run Python code and get the output.
auto := "auto"
myAgent := assistant.New(
openai.New().WithModel(openai.GPT4o).WithToolChoice(&auto).WithTools(
pythontool.New(),
serpapitool.New(),
),
).WithParameters(
assistant.Parameters{
AssistantName: "AI Assistant",
AssistantIdentity: "an helpful assistant",
AssistantScope: "with their questions.",
CompanyName: "",
CompanyDescription: "",
},
).WithThread(
thread.New().AddMessages(
thread.NewUserMessage().AddContent(
thread.NewTextContent("calculate the average temperature in celsius degrees of New York, Rome, and Tokyo."),
),
),
).WithMaxIterations(10)
err := myAgent.Run(context.Background())
if err != nil {
panic(err)
}