# Functions
DefaultAzureConfig creates a default configuration for Azure OpenAI API
Parameters: - apiKey: The API key for Azure OpenAI - baseURL: The base URL for the Azure OpenAI endpoint
Returns: - ClientConfig: A configuration for the Azure OpenAI API.
DefaultConfig creates a default configuration with the given auth token for the OpenAI API.
DefaultRetryConfig returns a sensible default retry configuration.
Do performs an HTTP request with the given options.
GetHeaders returns the appropriate headers based on API type
Parameters: - config: The client configuration
Returns: - http.Header: The headers to use for the request.
GetURL constructs the appropriate URL based on API type and model
Parameters: - config: The client configuration - model: The model to use
Returns: - string: The URL to use for the request.
WithBasicAuth sets basic authentication headers for the HTTP request Parameters: - username: The username for basic auth - password: The password for basic auth.
WithBearerAuth sets bearer token authentication for the HTTP request Parameters: - token: The bearer token for authentication.
WithClient sets the HTTP client for the request Parameters: - client: The HTTP client to use for the request.
WithHeader sets a single header for the HTTP request Parameters: - key: The header key - value: The header value.
WithHeaders sets the headers for the HTTP request Parameters: - headers: The HTTP headers to use for the request.
WithMethod sets the HTTP method for the request Parameters: - method: The HTTP method to use (e.g., GET, POST, PUT).
WithRetryConfig sets the retry configuration for the HTTP request Parameters: - config: The retry configuration to use.
WithTimeout sets a timeout for the HTTP request Parameters: - timeout: The timeout duration for the request.
# Constants
APITypeAzure represents the Azure OpenAI API.
APITypeOpenAI represents the standard OpenAI API.
Fast timeout for API calls.
OpenaiAPIURLv1 is the base URL for the OpenAI API.
OpenaiRealtimeAPIURLv1 is the base URL for the OpenAI Realtime API.
# Structs
ClientConfig holds the configuration for the HTTP client It contains settings for authentication, API endpoints, and HTTP client configuration.
RetryConfig defines the retry behavior for HTTP requests.
# Type aliases
APIType represents the type of API (Azure or OpenAI).
HTTPOption is a function that configures an HTTP request option.