This commit is contained in:
2026-01-28 21:55:20 -05:00
parent 513674b0c8
commit dcd516d970
10 changed files with 90 additions and 179 deletions

View File

@@ -11,6 +11,7 @@ type Function interface {
Types() []string
Definition() string
IsAsync() bool
Arguments() []reflect.Type
Call(context.Context, []any) (any, error)
}
@@ -48,6 +49,17 @@ func (b *functionImpl[A, R]) Function() any {
return b.fn
}
func (b *functionImpl[A, R]) Arguments() []reflect.Type {
var allTypes []reflect.Type
rType := reflect.TypeFor[A]()
for i := range rType.NumField() {
allTypes = append(allTypes, rType.Field(i).Type)
}
return allTypes
}
func (b *functionImpl[A, R]) Call(ctx context.Context, allArgs []any) (any, error) {
return b.CallGeneric(ctx, allArgs)
}