toolargs

package
v0.6.1010-dev.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 31, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package toolargs decodes the arguments of a model's tool call.

Models do not always send arguments in the types a tool's input schema names: a boolean arrives as "true", a number as "30", an array as "[\"enter\"]", or the whole arguments object as one JSON string; the other way round, a request body declared as a string arrives as the object it holds, or a header's value as a number. Decode takes each such string as the value it encodes, and a value sent for a string parameter (or for an element of a list or map of strings) as that value's JSON text, so the call the model meant is the call that runs. A string sent for a string parameter is never reinterpreted, and a string that does not encode the wanted type is refused naming the parameter, what arrived and what was wanted.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Decode

func Decode(raw json.RawMessage, v any, strict bool) error

Decode decodes raw into v, a pointer to a struct. Absent arguments mean an empty object. With strict, a field v does not declare is refused; without it, it is ignored.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL