Documentation
¶
Overview ¶
Package providers defines provider adapters for parsing responses and pricing.
Index ¶
- type AnthropicProvider
- func (AnthropicProvider) EstimateCost(model string, inputTokens, outputTokens int) float64
- func (AnthropicProvider) Name() string
- func (AnthropicProvider) ParseResponse(statusCode int, _ http.Header, body []byte) (*TraceData, error)
- func (AnthropicProvider) ParseStreamChunk(chunk []byte) (*StreamChunkData, error)
- type OpenAIProvider
- func (OpenAIProvider) EstimateCost(model string, inputTokens, outputTokens int) float64
- func (OpenAIProvider) Name() string
- func (OpenAIProvider) ParseResponse(statusCode int, _ http.Header, body []byte) (*TraceData, error)
- func (OpenAIProvider) ParseStreamChunk(chunk []byte) (*StreamChunkData, error)
- type Provider
- type Registry
- type StreamChunkData
- type TraceData
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AnthropicProvider ¶
type AnthropicProvider struct{}
func (AnthropicProvider) EstimateCost ¶
func (AnthropicProvider) EstimateCost(model string, inputTokens, outputTokens int) float64
func (AnthropicProvider) Name ¶
func (AnthropicProvider) Name() string
func (AnthropicProvider) ParseResponse ¶
func (AnthropicProvider) ParseStreamChunk ¶
func (AnthropicProvider) ParseStreamChunk(chunk []byte) (*StreamChunkData, error)
type OpenAIProvider ¶
type OpenAIProvider struct{}
func (OpenAIProvider) EstimateCost ¶
func (OpenAIProvider) EstimateCost(model string, inputTokens, outputTokens int) float64
func (OpenAIProvider) Name ¶
func (OpenAIProvider) Name() string
func (OpenAIProvider) ParseResponse ¶
func (OpenAIProvider) ParseStreamChunk ¶
func (OpenAIProvider) ParseStreamChunk(chunk []byte) (*StreamChunkData, error)
type Registry ¶
type Registry struct {
// contains filtered or unexported fields
}
func DefaultRegistry ¶
func DefaultRegistry() *Registry
func NewRegistry ¶
type StreamChunkData ¶
Click to show internal directories.
Click to hide internal directories.