Files
insights-js/packages/ai/CHANGELOG.md

48 KiB

@hanzo/insights-ai

7.20.5

Patch Changes

7.20.4

Patch Changes

7.20.3

Patch Changes

7.20.2

Patch Changes

7.20.1

Patch Changes

7.20.0

Minor Changes

  • #3306 1a2f8a8 Thanks @johnsykim! - Add $ai_completion_id and $ai_provider_metadata to $ai_generation events for the OpenAI and Azure OpenAI wrappers. $ai_completion_id is the provider's response ID (e.g. chatcmpl-… / resp_…); $ai_provider_metadata carries OpenAI-specific fields (system_fingerprint, request_id). Together they enable correlating Insights events with OpenAI's Logs dashboard (platform.openai.com/logs/{completion_id}). The same options (completionId, providerMetadata) are now accepted by the public captureAiGeneration primitive so other provider wrappers can follow the same pattern. (2026-05-29)

7.19.7

Patch Changes

7.19.6

Patch Changes

  • #3668 7c80b2e Thanks @rafaeelaudibert! - Expose projectToken in addition to apiKey for InsightsTraceExporter

    We're moving towards a place where we're calling this projectToken everywhere. Let's release this as a patch version because it's a tiny change and we still support the old usage. This might be dropped in the next packages/ai major version. (2026-05-28)

7.19.5

Patch Changes

7.19.4

Patch Changes

7.19.3

Patch Changes

7.19.2

Patch Changes

7.19.1

Patch Changes

7.19.0

Minor Changes

7.18.12

Patch Changes

7.18.11

Patch Changes

7.18.10

Patch Changes

7.18.9

Patch Changes

7.18.8

Patch Changes

7.18.7

Patch Changes

7.18.6

Patch Changes

7.18.5

Patch Changes

7.18.4

Patch Changes

7.18.3

Patch Changes

7.18.2

Patch Changes

7.18.1

Patch Changes

7.18.0

Minor Changes

7.17.5

Patch Changes

7.17.4

Patch Changes

7.17.3

Patch Changes

7.17.2

Patch Changes

7.17.1

Patch Changes

  • #3507 38e85c9 Thanks @richardsolomou! - perf(vercel): drop O(N²) prompt trim and reuse TextEncoder/TextDecoder in mapVercelPrompt/truncate so long conversations no longer block the main thread for hundreds of milliseconds in withTracing's stream flush (2026-04-30)

7.17.0

Minor Changes

  • #3499 0601162 Thanks @richardsolomou! - Add captureAiGeneration, a generic primitive for emitting $ai_generation events from LLM calls that don't go through one of the wrapped clients (Cloudflare Workers AI, TanStack AI, custom HTTP, etc.). All built-in wrappers (withTracing, OpenAI, Anthropic, GoogleGenAI) now funnel through the same primitive, so external events are indistinguishable from SDK-wrapped ones. (2026-04-30)

7.16.15

Patch Changes

7.16.14

Patch Changes

7.16.13

Patch Changes

7.16.12

Patch Changes

  • #3487 09b4b3d Thanks @richardsolomou! - Widen the @opentelemetry/exporter-trace-otlp-http peer dependency range from ^0.200.0 (which only matched 0.200.x) to >=0.200.0 <1.0.0, so newer 0.x releases brought in by other OpenTelemetry-aware packages no longer trigger ERESOLVE failures or require --legacy-peer-deps. (2026-04-27)

7.16.11

Patch Changes

7.16.10

Patch Changes

7.16.9

Patch Changes

7.16.8

Patch Changes

7.16.7

Patch Changes

7.16.6

Patch Changes

7.16.5

Patch Changes

7.16.4

Patch Changes

7.16.3

Patch Changes

7.16.2

Patch Changes

7.16.1

Patch Changes

7.16.0

Minor Changes

  • #3387 7ea6e26 Thanks @carlos-marchal-ph! - Prompts.get() now accepts { withMetadata: true } and returns a PromptResult object containing source (api, cache, stale_cache, or code_fallback), name, and version alongside the prompt text. The previous plain-string return is deprecated and will be removed in a future major version. (2026-04-15)

7.15.0

Minor Changes

  • #3358 85d3bd1 Thanks @richardsolomou! - Add InsightsSpanProcessor as a self-contained OpenTelemetry SpanProcessor that handles batching and export internally. Both InsightsSpanProcessor and InsightsTraceExporter now automatically filter to AI-related spans only (gen_ai.*, llm.*, ai.*, traceloop.*). (2026-04-14)

  • #3377 b90b54e Thanks @andrewm4894! - Add OpenAI Agents SDK tracing support via @insights/ai/openai-agents. Implements InsightsTracingProcessor that captures agent traces, spans, and LLM generations as Insights LLM analytics events. Supports all span types including generation, response, function/tool, agent, handoff, guardrail, custom, audio, and MCP. (2026-04-14)

7.14.0

Minor Changes

7.13.2

Patch Changes

7.13.1

Patch Changes

7.13.0

Minor Changes

Patch Changes

7.12.8

Patch Changes

7.12.7

Patch Changes

7.12.6

Patch Changes

  • #3299 4561c25 Thanks @richardsolomou! - Remove InsightsTraceExporter from the main entry point to avoid crashing when @opentelemetry/exporter-trace-otlp-http is not installed. Use @insights/ai/otel to import it instead. (2026-03-31)

7.12.5

Patch Changes

7.12.4

Patch Changes

7.12.3

Patch Changes

7.12.2

Patch Changes

7.12.1

Patch Changes

7.12.0

Minor Changes

  • #3232 476a823 Thanks @richardsolomou! - Replace otel client-side span mapping with InsightsTraceExporter. Insights now converts gen_ai.* spans into $ai_generation events server-side, so the client-side mapper pipeline (InsightsSpanProcessor, captureSpan, aiSdkSpanMapper) has been replaced with a simple OTLPTraceExporter wrapper. (2026-03-18)

Patch Changes

7.11.2

Patch Changes

7.11.1

Patch Changes

7.11.0

Minor Changes

  • #3210 2d9eb60 Thanks @Radu-Raicea! - Add version-specific Prompts.clearCache(name, version) support and switch prompt caching to structured name/version entries instead of string-encoded cache keys. (2026-03-09)

7.10.0

Minor Changes

  • #3206 43a81c5 Thanks @Radu-Raicea! - Add version-aware prompt fetching to the Prompts SDK so callers can request a specific published prompt version without colliding with the latest prompt cache entry. (2026-03-09)

7.9.5

Patch Changes

  • #3194 eccec25 Thanks @Radu-Raicea! - Sanitize inline base64 video_url's in chat completions calls, which is supported by OpenRouter for video understanding models (2026-03-03)

7.9.4

Patch Changes

7.9.3

Patch Changes

7.9.2

Patch Changes

7.9.1

Patch Changes

7.9.0

Minor Changes

7.8.13

Patch Changes

7.8.12

Patch Changes

7.8.11

Patch Changes

7.8.10

Patch Changes

7.8.9

Patch Changes

7.8.8

Patch Changes

7.8.7

Patch Changes

7.8.6

Patch Changes

7.8.5

Patch Changes

7.8.4

Patch Changes

7.8.3

Patch Changes

7.8.2

Patch Changes

7.8.1

Patch Changes

7.8.0

Minor Changes

7.7.0

Minor Changes

7.6.1

Patch Changes

7.6.0

Minor Changes

  • #2955 6db4b48 Thanks @richardsolomou! - Add rawUsage field to capture raw provider usage metadata for backend cost calculations (2026-01-27)

Patch Changes

7.5.4

Patch Changes

7.5.3

Patch Changes

7.5.2

Patch Changes

7.5.1

Patch Changes

7.5.0

Minor Changes

Patch Changes

7.4.3

Patch Changes

7.4.2

Patch Changes

  • #2852 308daf0 Thanks @andrewm4894! - fix(vercel): preserve prototype getter properties when wrapping models (2026-01-12)

7.4.1

Patch Changes

7.4.0

Minor Changes

  • #2593 fba9fb2 Thanks @daibhin! - track LLMA trace_id on exceptions and exception_id on traces (2026-01-08)

Patch Changes

7.3.2

Patch Changes

7.3.1

Patch Changes

  • #2850 b5dbf56 Thanks @andrewm4894! - fix(gemini): expose all GoogleGenAI constructor parameters in wrapper

    The MonitoringGeminiConfig interface now extends GoogleGenAIOptions from @google/genai, allowing users to pass all available constructor parameters like googleAuthOptions and httpOptions without TypeScript errors. (2026-01-06)

7.3.0

Minor Changes

  • #2711 8c3a21e Thanks @andrewm4894! - Add support for both Vercel AI SDK 5 and 6

    Changes:

    • Runtime version detection via model.specificationVersion
    • Support both LanguageModelV2 (SDK 5) and LanguageModelV3 (SDK 6)
    • @ai-sdk/provider is now an optional peer dependency (supports both v2 and v3)
    • Removed unused ai peer dependency (only type imports from @ai-sdk/provider are used)
    • No breaking changes - existing SDK 5 users can continue without modification (2025-12-22)

Patch Changes

  • #2789 6b415a0 Thanks @andrewm4894! - fix: extract model from response for OpenAI stored prompts

    When using OpenAI stored prompts, the model is defined in the OpenAI dashboard rather than passed in the API request. This change adds a fallback to extract the model from the response object when not provided in kwargs. (2025-12-22)

  • Updated dependencies [04065b9]:

7.2.2

Patch Changes

7.2.1

Patch Changes

7.2.0

Minor Changes

Patch Changes

7.1.2

Patch Changes

7.1.1

Patch Changes

7.1.0

Minor Changes

  • #2498 aa9f637 Thanks @Tehnix! - Added support for OpenAI audio transcriptions API. You can now track and monitor OpenAI Whisper transcription requests through the @hanzo/ai SDK, with support for both streaming and non-streaming transcriptions, verbose JSON responses, and all standard transcription parameters (language, response_format, timestamp_granularities).

7.0.0

Major Changes

  • #2554 8e8d2f5 Thanks @carlos-marchal-ph! - Update LLM provider SDKs to latest versions
    • openai: 5.20.1 → 6.8.1
    • @anthropic-ai/sdk: 0.63.1 → 0.67.0
    • @google/genai: 1.19.0 → 1.29.0
    • langchain: 0.3.33 → 1.0.0
    • @langchain/core: 0.3.75 → 1.0.0
    • ai: 5.0.42 → 5.0.87
    • zod: 4.1.5 → 4.1.8

6.6.0

Minor Changes

6.5.1

Patch Changes

6.5.0

Minor Changes

  • #2496 7253bb3 Thanks @andrewm4894! - feat: add $ai_framework property for framework integrations

    Adds a simple $ai_framework property to AI events when using framework layers (LangChain, Vercel AI SDK). Direct provider calls (OpenAI, Anthropic, Gemini) do not include this property, eliminating redundant data where framework would duplicate the provider name.

    Example with framework:

    {
      "$ai_framework": "langchain",
      "$ai_provider": "openai",
      "$ai_model": "gpt-4"
    }
    

    Example without framework:

    {
      "$ai_provider": "openai",
      "$ai_model": "gpt-4"
    }
    

6.4.4

Patch Changes

  • #2468 873538b Thanks @andrewm4894! - fix: prevent [object Object] in content serialization - structured content is now properly JSON-stringified instead of being converted to "[object Object]"

6.4.3

Patch Changes

6.4.2

Patch Changes

6.4.1

Patch Changes

6.4.0

Minor Changes

6.3.3

Patch Changes

6.3.2

Patch Changes

6.3.1

Patch Changes

6.3.0

Minor Changes

6.2.0

Minor Changes

6.1.2

Patch Changes

6.1.1

Patch Changes

6.1.0

Minor Changes

  • #2216 57752f4 Thanks @k11kirky! - Add support for reasoning and cache tokens in gemini + fix token calc in vercel

6.0.1

Patch Changes

6.0.0

Major Changes

Patch Changes

5.2.3

Patch Changes

5.2.2

  • Add support for parsing tool calls from reasoning models in LangChain by converting the tool call format to the expected shape

5.2.1

  • Fix crash when importing @hanzo/ai with OpenAI SDK v5.x by deferring access to Chat, Completions, and Responses classes until runtime

5.2.0

  • Fix anonymous events

5.1.0

  • Add responses + parse

5.0.1

  • Bump @hanzo/insights-node to v5.0.0

5.0.0

  • Major bump for breaking change:
  • Require node engine >20
  • support for @google/genai

4.4.0

  • Make @hanzo/insights-node a peer dependency to avoid bundling implementation code

4.3.2

  • Fix exported file extensions to work with older Node versions

4.3.1

  • Remove fullDebug mode
  • Add insightsCaptureImmediate to await a promise for each capture (for serverless environments)
  • Fix openai test

4.2.1

  • Add fullDebug mode and limit full size of event input

4.1.0

  • add truncation to vercel ai sdk inputs and outputs

4.0.1

  • add new util to sanitize inputs, outputs and errors

4.0.0

  • feat: separate out packages as separate exports so you can import { OpenAI } from @hanzo/ai/openai and reduce import size

3.3.2 - 2025-03-25

  • fix: langchain name mapping

3.3.1 - 2025-03-13

  • fix: fix vercel output mapping and token caching

3.3.0 - 2025-03-08

  • feat: add reasoning and cache tokens to openai and anthropic
  • feat: add tool support for vercel
  • feat: add support for other media types vercel

3.2.1 - 2025-02-11

  • fix: add experimental_wrapLanguageModel to vercel middleware supporting older versions of ai

3.2.0 - 2025-02-11

  • feat: change how we handle streaming support for openai and anthropic

3.1.1 - 2025-02-07

  • fix: bump ai to 4.1.0

3.1.0 - 2025-02-07

  • feat: add insightsCostOverride, insightsModelOverride, and insightsProviderOverride to sendEventToInsights for vercel

2.4.0 - 2025-02-03

  • feat: add anthropic support for sdk