toolcall

package
v0.1.14-update.8 Latest Latest
Warning

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

Go to latest
Published: Sep 28, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package toolcall decodes the arguments a model sent with a tool call.

Index

Constants

This section is empty.

Variables

View Source
var ErrNotAnObject = errors.New("toolcall: arguments are not a JSON object")

ErrNotAnObject reports arguments that are not a JSON object.

Functions

func Decode

func Decode(raw string) (map[string]any, error)

Decode decodes tool call arguments into a map, keeping integers exact.

Types

type Field

type Field struct {
	Key   string
	Value any
}

Field is one argument, carrying the key order the model sent.

func DecodeFields

func DecodeFields(raw string) ([]Field, error)

DecodeFields decodes tool call arguments, keeping the order of the keys and the exact value of integers wider than float64 can hold.

Jump to

Keyboard shortcuts

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