mirror of
https://github.com/hanzoai/insights-js.git
synced 2026-10-30 18:34:19 +00:00
* feat: Add AI provider integration examples Add self-contained examples for each AI provider supported by @posthog/ai: - OpenAI (Chat Completions, Responses, streaming, embeddings, transcription, image generation) - Anthropic (chat, streaming) - Google Gemini (chat, streaming, image generation) - Vercel AI SDK (generateText, streamText, generateObject, streamObject, Anthropic, Google backends) - LangChain (callback handler) - Mastra (manual instrumentation workflow) - OpenTelemetry (PostHogTraceExporter) Each example directory follows the existing example-* convention with its own package.json, pnpm-workspace.yaml, tsconfig.json, and README. Files are designed to be copy-pasted by users as starting points. * fix: use subpath imports for @posthog/ai Use provider-specific subpath imports (e.g. @posthog/ai/openai instead of @posthog/ai) to avoid pulling in the OTEL dependency which fails at import time when @opentelemetry/exporter-trace-otlp-http is not installed. * fix: fix image gen, transcription, mastra, and vercel middleware - Use images.generate API instead of responses API for image generation - Gracefully skip transcription when audio file is missing - Update Mastra to v1 with correct model ID and execute signature - Fix vercel middleware crash when result.content is undefined * revert: remove vercel middleware fix from examples branch Moving this fix to a separate PR. * Add comment about incomplete tool-calling loop in examples
11 lines
187 B
JSON
11 lines
187 B
JSON
{
|
|
"compilerOptions": {
|
|
"target": "ES2022",
|
|
"module": "node16",
|
|
"moduleResolution": "node16",
|
|
"strict": true,
|
|
"esModuleInterop": true,
|
|
"skipLibCheck": true
|
|
}
|
|
}
|