Refactored LLM handling to use updated langchaingo models and tools, replacing gollm dependencies. Introduced agent-related utilities, tools, and counters for better modular functionality. Added a parser for LLM model configuration and revamped the answering mechanism with enhanced support for tool-based interaction.
11 lines
281 B
Go
11 lines
281 B
Go
package agent
|
|
|
|
var AnswerTool = FromFunction(
|
|
func(ctx *Context, args struct {
|
|
Answer string `description:"the answer to the question"`
|
|
}) (FuncResponse, error) {
|
|
return FuncResponse{Result: args.Answer}, nil
|
|
}).
|
|
WithName("answer").
|
|
WithDescription("Answer the question")
|