Documentation
¶
Index ¶
- func CloneParams(params map[string]interface{}) map[string]interface{}
- func ConvertJSONToTyped(jsonMap map[string]any, targetType reflect.Type) (reflect.Value, error)
- func ConvertLegacyOutputsToTyped[T any](outputs map[string]any) (T, error)
- func ConvertTypedInputsToLegacy(inputs any) (map[string]any, error)
- func ConvertTypedOutputsToLegacy(output any) (map[string]any, error)
- func Max(a, b int) int
- func ParseJSONResponse(response string) (map[string]interface{}, error)
- func PopulateStructFromMap(structValue reflect.Value, structType reflect.Type, data map[string]any) error
- func SetFieldValue(fieldValue reflect.Value, value any) error
- type Type
- type TypeSchema
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CloneParams ¶
CloneParams creates a deep copy of a parameter map.
func ConvertJSONToTyped ¶ added in v0.0.4
ConvertJSONToTyped converts JSON map → typed struct using reflection.
func ConvertLegacyOutputsToTyped ¶
ConvertLegacyOutputsToTyped converts map[string]any to a typed struct.
func ConvertTypedInputsToLegacy ¶
ConvertTypedInputsToLegacy converts a typed struct to map[string]any.
func ConvertTypedOutputsToLegacy ¶ added in v0.0.4
func ParseJSONResponse ¶
ParseJSONResponse attempts to parse a string response as JSON. It handles common LLM response formats including: - Raw JSON. - JSON wrapped in markdown code blocks (```json ... ```).
Types ¶
type TypeSchema ¶ added in v0.0.5
type TypeSchema struct {
AnyOf []*TypeSchema `json:"anyOf,omitempty"`
Default interface{} `json:"default,omitempty"`
Description string `json:"description,omitempty"`
Enum []string `json:"enum,omitempty"`
Example interface{} `json:"example,omitempty"`
Format string `json:"format,omitempty"`
Items *TypeSchema `json:"items,omitempty"`
MaxItems *int64 `json:"maxItems,omitempty"`
MaxLength *int64 `json:"maxLength,omitempty"`
MaxProperties *int64 `json:"maxProperties,omitempty"`
Maximum *float64 `json:"maximum,omitempty"`
MinItems *int64 `json:"minItems,omitempty"`
MinLength *int64 `json:"minLength,omitempty"`
MinProperties *int64 `json:"minProperties,omitempty"`
Minimum *float64 `json:"minimum,omitempty"`
Nullable *bool `json:"nullable,omitempty"`
Pattern string `json:"pattern,omitempty"`
Properties map[string]*TypeSchema `json:"properties,omitempty"`
PropertyOrdering []string `json:"propertyOrdering,omitempty"`
Required []string `json:"required,omitempty"`
Title string `json:"title,omitempty"`
Type string `json:"type,omitempty"`
}
func BuildSchemaFromJson ¶ added in v0.0.5
func BuildSchemaFromJson(v []byte) (*TypeSchema, error)
func BuildSchemaFromStruct ¶ added in v0.0.5
func BuildSchemaFromStruct[T interface{}](t T) *TypeSchema
Click to show internal directories.
Click to hide internal directories.