Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ChatRequest ¶
type ChatRequest struct {
Model string `json:"model"`
Messages []Message `json:"messages"`
Tools []ToolDefinition `json:"tools,omitempty"`
}
type ChatResponse ¶
type ChatResponse struct {
Choices []struct {
Message Message `json:"message"`
} `json:"choices"`
}
type OpenAICompat ¶
func New ¶
func New(baseURL, apiKey, model string) *OpenAICompat
func (*OpenAICompat) Chat ¶
func (c *OpenAICompat) Chat(ctx context.Context, messages []Message, tools []ToolDefinition) (Message, error)
type ToolCall ¶
type ToolCall struct {
ID string `json:"id"`
Type string `json:"type"`
Function ToolCallFunc `json:"function"`
}
type ToolCallFunc ¶
type ToolDefinition ¶
type ToolDefinition struct {
Type string `json:"type"`
Function ToolFunction `json:"function"`
}
type ToolFunction ¶
type ToolFunction struct {
Name string `json:"name"`
Description string `json:"description"`
Parameters json.RawMessage `json:"parameters"`
}
Click to show internal directories.
Click to hide internal directories.