Documentation
¶
Index ¶
- func ConvertAnthropicToOpenAI(data []byte) (openai.ChatCompletionToolParam, error)
- func ConvertOpenAIToAnthropic(data []byte) (anthropic.ToolParam, error)
- func ConvertUnifiedToAnthropic(unifiedTool *UnifiedTool) (*anthropic.ToolParam, error)
- func ConvertUnifiedToGemini(unifiedTool *UnifiedTool) (*genai.FunctionDeclaration, error)
- func ConvertUnifiedToOpenAI(unifiedTool *UnifiedTool) (*openai.ChatCompletionToolParam, error)
- func JsonschemaToMap(schema *jsonschema.JsonSchema) map[string]any
- func ParseToolForAnthropic(data []byte) (*anthropic.ToolParam, error)
- func ParseToolForOpenAI(data []byte) (*openai.ChatCompletionToolParam, error)
- type UnifiedTool
- func AnthropicToUnified(tool *anthropic.ToolParam) (*UnifiedTool, error)
- func GetAllPresetTools() ([]*UnifiedTool, error)
- func GetPresetTools(toolPresets []string) ([]*UnifiedTool, error)
- func OpenAIToUnified(tool *openai.ChatCompletionToolParam) (*UnifiedTool, error)
- func Parse(data []byte) (*UnifiedTool, error)
- type UnifiedTools
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConvertAnthropicToOpenAI ¶
func ConvertAnthropicToOpenAI(data []byte) (openai.ChatCompletionToolParam, error)
ConvertAnthropicToOpenAI converts Anthropic tool format to OpenAI format
func ConvertOpenAIToAnthropic ¶
ConvertOpenAIToAnthropic converts OpenAI tool format to Anthropic format
func ConvertUnifiedToAnthropic ¶
func ConvertUnifiedToAnthropic(unifiedTool *UnifiedTool) (*anthropic.ToolParam, error)
ConvertUnifiedToAnthropic converts UnifiedTool to Anthropic format
func ConvertUnifiedToGemini ¶ added in v0.0.7
func ConvertUnifiedToGemini(unifiedTool *UnifiedTool) (*genai.FunctionDeclaration, error)
func ConvertUnifiedToOpenAI ¶
func ConvertUnifiedToOpenAI(unifiedTool *UnifiedTool) (*openai.ChatCompletionToolParam, error)
ConvertUnifiedToOpenAI converts UnifiedTool to OpenAI format
func JsonschemaToMap ¶
func JsonschemaToMap(schema *jsonschema.JsonSchema) map[string]any
func ParseToolForAnthropic ¶
ParseToolForAnthropic parses Anthropic tool format directly
func ParseToolForOpenAI ¶
func ParseToolForOpenAI(data []byte) (*openai.ChatCompletionToolParam, error)
ParseToolForOpenAI parses OpenAI tool format directly
Types ¶
type UnifiedTool ¶
type UnifiedTool struct {
Format string `json:"format,omitempty"`
Name string `json:"name"`
Description string `json:"description,omitempty"`
Parameters *jsonschema.JsonSchema `json:"parameters,omitempty"`
}
UnifiedTool represents a unified tool definition
func AnthropicToUnified ¶
func AnthropicToUnified(tool *anthropic.ToolParam) (*UnifiedTool, error)
func GetAllPresetTools ¶ added in v0.0.7
func GetAllPresetTools() ([]*UnifiedTool, error)
func GetPresetTools ¶
func GetPresetTools(toolPresets []string) ([]*UnifiedTool, error)
func OpenAIToUnified ¶
func OpenAIToUnified(tool *openai.ChatCompletionToolParam) (*UnifiedTool, error)
func Parse ¶
func Parse(data []byte) (*UnifiedTool, error)
Parse parses a unified tool definition from JSON bytes
func (*UnifiedTool) ToAnthropic ¶
func (t *UnifiedTool) ToAnthropic() (*anthropic.ToolParam, error)
ToAnthropic converts UnifiedTool to Anthropic ToolParam
func (*UnifiedTool) ToGemini ¶ added in v0.0.7
func (t *UnifiedTool) ToGemini() (*genai.FunctionDeclaration, error)
ToGemini converts UnifiedTool to Gemini ToolParam
func (*UnifiedTool) ToOpenAI ¶
func (t *UnifiedTool) ToOpenAI() (*openai.ChatCompletionToolParam, error)
ToOpenAI converts UnifiedTool to OpenAI ChatCompletionToolParam
type UnifiedTools ¶
type UnifiedTools []*UnifiedTool
func ParseSchemaData ¶
func ParseSchemaData(toolJSONs []string) (UnifiedTools, error)
func ParseSchemaFiles ¶
func ParseSchemaFiles(toolFiles []string) (UnifiedTools, error)
func ParseSchemas ¶
func ParseSchemas(toolFiles []string, toolJSONs []string) (UnifiedTools, error)
func (UnifiedTools) ToAnthropic ¶
func (c UnifiedTools) ToAnthropic() ([]anthropic.ToolUnionParam, error)
func (UnifiedTools) ToGemini ¶ added in v0.0.7
func (c UnifiedTools) ToGemini() ([]*genai.Tool, error)
func (UnifiedTools) ToOpenAI ¶
func (c UnifiedTools) ToOpenAI() ([]openai.ChatCompletionToolParam, error)