27 lines
561 B
Go
27 lines
561 B
Go
package agents
|
|
|
|
import "github.com/google/uuid"
|
|
|
|
type ToolHandlerInfo struct {
|
|
userId uuid.UUID
|
|
imageId uuid.UUID
|
|
}
|
|
|
|
type ToolHandler[TArgs any, TResp any] struct {
|
|
FunctionName string
|
|
Parse func(args string) (TArgs, error)
|
|
Fn func(info ToolHandlerInfo, args TArgs, call ToolCall) (TResp, error)
|
|
}
|
|
|
|
type ToolHandlerInterface interface {
|
|
GetFunctionName() string
|
|
}
|
|
|
|
func (handler ToolHandler[TArgs, TResp]) GetFunctionName() string {
|
|
return handler.FunctionName
|
|
}
|
|
|
|
type ToolsHandlers struct {
|
|
Handlers map[string]ToolHandlerInterface
|
|
}
|