Refactor toolbox and function handling to support synthetic fields and improve type definitions
This commit is contained in:
@@ -13,7 +13,7 @@ import (
|
||||
// The struct parameters can have the following tags:
|
||||
// - Description: a string that describes the parameter, passed to openaiImpl to tell it what the parameter is for
|
||||
|
||||
func NewFunction[T any](name string, description string, fn func(*Context, T) (any, error)) *Function {
|
||||
func NewFunction[T any](name string, description string, fn func(*Context, T) (any, error)) Function {
|
||||
var o T
|
||||
|
||||
res := Function{
|
||||
@@ -31,5 +31,5 @@ func NewFunction[T any](name string, description string, fn func(*Context, T) (a
|
||||
panic("function parameter must be a struct")
|
||||
}
|
||||
|
||||
return &res
|
||||
return res
|
||||
}
|
||||
|
Reference in New Issue
Block a user