Documentation
¶
Index ¶
- func CloneParams(params map[string]interface{}) map[string]interface{}
- func ConvertLegacyOutputsToTyped[T any](outputs map[string]any) (T, error)
- func ConvertTypedInputsToLegacy(inputs any) (map[string]any, error)
- func DedupeStrings(items []string, limit int) []string
- 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
- func TruncateString(s string, maxLen int) string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CloneParams ¶ added in v0.28.0
CloneParams creates a deep copy of a parameter map.
func ConvertLegacyOutputsToTyped ¶ added in v0.52.0
ConvertLegacyOutputsToTyped converts map[string]any to a typed struct.
func ConvertTypedInputsToLegacy ¶ added in v0.52.0
ConvertTypedInputsToLegacy converts a typed struct to map[string]any.
func DedupeStrings ¶ added in v0.80.0
DedupeStrings trims, de-duplicates, and preserves first-seen order. If limit is positive, the returned slice is capped at that many items.
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 ... ```).
func PopulateStructFromMap ¶ added in v0.52.0
func PopulateStructFromMap(structValue reflect.Value, structType reflect.Type, data map[string]any) error
PopulateStructFromMap fills a struct with values from a map.
func SetFieldValue ¶ added in v0.52.0
SetFieldValue sets a struct field value with type conversion.
func TruncateString ¶ added in v0.75.2
TruncateString truncates a string to maxLen characters and appends "..." if truncated.
Types ¶
This section is empty.