Documentation
¶
Index ¶
- type APIResponse
- type Choice
- type Client
- type CreateRequest
- type FunctionCall
- type FunctionDef
- type Message
- type MessageParam
- type Provider
- func (p *Provider) CreateMessage(ctx context.Context, prompt string, messages []llm.Message, tools []llm.Tool) (llm.Message, error)
- func (p *Provider) CreateToolResponse(toolCallID string, content interface{}) (llm.Message, error)
- func (p *Provider) Name() string
- func (p *Provider) SupportsTools() bool
- type Tool
- type ToolCall
- type ToolCallWrapper
- type Usage
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type APIResponse ¶
type Choice ¶
type Choice struct {
Index int `json:"index"`
Message MessageParam `json:"message"`
FinishReason string `json:"finish_reason"`
}
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) CreateChatCompletion ¶
func (c *Client) CreateChatCompletion(ctx context.Context, req CreateRequest) (*APIResponse, error)
type CreateRequest ¶
type CreateRequest struct {
Model string `json:"model"`
Messages []MessageParam `json:"messages"`
Tools []Tool `json:"tools,omitempty"`
MaxTokens int `json:"max_tokens,omitempty"`
Temperature float32 `json:"temperature,omitempty"`
}
type FunctionCall ¶
type FunctionDef ¶
type Message ¶
type Message struct {
Resp *APIResponse
Choice *Choice
}
Message implements the llm.Message interface
func (*Message) GetContent ¶
func (*Message) GetToolCalls ¶
func (*Message) GetToolResponseID ¶
func (*Message) IsToolResponse ¶
type MessageParam ¶
type Provider ¶
type Provider struct {
// contains filtered or unexported fields
}
func (*Provider) CreateMessage ¶
func (*Provider) CreateToolResponse ¶
func (*Provider) SupportsTools ¶
type Tool ¶
type Tool struct {
Type string `json:"type"`
Function FunctionDef `json:"function"`
}
type ToolCall ¶
type ToolCall struct {
ID string `json:"id"`
Type string `json:"type"`
Function FunctionCall `json:"function"`
}
type ToolCallWrapper ¶
type ToolCallWrapper struct {
Call ToolCall
}
ToolCallWrapper implements llm.ToolCall
func (*ToolCallWrapper) GetArguments ¶
func (t *ToolCallWrapper) GetArguments() map[string]interface{}
func (*ToolCallWrapper) GetID ¶
func (t *ToolCallWrapper) GetID() string
func (*ToolCallWrapper) GetName ¶
func (t *ToolCallWrapper) GetName() string
Click to show internal directories.
Click to hide internal directories.