azurecommon

package
v1.4.430 Latest Latest
Warning

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

Go to latest
Published: Mar 6, 2026 License: MIT Imports: 10 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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