Documentation
¶
Index ¶
Constants ¶
View Source
const ( ProviderOpenRouter = "OpenRouter.ai" ProviderOpenAI = "OpenAI" ProviderCustom = "Custom (e.g. Local)" )
Variables ¶
View Source
var SupportedProviders = []string{ProviderOpenRouter, ProviderOpenAI, ProviderCustom}
Functions ¶
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) ListModels ¶
func (c *Client) ListModels(config ProviderConfig) ([]string, error)
type Model ¶
type Model struct {
ID string `json:"id"`
Name string `json:"name"`
Pricing *struct {
Prompt any `json:"prompt"`
Completion any `json:"completion"`
} `json:"pricing,omitempty"`
ContextLength int `json:"context_length"`
PerRequestLimits *struct {
PromptTokens any `json:"prompt_tokens"`
CompletionTokens any `json:"completion_tokens"`
} `json:"per_request_limits"`
}
type ModelsList ¶
type ModelsList struct {
Data []Model `json:"data"`
}
type PromptRequest ¶
type PromptResponse ¶
type ProviderConfig ¶
Click to show internal directories.
Click to hide internal directories.