Documentation
¶
Index ¶
- func WithExtraHeaders(ctx context.Context, headers map[string]string) context.Context
- type AnthropicClient
- func (c *AnthropicClient) ChatIR(ctx context.Context, provider snapshot.Provider, targetModel string, ...) (ir.ChatResult, error)
- func (c *AnthropicClient) Messages(ctx context.Context, provider snapshot.Provider, targetModel string, ...) (*http.Response, error)
- func (c *AnthropicClient) PassThrough(ctx context.Context, provider snapshot.Provider, targetModel string, ...) (*http.Response, error)
- type AzureOpenAIClient
- func (c *AzureOpenAIClient) AudioSpeech(ctx context.Context, provider snapshot.Provider, targetModel string, ...) (*http.Response, error)
- func (c *AzureOpenAIClient) AudioTranscriptions(ctx context.Context, provider snapshot.Provider, ...) (*http.Response, error)
- func (c *AzureOpenAIClient) ChatCompletions(ctx context.Context, provider snapshot.Provider, targetModel string, ...) (*http.Response, error)
- func (c *AzureOpenAIClient) ChatIR(ctx context.Context, provider snapshot.Provider, targetModel string, ...) (ir.ChatResult, error)
- func (c *AzureOpenAIClient) Embeddings(ctx context.Context, provider snapshot.Provider, targetModel string, ...) (*http.Response, error)
- func (c *AzureOpenAIClient) Images(ctx context.Context, provider snapshot.Provider, targetModel string, ...) (*http.Response, error)
- type BedrockClient
- type BedrockConverseAPI
- type ElevenLabsClient
- type GeminiClient
- type OpenAIClient
- func (c *OpenAIClient) AudioSpeech(ctx context.Context, provider snapshot.Provider, targetModel string, ...) (*http.Response, error)
- func (c *OpenAIClient) AudioTranscriptions(ctx context.Context, provider snapshot.Provider, ...) (*http.Response, error)
- func (c *OpenAIClient) ChatCompletions(ctx context.Context, provider snapshot.Provider, targetModel string, ...) (*http.Response, error)
- func (c *OpenAIClient) ChatIR(ctx context.Context, provider snapshot.Provider, targetModel string, ...) (ir.ChatResult, error)
- func (c *OpenAIClient) Embeddings(ctx context.Context, provider snapshot.Provider, targetModel string, ...) (*http.Response, error)
- func (c *OpenAIClient) Images(ctx context.Context, provider snapshot.Provider, targetModel string, ...) (*http.Response, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AnthropicClient ¶
func NewAnthropicClient ¶
func NewAnthropicClient(sec secrets.Resolver) *AnthropicClient
func (*AnthropicClient) ChatIR ¶
func (c *AnthropicClient) ChatIR(ctx context.Context, provider snapshot.Provider, targetModel string, req ir.ChatRequest) (ir.ChatResult, error)
ChatIR runs chat against Anthropic Messages using IR.
func (*AnthropicClient) Messages ¶
func (c *AnthropicClient) Messages(ctx context.Context, provider snapshot.Provider, targetModel string, body []byte, stream bool) (*http.Response, error)
Messages translates an OpenAI-shaped chat body to Anthropic /v1/messages and returns an OpenAI-shaped chat completion response (JSON or SSE).
func (*AnthropicClient) PassThrough ¶
func (c *AnthropicClient) PassThrough(ctx context.Context, provider snapshot.Provider, targetModel string, body []byte, stream bool) (*http.Response, error)
PassThrough forwards an Anthropic-shaped /v1/messages body to upstream, rewriting only the model field to targetModel.
type AzureOpenAIClient ¶
AzureOpenAIClient talks to Azure OpenAI using either the classic deployments API or the OpenAI v1-compatible path layout, selected via provider config.
func NewAzureOpenAIClient ¶
func NewAzureOpenAIClient(sec secrets.Resolver) *AzureOpenAIClient
func (*AzureOpenAIClient) AudioSpeech ¶
func (*AzureOpenAIClient) AudioTranscriptions ¶
func (*AzureOpenAIClient) ChatCompletions ¶
func (*AzureOpenAIClient) ChatIR ¶
func (c *AzureOpenAIClient) ChatIR(ctx context.Context, provider snapshot.Provider, targetModel string, req ir.ChatRequest) (ir.ChatResult, error)
ChatIR runs chat against Azure OpenAI using OpenAI-shaped IR encode/decode.
func (*AzureOpenAIClient) Embeddings ¶
type BedrockClient ¶
type BedrockClient struct {
Secrets secrets.Resolver
// API is optional; when nil, a client is built per request from provider config.
API BedrockConverseAPI
// NewAPI builds a Bedrock Runtime client; tests may override.
NewAPI func(ctx context.Context, provider snapshot.Provider) (BedrockConverseAPI, error)
}
BedrockClient calls Amazon Bedrock Converse / ConverseStream.
func NewBedrockClient ¶
func NewBedrockClient(sec secrets.Resolver) *BedrockClient
NewBedrockClient constructs a Bedrock adapter with a shared secret resolver.
func (*BedrockClient) ChatIR ¶
func (c *BedrockClient) ChatIR(ctx context.Context, provider snapshot.Provider, targetModel string, req ir.ChatRequest) (ir.ChatResult, error)
ChatIR runs chat against Bedrock Converse using IR.
type BedrockConverseAPI ¶
type BedrockConverseAPI interface {
Converse(ctx context.Context, params *bedrockruntime.ConverseInput, optFns ...func(*bedrockruntime.Options)) (*bedrockruntime.ConverseOutput, error)
ConverseStream(ctx context.Context, params *bedrockruntime.ConverseStreamInput, optFns ...func(*bedrockruntime.Options)) (*bedrockruntime.ConverseStreamOutput, error)
}
BedrockConverseAPI is the subset of Bedrock Runtime used by BedrockClient.
type ElevenLabsClient ¶
ElevenLabsClient calls ElevenLabs TTS/STT APIs, translating OpenAI audio dialect bodies.
func NewElevenLabsClient ¶
func NewElevenLabsClient(sec secrets.Resolver) *ElevenLabsClient
NewElevenLabsClient constructs an ElevenLabs adapter with a shared secret resolver.
func (*ElevenLabsClient) AudioSpeech ¶
func (c *ElevenLabsClient) AudioSpeech(ctx context.Context, provider snapshot.Provider, targetModel string, body []byte) (*http.Response, error)
AudioSpeech translates OpenAI /v1/audio/speech JSON to ElevenLabs text-to-speech.
OpenAI body fields: model, input, voice, response_format, speed ElevenLabs: POST /v1/text-to-speech/{voice_id}?output_format=… with {text, model_id}
func (*ElevenLabsClient) AudioTranscriptions ¶
func (c *ElevenLabsClient) AudioTranscriptions(ctx context.Context, provider snapshot.Provider, targetModel, contentType string, body io.Reader) (*http.Response, error)
AudioTranscriptions translates OpenAI multipart transcriptions to ElevenLabs speech-to-text.
OpenAI fields: model, file, language, … ElevenLabs: POST /v1/speech-to-text with model_id + file (+ language_code).
type GeminiClient ¶
func NewGeminiClient ¶
func NewGeminiClient(sec secrets.Resolver) *GeminiClient
func (*GeminiClient) ChatIR ¶
func (c *GeminiClient) ChatIR(ctx context.Context, provider snapshot.Provider, targetModel string, req ir.ChatRequest) (ir.ChatResult, error)
ChatIR runs chat against Gemini generateContent using IR.
type OpenAIClient ¶
func NewOpenAIClient ¶
func NewOpenAIClient(sec secrets.Resolver) *OpenAIClient
func (*OpenAIClient) AudioSpeech ¶
func (*OpenAIClient) AudioTranscriptions ¶
func (*OpenAIClient) ChatCompletions ¶
func (*OpenAIClient) ChatIR ¶
func (c *OpenAIClient) ChatIR(ctx context.Context, provider snapshot.Provider, targetModel string, req ir.ChatRequest) (ir.ChatResult, error)
ChatIR runs chat against an OpenAI-compatible upstream using IR.