model es el nombre de tu despliegue en Azure.
Con Python
AzureOpenAI() lee AZURE_OPENAI_ENDPOINT, AZURE_OPENAI_API_KEY y OPENAI_API_VERSION. Con el SDK de Python.
Con el AI SDK
azure lee AZURE_RESOURCE_NAME y AZURE_API_KEY.
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
Genera Word, PowerPoint, Excel y PDF desde un agente con Azure OpenAI o Azure AI Foundry.
model es el nombre de tu despliegue en Azure.
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": "Redacta un informe trimestral de ventas en Word"}]
while True:
message = client.chat.completions.create(model="mi-despliegue", 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() lee AZURE_OPENAI_ENDPOINT, AZURE_OPENAI_API_KEY y OPENAI_API_VERSION. Con el SDK de Python.
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("mi-despliegue"),
tools,
stopWhen: isStepCount(5),
prompt: "Redacta un informe trimestral de ventas en Word",
})
azure lee AZURE_RESOURCE_NAME y AZURE_API_KEY.