Documentation
¶
Index ¶
- func Boolean(description string) map[string]any
- func BoundedInteger(description string, minimum, maximum int) map[string]any
- func CompactValidationError(err error) string
- func InputObject(properties map[string]any, required ...string) map[string]any
- func Integer(description string) map[string]any
- func ObjectArray(description string) map[string]any
- func OpenObject(description string) map[string]any
- func OutputObject(properties map[string]any, required ...string) map[string]any
- func String(description string) map[string]any
- func StringArray(description string) map[string]any
- type InputValidator
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CompactValidationError ¶
CompactValidationError 保持模型可见的校验原因简短、稳定。 google/jsonschema-go 当前只返回带上下文的字符串错误,没有结构化 instance path。 因此这里只归一化 AgentDock 已经对外使用的 required/type 两类错误;其他错误 保留上游信息并压缩空白,避免为了“漂亮报错”重新实现一套 JSON Schema 校验器。
func InputObject ¶
InputObject 构造内建工具的根输入对象。结构已知的工具默认拒绝未知字段; 真正动态的字段应在对应 property 上显式声明 additionalProperties。
func ObjectArray ¶
func OpenObject ¶
func OutputObject ¶
OutputObject 保持结果根对象可扩展。输出字段用于帮助客户端理解稳定结果, 但运行时允许能力在不破坏旧客户端的前提下增加新的领域字段。
func StringArray ¶
Types ¶
type InputValidator ¶
type InputValidator struct {
// contains filtered or unexported fields
}
func CompileInputSchema ¶
func CompileInputSchema(raw map[string]any) (*InputValidator, error)
Click to show internal directories.
Click to hide internal directories.