azure

package
v0.2.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 15, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Registration = providers.Registration{
	Type:                        "azure",
	New:                         New,
	PassthroughSemanticEnricher: openai.Registration.PassthroughSemanticEnricher,
	Discovery: providers.DiscoveryConfig{
		RequireBaseURL:     true,
		SupportsAPIVersion: true,
	},
}

Functions

Types

type Provider

type Provider struct {
	*openai.CompatibleProvider
	// contains filtered or unexported fields
}

func (*Provider) CancelBatch

func (p *Provider) CancelBatch(ctx context.Context, id string) (*core.BatchResponse, error)

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

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) GetBatch

func (p *Provider) GetBatch(ctx context.Context, id string) (*core.BatchResponse, error)

func (*Provider) GetBatchResults

func (p *Provider) GetBatchResults(ctx context.Context, id string) (*core.BatchResultsResponse, error)

func (*Provider) ListBatches

func (p *Provider) ListBatches(ctx context.Context, limit int, after string) (*core.BatchListResponse, error)

func (*Provider) ListModels

func (p *Provider) ListModels(ctx context.Context) (*core.ModelsResponse, error)

func (*Provider) Passthrough added in v0.2.0

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 (p *Provider) SetAPIVersion(version string)

func (*Provider) SetBaseURL

func (p *Provider) SetBaseURL(baseURL string)

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL