Documentation
¶
Index ¶
- func FetchModelsDirect(ctx context.Context, baseURL, apiKey string, headers map[string]string) ([]string, error)
- func TestAPIKey(ctx context.Context, baseURL, apiKey string, headers map[string]string) error
- func ValidateBaseURL(rawURL string) error
- type Provider
- func (p *Provider) AnthropicMessages(ctx context.Context, body []byte, incomingHeaders http.Header) (io.ReadCloser, bool, int, error)
- func (p *Provider) ChatCompletion(ctx context.Context, req *providers.ChatRequest) (io.ReadCloser, bool, int, error)
- func (p *Provider) Embeddings(ctx context.Context, req *providers.EmbeddingRequest) (*providers.EmbeddingResponse, error)
- func (p *Provider) ID() string
- func (p *Provider) IsHealthy() bool
- func (p *Provider) Models(ctx context.Context) ([]providers.ModelInfo, error)
- func (p *Provider) SetAccountKey(accID, apiKey string)
- func (p *Provider) SetStrategy(s string)
- func (p *Provider) SupportsAnthropic() bool
- func (p *Provider) TestAccount(ctx context.Context, accID string) error
- func (p *Provider) TestConnection(ctx context.Context) error
- func (p *Provider) Type() string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FetchModelsDirect ¶ added in v0.5.0
func FetchModelsDirect(ctx context.Context, baseURL, apiKey string, headers map[string]string) ([]string, error)
FetchModelsDirect retrieves model IDs directly from /models.
func TestAPIKey ¶ added in v0.5.0
TestAPIKey checks if an API key / endpoint is reachable and authenticates.
func ValidateBaseURL ¶ added in v0.7.0
ValidateBaseURL checks against SSRF vulnerabilities (e.g. cloud metadata IMDS)
Types ¶
type Provider ¶
type Provider struct {
// contains filtered or unexported fields
}
func NewProvider ¶
func NewProviderWithKeys ¶ added in v0.3.0
func (*Provider) AnthropicMessages ¶ added in v0.3.0
func (*Provider) ChatCompletion ¶
func (p *Provider) ChatCompletion(ctx context.Context, req *providers.ChatRequest) (io.ReadCloser, bool, int, error)
func (*Provider) Embeddings ¶ added in v0.2.0
func (p *Provider) Embeddings(ctx context.Context, req *providers.EmbeddingRequest) (*providers.EmbeddingResponse, error)
func (*Provider) SetAccountKey ¶ added in v0.5.0
func (*Provider) SetStrategy ¶ added in v0.4.0
func (*Provider) SupportsAnthropic ¶ added in v0.3.0
func (*Provider) TestAccount ¶ added in v0.5.0
func (*Provider) TestConnection ¶ added in v0.3.0
Click to show internal directories.
Click to hide internal directories.