This update introduces support for `jsonschema.Integer` types and updates the logic to handle nested items in schemas. Added a new default error log for unknown types using `slog.Error`. Also, integrated tool configuration with a `FunctionCallingConfig` when `dontRequireTool` is false.
22 lines
395 B
Go
22 lines
395 B
Go
package schema
|
|
|
|
import (
|
|
"github.com/openai/openai-go"
|
|
"reflect"
|
|
|
|
"github.com/sashabaranov/go-openai/jsonschema"
|
|
)
|
|
|
|
type Type interface {
|
|
FunctionParameters() openai.FunctionParameters
|
|
|
|
SchemaType() jsonschema.DataType
|
|
Definition() jsonschema.Definition
|
|
|
|
Required() bool
|
|
Description() string
|
|
|
|
FromAny(any) (reflect.Value, error)
|
|
SetValueOnField(obj reflect.Value, val reflect.Value)
|
|
}
|