azurecommon

package
v1.4.445 Latest Latest
Warning

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

Go to latest
Published: Apr 13, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultAPIVersion = "2025-04-01-preview"

DefaultAPIVersion is the default Azure OpenAI API version.

Variables

This section is empty.

Functions

func AzureDeploymentMiddleware

func AzureDeploymentMiddleware(req *http.Request, next option.MiddlewareNext) (*http.Response, error)

AzureDeploymentMiddleware transforms Azure OpenAI API paths to include the deployment name. Azure requires URLs like: /openai/deployments/{deployment-name}/chat/completions but the SDK sends paths like /chat/completions

func BuildEndpoint

func BuildEndpoint(baseURL string) string

BuildEndpoint appends the /openai/ suffix to the given base URL.

func ExtractDeploymentFromBody

func ExtractDeploymentFromBody(req *http.Request) (string, error)

ExtractDeploymentFromBody reads the model field from the JSON request body and restores the body for subsequent use.

func ParseDeployments

func ParseDeployments(value string) []string

ParseDeployments splits a comma-separated deployment string into a slice, trimming whitespace and discarding empty entries.

Types

This section is empty.

Jump to

Keyboard shortcuts

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