Documentation
¶
Overview ¶
Package toolschema derives LLM function-calling parameter schemas from DAG parameter definitions.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ForDAG ¶
ForDAG returns the JSON Schema describing the parameters a DAG accepts when invoked as a tool. Rich parameter definitions take precedence over the positional default-params string.
func InferTypeFromDefault ¶
InferTypeFromDefault infers a JSON Schema type from a default value literal, returning the decoded value alongside the type name.
func SplitParams ¶
SplitParams splits a param string on whitespace, respecting quotes.
Types ¶
type Param ¶
type Param struct {
Name string
Type string // "string", "integer", "number", "boolean", "array", "object"
Default any
Required bool
}
Param is a single tool parameter.
func ParamsForDAG ¶
ParamsForDAG lists the parameters a DAG accepts, preferring its rich definitions and falling back to its default-params string.
func ParamsFromDefs ¶
ParamsFromDefs converts rich parameter definitions into tool parameters.
func ParseParams ¶
ParseParams parses a default-params string such as "param1 param2=default2 param3=10" into tool parameters. Parameters without a default are required.