@raindrop-ai/azure-openai
v0.0.2
Published
Raindrop integration for Azure OpenAI
Keywords
Readme
@raindrop-ai/azure-openai
Raindrop integration for Azure OpenAI. Automatically captures chat.completions.create() calls by wrapping the AzureOpenAI client.
Installation
npm install @raindrop-ai/azure-openai openaiUsage
import { createRaindropAzureOpenAI } from "@raindrop-ai/azure-openai";
import { AzureOpenAI } from "openai";
const raindrop = createRaindropAzureOpenAI({
writeKey: "rk_...",
userId: "user-123",
});
const client = new AzureOpenAI({
endpoint: "https://your-resource.openai.azure.com",
apiKey: "...",
apiVersion: "2024-10-21",
});
const wrapped = raindrop.wrap(client);
const response = await wrapped.chat.completions.create({
model: "gpt-4o-mini",
messages: [{ role: "user", content: "Hello!" }],
});
await raindrop.shutdown();What gets captured
- Chat completions: input messages, output text, model, token usage (prompt/completion)
- Errors: captured with error status on spans, re-thrown to caller
Options
| Option | Type | Default | Description |
|--------|------|---------|-------------|
| writeKey | string | - | Raindrop API write key (omit to disable telemetry) |
| endpoint | string | https://api.raindrop.ai/v1/ | Raindrop API endpoint |
| userId | string | - | Associate all events with a user |
| convoId | string | - | Group events into a conversation |
| debug | boolean | false | Enable verbose logging |
Testing
pnpm test