Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ChatCompletionRequest ¶
type ChatCompletionRequest struct {
Model string `json:"model"`
Messages []ChatMessage `json:"messages"`
}
ChatCompletionRequest represents the request body for chat completion.
type ChatCompletionResponse ¶
type ChatCompletionResponse struct {
ID string `json:"id"`
Object string `json:"object"`
Created int64 `json:"created"`
Model string `json:"model"`
Choices []struct {
Index int `json:"index"`
Message ChatMessage `json:"message"`
FinishReason string `json:"finish_reason"`
} `json:"choices"`
Usage struct {
PromptTokens int `json:"prompt_tokens"`
CompletionTokens int `json:"completion_tokens"`
TotalTokens int `json:"total_tokens"`
} `json:"usage"`
}
ChatCompletionResponse represents the response from the chat completion endpoint.
type ChatMessage ¶
ChatMessage represents a message in the chat completion request.
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client represents an OpenAI API client.
type GeminiClient ¶
type GeminiClient struct {
// contains filtered or unexported fields
}
func (*GeminiClient) Generate ¶
func (c *GeminiClient) Generate(ctx context.Context, prompt string, options *LLMOptions) (string, error)
type LLMClient ¶
type LLMClient interface {
Generate(ctx context.Context, prompt string, options *LLMOptions) (string, error)
}
func NewLLMClient ¶
type LLMOptions ¶
type OpenRouterClient ¶
type OpenRouterClient struct {
// contains filtered or unexported fields
}
OpenRouterClient represents an OpenRouter API client.
func (*OpenRouterClient) Generate ¶
func (c *OpenRouterClient) Generate(ctx context.Context, prompt string, options *LLMOptions) (string, error)
Generate sends a generation request to the OpenRouter API.
type OpenRouterRequest ¶
OpenRouterRequest represents the request body for text generation.
type OpenRouterResponse ¶
type OpenRouterResponse struct {
Choices []struct {
Message struct {
Content string `json:"content"`
} `json:"message"`
} `json:"choices"`
}
OpenRouterResponse represents the response from the OpenRouter API.
Click to show internal directories.
Click to hide internal directories.