azure

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jun 14, 2026 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Overview

Package azure provides a ModelProvider adapter for Azure OpenAI. It implements the OpenAI Chat Completions wire format with Azure-specific deployment URL and api-key header authentication.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Option

type Option func(*Provider)

Option is a functional option for configuring a Provider.

func WithAPIKey

func WithAPIKey(key string) Option

WithAPIKey sets the Azure API key for authentication.

func WithHTTPClient

func WithHTTPClient(c *http.Client) Option

WithHTTPClient sets a custom HTTP client for requests.

type Provider

type Provider struct {
	// contains filtered or unexported fields
}

Provider implements runtime.ModelProvider for Azure OpenAI.

func New

func New(endpoint, deployment, apiVersion string, opts ...Option) *Provider

New creates a new Azure OpenAI provider. endpoint: base URL of the Azure instance (e.g., https://myinstance.openai.azure.com) deployment: deployment name for the model apiVersion: API version string (e.g., 2024-08-01-preview)

func (*Provider) Complete

func (p *Provider) Complete(ctx context.Context, req model.Request) (model.Response, error)

Complete sends a request to the model and returns its complete response.

func (*Provider) Stream

func (p *Provider) Stream(ctx context.Context, req model.Request) (runtime.StreamReader, error)

Stream sends a request to the model and returns a StreamReader for reading chunks.

Jump to

Keyboard shortcuts

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