Documentation
¶
Index ¶
- func NewClient(cfg Config, spec Spec, opts ...litellm.ClientOption) (*litellm.Client, error)
- type AuthSpec
- type CapabilityMapper
- type Config
- type EndpointSpec
- type FeatureSpec
- type HTTPClient
- type HeaderSpec
- type MessageMapper
- type Provider
- func (p *Provider) Capabilities(model string) litellm.Capabilities
- func (p *Provider) Chat(ctx context.Context, req *litellm.Request) (*litellm.Response, error)
- func (p *Provider) ListModels(ctx context.Context) ([]litellm.ModelInfo, error)
- func (p *Provider) Name() string
- func (p *Provider) Stream(ctx context.Context, req *litellm.Request) (litellm.Stream, error)
- type ProviderOptionsMapper
- type RequestSpec
- type ResponseFormatMapper
- type ResponseSpec
- type SchemaMapper
- type Spec
- type StreamSpec
- type StrictToolMode
- type ThinkingMapper
- type ToolMapper
- type WarningMapper
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type CapabilityMapper ¶ added in v1.8.1
type CapabilityMapper func(model string, base litellm.Capabilities) litellm.Capabilities
type Config ¶
type Config struct {
APIKey string
APIKeyFunc func(context.Context) (string, error)
BaseURL string
HTTPClient HTTPClient
Transport http.RoundTripper
Retry *retry.Policy
UserAgent string
Headers map[string]string
// AllowUnknownProviderOptions copies unknown request ProviderOptions into
// the JSON body. The default remains strict; applications that expose an
// explicit extra_body escape hatch can opt in.
AllowUnknownProviderOptions bool
}
type EndpointSpec ¶
type FeatureSpec ¶
type FeatureSpec struct {
StrictTools StrictToolMode
APIKeyRequired bool
}
type Provider ¶
type Provider struct {
// contains filtered or unexported fields
}
func (*Provider) Capabilities ¶ added in v1.8.1
func (p *Provider) Capabilities(model string) litellm.Capabilities
func (*Provider) ListModels ¶
type ProviderOptionsMapper ¶
type RequestSpec ¶
type RequestSpec struct {
MaxTokensField string
OmitStop bool
MaxStopSequences int
EmitEmptyAssistantContentWithToolCalls bool
SupportsJSONSchema bool
JSONSchemaToPrompt bool
Thinking ThinkingMapper
ResponseFormat ResponseFormatMapper
CleanSchema SchemaMapper
ProviderOptions ProviderOptionsMapper
Warnings WarningMapper
Messages MessageMapper
Tools ToolMapper
AllowUnknownProviderOptions bool
AllowedProviderOptions map[string]struct{}
}
type ResponseFormatMapper ¶
type ResponseFormatMapper func(*litellm.ResponseFormat) (any, error)
type ResponseSpec ¶
type Spec ¶
type Spec struct {
Name string
Endpoint EndpointSpec
Auth AuthSpec
Headers HeaderSpec
Request RequestSpec
Response ResponseSpec
Stream StreamSpec
Features FeatureSpec
Capabilities CapabilityMapper
}
type StreamSpec ¶
type StrictToolMode ¶
type StrictToolMode int
const ( StrictToolsOmit StrictToolMode = iota StrictToolsForward StrictToolsRequireAll )
Click to show internal directories.
Click to hide internal directories.