Documentation
¶
Index ¶
- Constants
- func DefaultOptions() []llm.Option
- type ModelData
- type Provider
- func (p *Provider) CreateStream(ctx context.Context, src llm.Buildable) (llm.Stream, error)
- func (p *Provider) DefaultModel() string
- func (p *Provider) FetchModels(ctx context.Context) ([]llm.Model, error)
- func (p *Provider) Models() llm.Models
- func (p *Provider) Name() string
- func (p *Provider) WithDefaultModel(modelID string) *Provider
Constants ¶
View Source
const (
DefaultModel = "auto"
)
Variables ¶
This section is empty.
Functions ¶
func DefaultOptions ¶ added in v0.12.0
Types ¶
type ModelData ¶
type ModelData struct {
ID string `json:"id"`
CanonicalSlug string `json:"canonical_slug"`
HuggingFaceID string `json:"hugging_face_id"`
Name string `json:"name"`
Created int64 `json:"created"`
Description string `json:"description"`
ContextLength int `json:"context_length"`
Architecture struct {
Modality string `json:"modality"`
InputModalities []string `json:"input_modalities"`
OutputModalities []string `json:"output_modalities"`
Tokenizer string `json:"tokenizer"`
InstructType *string `json:"instruct_type"`
} `json:"architecture"`
Pricing struct {
Prompt string `json:"prompt"`
Completion string `json:"completion"`
InputCacheRead string `json:"input_cache_read"`
} `json:"pricing"`
TopProvider struct {
ContextLength int `json:"context_length"`
MaxCompletionTokens int `json:"max_completion_tokens"`
IsModerated bool `json:"is_moderated"`
} `json:"top_provider"`
PerRequestLimits interface{} `json:"per_request_limits"`
SupportedParameters []string `json:"supported_parameters"`
DefaultParameters map[string]interface{} `json:"default_parameters"`
}
ModelData represents the full structure of a model from OpenRouter API.
func GetModelData ¶
GetModelData returns the full model data from the embedded models.json file. This includes pricing, context length, supported parameters, and other metadata.
type Provider ¶
type Provider struct {
// contains filtered or unexported fields
}
func (*Provider) CreateStream ¶
func (*Provider) DefaultModel ¶
func (*Provider) FetchModels ¶
func (*Provider) WithDefaultModel ¶
Click to show internal directories.
Click to hide internal directories.