Help us shape the future of Go! Take the 2026 Go Developer Survey

contract

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2026 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Boolean

func Boolean(description string) map[string]any

func BoundedInteger

func BoundedInteger(description string, minimum, maximum int) map[string]any

func CompactValidationError

func CompactValidationError(err error) string

CompactValidationError 保持模型可见的校验原因简短、稳定。 google/jsonschema-go 当前只返回带上下文的字符串错误,没有结构化 instance path。 因此这里只归一化 AgentDock 已经对外使用的 required/type 两类错误;其他错误 保留上游信息并压缩空白,避免为了“漂亮报错”重新实现一套 JSON Schema 校验器。

func InputObject

func InputObject(properties map[string]any, required ...string) map[string]any

InputObject 构造内建工具的根输入对象。结构已知的工具默认拒绝未知字段; 真正动态的字段应在对应 property 上显式声明 additionalProperties。

func Integer

func Integer(description string) map[string]any

func ObjectArray

func ObjectArray(description string) map[string]any

func OpenObject

func OpenObject(description string) map[string]any

func OutputObject

func OutputObject(properties map[string]any, required ...string) map[string]any

OutputObject 保持结果根对象可扩展。输出字段用于帮助客户端理解稳定结果, 但运行时允许能力在不破坏旧客户端的前提下增加新的领域字段。

func String

func String(description string) map[string]any

func StringArray

func StringArray(description string) map[string]any

Types

type InputValidator

type InputValidator struct {
	// contains filtered or unexported fields
}

func CompileInputSchema

func CompileInputSchema(raw map[string]any) (*InputValidator, error)

func (*InputValidator) Validate

func (v *InputValidator) Validate(arguments map[string]any) error

Jump to

Keyboard shortcuts

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