model is the name of your Azure deployment.
With Python
AzureOpenAI() reads AZURE_OPENAI_ENDPOINT, AZURE_OPENAI_API_KEY and OPENAI_API_VERSION. With the Python SDK.
With the AI SDK
azure reads AZURE_RESOURCE_NAME and AZURE_API_KEY.
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
Generate Word, PowerPoint, Excel and PDF files from an Azure OpenAI or Azure AI Foundry agent.
model is the name of your Azure deployment.
pip install openai doconda
import json
from doconda import Doconda
from openai import AzureOpenAI
client = AzureOpenAI()
tools = Doconda().tools()
specs = [{"type": "function", "function": {"name": t.name, "description": t.description, "parameters": t.input_schema}} for t in tools]
messages = [{"role": "user", "content": "Write a quarterly sales report in Word"}]
while True:
message = client.chat.completions.create(model="my-deployment", messages=messages, tools=specs).choices[0].message
messages.append(message)
if not message.tool_calls:
break
for call in message.tool_calls:
out = next(t for t in tools if t.name == call.function.name).run(json.loads(call.function.arguments))
messages.append({"role": "tool", "tool_call_id": call.id, "content": json.dumps(out)})
AzureOpenAI() reads AZURE_OPENAI_ENDPOINT, AZURE_OPENAI_API_KEY and OPENAI_API_VERSION. With the Python SDK.
npm install ai @ai-sdk/azure @doconda/sdk
import { azure } from "@ai-sdk/azure"
import { generateText, isStepCount, jsonSchema, tool } from "ai"
import { Doconda } from "@doconda/sdk"
const doconda = new Doconda()
const tools = Object.fromEntries(
doconda.tools().map((t) => [
t.name,
tool({ description: t.description, inputSchema: jsonSchema(t.inputSchema), execute: (input) => t.run(input as Record<string, unknown>) }),
]),
)
const { text } = await generateText({
model: azure("my-deployment"),
tools,
stopWhen: isStepCount(5),
prompt: "Write a quarterly sales report in Word",
})
azure reads AZURE_RESOURCE_NAME and AZURE_API_KEY.