Documentation
¶
Index ¶
- Variables
- func New(providerCfg providers.ProviderConfig, opts providers.ProviderOptions) core.Provider
- type Provider
- func (p *Provider) CancelBatch(ctx context.Context, id string) (*core.BatchResponse, error)
- func (p *Provider) CreateBatch(ctx context.Context, req *core.BatchRequest) (*core.BatchResponse, error)
- func (p *Provider) CreateSpeech(ctx context.Context, req *core.AudioSpeechRequest) (*core.AudioResponse, error)
- func (p *Provider) Decisions(ctx context.Context, req *core.PassthroughRequest) (*core.PassthroughResponse, error)
- func (p *Provider) GetBatch(ctx context.Context, id string) (*core.BatchResponse, error)
- func (p *Provider) GetBatchResults(ctx context.Context, id string) (*core.BatchResultsResponse, error)
- func (p *Provider) ListBatches(ctx context.Context, limit int, after string) (*core.BatchListResponse, error)
- func (p *Provider) ListModels(ctx context.Context) (*core.ModelsResponse, error)
- func (p *Provider) Passthrough(ctx context.Context, req *core.PassthroughRequest) (*core.PassthroughResponse, error)
- func (p *Provider) RealtimeCallTarget(ctx context.Context, req *core.RealtimeRequest) (*core.RealtimeHTTPTarget, error)
- func (p *Provider) RealtimeClientSecretTarget(ctx context.Context, req *core.RealtimeRequest) (*core.RealtimeHTTPTarget, error)
- func (p *Provider) RealtimeTarget(ctx context.Context, req *core.RealtimeRequest) (*core.RealtimeTarget, error)
- func (p *Provider) SetAPIVersion(version string)
- func (p *Provider) SetBaseURL(baseURL string)
Constants ¶
This section is empty.
Variables ¶
var Registration = providers.Registration{ Type: "azure", New: New, PassthroughSemanticEnricher: openai.Registration.PassthroughSemanticEnricher, Discovery: providers.DiscoveryConfig{ RequireBaseURL: true, SupportsAPIVersion: true, }, }
Functions ¶
func New ¶
func New(providerCfg providers.ProviderConfig, opts providers.ProviderOptions) core.Provider
Types ¶
type Provider ¶
type Provider struct {
*openai.CompatibleProvider
// contains filtered or unexported fields
}
func (*Provider) CancelBatch ¶
func (*Provider) CreateBatch ¶
func (p *Provider) CreateBatch(ctx context.Context, req *core.BatchRequest) (*core.BatchResponse, error)
func (*Provider) CreateSpeech ¶ added in v0.1.108
func (p *Provider) CreateSpeech(ctx context.Context, req *core.AudioSpeechRequest) (*core.AudioResponse, error)
CreateSpeech fills OpenAI's required voice, as Azure OpenAI requires one too.
func (*Provider) Decisions ¶ added in v0.2.0
func (p *Provider) Decisions(ctx context.Context, req *core.PassthroughRequest) (*core.PassthroughResponse, error)
Decisions answers an OpenAI Decisions request. A request the gateway marks for System One (core.DecisionsSystemOneEndpoint), for a Microsoft-Decision-1 deployment, is translated to System One and the answer back; see systemone.AnswerDecisions. Every other request, for a gpt-6-luna deployment, is forwarded as sent to Foundry's Decisions endpoint, whatever base URL form is configured.
func (*Provider) GetBatchResults ¶
func (*Provider) ListBatches ¶
func (*Provider) ListModels ¶
func (*Provider) Passthrough ¶ added in v0.2.0
func (p *Provider) Passthrough(ctx context.Context, req *core.PassthroughRequest) (*core.PassthroughResponse, error)
Passthrough sends System One requests (POST /v1/systemone, and Decisions translated to System One) to Foundry's decision endpoint on the resource root, and every other endpoint to the configured base URL.
func (*Provider) RealtimeCallTarget ¶
func (p *Provider) RealtimeCallTarget(ctx context.Context, req *core.RealtimeRequest) (*core.RealtimeHTTPTarget, error)
RealtimeCallTarget implements core.RealtimeCallProvider for Azure OpenAI's GA WebRTC SDP exchange: POST https://<resource>.openai.azure.com/openai/v1/realtime/calls. The GA v1 surface mirrors OpenAI's and takes no api-version parameter; the model query parameter selects the Azure deployment.
func (*Provider) RealtimeClientSecretTarget ¶
func (p *Provider) RealtimeClientSecretTarget(ctx context.Context, req *core.RealtimeRequest) (*core.RealtimeHTTPTarget, error)
RealtimeClientSecretTarget implements core.RealtimeCallProvider for minting ephemeral realtime client secrets on Azure's GA v1 surface: POST https://<resource>.openai.azure.com/openai/v1/realtime/client_secrets.
func (*Provider) RealtimeTarget ¶
func (p *Provider) RealtimeTarget(ctx context.Context, req *core.RealtimeRequest) (*core.RealtimeTarget, error)
RealtimeTarget implements core.RealtimeProvider for Azure OpenAI's GPT Realtime API, which uses OpenAI's realtime event schema. Azure differs from OpenAI only in the dial shape: the websocket lives at <resource>/openai/realtime with the deployment and api-version as query parameters (or at the GA <resource>/openai/v1/realtime with a model parameter on a v1 base URL), and auth uses the api-key header (not Bearer). The api-key is injected here and must never be logged. A request carrying a CallID attaches to an existing WebRTC call as a sideband channel on the GA v1 surface (<resource>/openai/v1/realtime?call_id=...), which needs no api-version parameter.
func (*Provider) SetAPIVersion ¶
func (*Provider) SetBaseURL ¶
SetBaseURL accepts both Azure surfaces: the classic deployment URL (<resource>/openai/deployments/<deployment>) and the GA v1 URL (<resource>/openai/v1/) that Azure AI Foundry hands out.