mirror of
https://github.com/hanzoai/insights-js.git
synced 2026-10-30 18:34:19 +00:00
* docs: add AI provider examples for all LLM analytics integrations Add 20 new example directories covering every provider documented in our LLM analytics onboarding docs. This includes OpenAI-compatible providers (Groq, DeepSeek, Mistral, xAI, Together AI, Ollama, Cohere, Hugging Face, Perplexity, Cerebras, Fireworks AI, OpenRouter, Helicone, Vercel AI Gateway, Azure OpenAI, Portkey) and custom integrations (Instructor, LangGraph, AWS Bedrock, Convex). * fix: use max_tokens instead of max_completion_tokens for Mistral example Mistral's API doesn't support max_completion_tokens, causing 422 errors. * fix: import AzureOpenAI from @posthog/ai, not @posthog/ai/openai * fix: use Resource constructor instead of resourceFromAttributes for OTel v1 * style: format all AI examples with prettier
283 B
283 B
Azure OpenAI + PostHog AI Examples
Track Azure OpenAI API calls with PostHog.
Setup
pnpm install
cp .env.example .env
# Fill in your API keys in .env
Examples
- chat.ts - Chat completions via Azure OpenAI
Run
source .env
npx tsx chat.ts