Documentation
¶
Overview ¶
Package gateway provides multi-provider LLM gateway.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AnthropicProvider ¶
type AnthropicProvider struct {
// contains filtered or unexported fields
}
AnthropicProvider implements Anthropic API.
func NewAnthropicProvider ¶
func NewAnthropicProvider(apiKey string) *AnthropicProvider
NewAnthropicProvider creates Anthropic provider.
func (*AnthropicProvider) Compress ¶
func (p *AnthropicProvider) Compress(ctx context.Context, req *CompressionRequest) (*CompressionResponse, error)
func (*AnthropicProvider) HealthCheck ¶
func (p *AnthropicProvider) HealthCheck() error
func (*AnthropicProvider) Name ¶
func (p *AnthropicProvider) Name() string
type CompressionRequest ¶
CompressionRequest represents a compression request.
type CompressionResponse ¶
type CompressionResponse struct {
Compressed string
TokensSaved int
ProviderUsed string
LatencyMs int64
}
CompressionResponse represents a compression response.
type Gateway ¶
type Gateway struct {
// contains filtered or unexported fields
}
Gateway manages multiple providers with fallback.
func (*Gateway) AddProvider ¶
AddProvider adds a provider to the gateway.
func (*Gateway) Compress ¶
func (g *Gateway) Compress(ctx context.Context, req *CompressionRequest) (*CompressionResponse, error)
Compress compresses content with fallback.
func (*Gateway) HealthChecks ¶
HealthChecks runs health checks on all providers.
type OpenAIProvider ¶
type OpenAIProvider struct {
// contains filtered or unexported fields
}
OpenAIProvider implements OpenAI API.
func NewOpenAIProvider ¶
func NewOpenAIProvider(apiKey string) *OpenAIProvider
NewOpenAIProvider creates OpenAI provider.
func (*OpenAIProvider) Compress ¶
func (p *OpenAIProvider) Compress(ctx context.Context, req *CompressionRequest) (*CompressionResponse, error)
func (*OpenAIProvider) HealthCheck ¶
func (p *OpenAIProvider) HealthCheck() error
func (*OpenAIProvider) Name ¶
func (p *OpenAIProvider) Name() string
type Provider ¶
type Provider interface {
Name() string
Compress(ctx context.Context, req *CompressionRequest) (*CompressionResponse, error)
HealthCheck() error
}
Provider interface for LLM providers.
type QuotaManager ¶
type QuotaManager struct {
// contains filtered or unexported fields
}
QuotaManager manages usage quotas.
Click to show internal directories.
Click to hide internal directories.