Documentation
¶
Overview ¶
Azure OpenAI example for Chronos.
This example demonstrates how to use Chronos with Azure OpenAI, in both standard (full response) and streaming (token-by-token) modes.
Prerequisites:
- An Azure OpenAI resource with a deployed model
- Go 1.24+
Set the following environment variables before running:
export AZURE_OPENAI_API_KEY=<your-azure-api-key> export AZURE_OPENAI_ENDPOINT=https://<your-resource>.openai.azure.com export AZURE_OPENAI_DEPLOYMENT=<your-deployment-name> export AZURE_OPENAI_API_VERSION=2024-12-01-preview
Run (standard mode — waits for full response, then prints):
go run ./examples/azure/main.go
Run (streaming mode — prints tokens as they arrive):
go run ./examples/azure/main.go -stream
Click to show internal directories.
Click to hide internal directories.