Documentation
¶
Overview ¶
Package tooldef provides JSON Schema tool definitions for AI agent frameworks.
These definitions are compatible with OpenAI function-calling, Anthropic tool_use, Google Gemini function declarations, and any framework that accepts JSON Schema (LangChain, Vercel AI SDK, Semantic Kernel, etc.).
Usage:
tools := tooldef.AllTools() // Register with your agent framework's tool system
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ValidateParams ¶ added in v0.5.0
ValidateParams checks parameter values against the tool's schema constraints (enums, required fields). Returns an error describing the first invalid parameter found, or nil if all values are valid.
Types ¶
type Schema ¶
type Schema struct {
Type string `json:"type"`
Description string `json:"description,omitempty"`
Properties map[string]Schema `json:"properties,omitempty"`
Required []string `json:"required,omitempty"`
Enum []string `json:"enum,omitempty"`
Default string `json:"default,omitempty"`
Items *Schema `json:"items,omitempty"`
}
Schema is a minimal JSON Schema representation.
type ToolDef ¶
type ToolDef struct {
Name string `json:"name"`
Description string `json:"description"`
Parameters Schema `json:"parameters"`
}
ToolDef describes a callable tool with its JSON Schema parameters.
func DesignVoice ¶
func DesignVoice() ToolDef
DesignVoice returns the tool definition for custom voice creation.
func EditVideo ¶ added in v0.7.0
func EditVideo() ToolDef
EditVideo returns the tool definition for video editing.
func GenerateImage ¶
func GenerateImage() ToolDef
GenerateImage returns the tool definition for image generation.
func GenerateVideo ¶
func GenerateVideo() ToolDef
GenerateVideo returns the tool definition for video generation.
func TextToSpeech ¶
func TextToSpeech() ToolDef
TextToSpeech returns the tool definition for text-to-speech synthesis.
func TranscribeAudio ¶
func TranscribeAudio() ToolDef
TranscribeAudio returns the tool definition for audio transcription.