azure

command
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Jul 23, 2026 License: MIT Imports: 7 Imported by: 0

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

Jump to

Keyboard shortcuts

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