Documentation
¶
Index ¶
- func CallFunctionFromJson(f Callable, jsonArgs interface{}) ([]reflect.Value, error)
- func FillStructFromKV(kv map[string]string, v interface{}) error
- func GetFunctionParametersJsonSchema(reflector *jsonschema.Reflector, f Callable) (*jsonschema.Schema, error)
- func ParseKV(s string) map[string]string
- type Callable
- type Nothing
- type Result
- type ResultSlice
- type SimplifiedJsonSchema
- type SimplifiedJsonSchemaProperty
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CallFunctionFromJson ¶ added in v0.2.24
CallFunctionFromJson calls a function with arguments provided as JSON TODO(manuel, 2024-01-12) make this take a ctx
func FillStructFromKV ¶ added in v0.1.9
func GetFunctionParametersJsonSchema ¶ added in v0.2.24
func GetFunctionParametersJsonSchema(reflector *jsonschema.Reflector, f Callable) (*jsonschema.Schema, error)
GetFunctionParametersJsonSchema generates a JSON Schema for the arguments of the given function
Types ¶
type Callable ¶ added in v0.2.24
type Callable interface{}
Callable is a type representing any callable function
type Result ¶
type Result[T any] struct { // contains filtered or unexported fields }
func NewErrorResult ¶
func NewValueResult ¶
func (Result[T]) MarshalZerologObject ¶ added in v0.4.25
MarshalZerologObject implements zerolog.LogObjectMarshaler
type ResultSlice ¶ added in v0.4.25
ResultSlice is a slice of Results that can be marshaled by zerolog
func ToResultSlice ¶ added in v0.4.25
func ToResultSlice[T any](results []Result[T]) ResultSlice[T]
ToResultSlice converts a slice of Results to a ResultSlice for logging
func (ResultSlice[T]) MarshalZerologArray ¶ added in v0.4.25
func (rs ResultSlice[T]) MarshalZerologArray(a *zerolog.Array)
MarshalZerologArray implements zerolog.LogArrayMarshaler
type SimplifiedJsonSchema ¶ added in v0.4.32
type SimplifiedJsonSchema struct { Type string `json:"type"` Description string `json:"description,omitempty"` Properties map[string]*SimplifiedJsonSchemaProperty `json:"properties"` Required []string `json:"required,omitempty"` }
SimplifiedJsonSchema represents a simplified root JSON Schema
func GetSimplifiedFunctionParametersJsonSchema ¶ added in v0.4.32
func GetSimplifiedFunctionParametersJsonSchema(reflector *jsonschema.Reflector, f Callable) (*SimplifiedJsonSchema, error)
GetSimplifiedFunctionParametersJsonSchema generates a simplified JSON Schema for the arguments of the given function
type SimplifiedJsonSchemaProperty ¶ added in v0.4.32
type SimplifiedJsonSchemaProperty struct { Type string `json:"type"` Description string `json:"description,omitempty"` Required bool `json:"-"` Properties map[string]*SimplifiedJsonSchemaProperty `json:"properties,omitempty"` Items *SimplifiedJsonSchemaProperty `json:"items,omitempty"` }
SimplifiedJsonSchemaProperty represents a simplified property in the JSON Schema