Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is an Azure OpenAI LLM client.
Azure OpenAI provides OpenAI models through Microsoft Azure. The API is similar to OpenAI's but uses different authentication (api-key header instead of Bearer token) and requires deployment names instead of model names.
type Config ¶
type Config struct {
base.Config
Endpoint string // Azure OpenAI endpoint (e.g., https://your-resource.openai.azure.com)
APIVersion string // API version (e.g., 2024-03-01-preview)
}
Config defines configuration for the Azure OpenAI client.
Azure OpenAI requires additional configuration beyond the standard OpenAI client: - Endpoint: Your Azure OpenAI resource endpoint - APIVersion: The API version to use (e.g., "2024-03-01-preview") - Model: Your deployment name (not the model name)
Example:
config := azureopenai.Config{
Config: base.Config{
APIKey: "your-azure-key",
Model: "my-gpt4-deployment", // deployment name, not "gpt-4"
},
Endpoint: "https://your-resource.openai.azure.com",
APIVersion: "2024-03-01-preview",
}
client, err := azureopenai.New(config)
Click to show internal directories.
Click to hide internal directories.