Change function result type from string to any
Updated the return type of functions and related code from `string` to `any` to improve flexibility and support more diverse outputs. Adjusted function implementations, signatures, and handling of results accordingly.
This commit is contained in:
@@ -1,8 +1,9 @@
|
||||
package go_llm
|
||||
|
||||
import (
|
||||
"gitea.stevedudenhoeffer.com/steve/go-llm/schema"
|
||||
"reflect"
|
||||
|
||||
"gitea.stevedudenhoeffer.com/steve/go-llm/schema"
|
||||
)
|
||||
|
||||
// Parse takes a function pointer and returns a function object.
|
||||
@@ -12,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) (string, error)) *Function {
|
||||
func NewFunction[T any](name string, description string, fn func(*Context, T) (any, error)) *Function {
|
||||
var o T
|
||||
|
||||
res := Function{
|
||||
|
Reference in New Issue
Block a user