Takaro - v0.6.0
    Preparing search index...

    Variable openAIIntegrationConst

    openAIIntegration: (options?: OpenAiOptions) => Integration

    Adds Sentry tracing instrumentation for the OpenAI SDK.

    This integration is enabled by default.

    When configured, this integration automatically instruments OpenAI SDK client instances to capture telemetry data following OpenTelemetry Semantic Conventions for Generative AI.

    Type Declaration

      • (options?: OpenAiOptions): Integration
      • Parameters

        • Optionaloptions: OpenAiOptions

        Returns Integration

    import * as Sentry from '@sentry/node';

    Sentry.init({
    integrations: [Sentry.openAIIntegration()],
    });
    • recordInputs: Whether to record prompt messages (default: respects sendDefaultPii client option)
    • recordOutputs: Whether to record response text (default: respects sendDefaultPii client option)

    By default, the integration will:

    • Record inputs and outputs ONLY if sendDefaultPii is set to true in your Sentry client options
    • Otherwise, inputs and outputs are NOT recorded unless explicitly enabled
    // Record inputs and outputs when sendDefaultPii is false
    Sentry.init({
    integrations: [
    Sentry.openAIIntegration({
    recordInputs: true,
    recordOutputs: true
    })
    ],
    });

    // Never record inputs/outputs regardless of sendDefaultPii
    Sentry.init({
    sendDefaultPii: true,
    integrations: [
    Sentry.openAIIntegration({
    recordInputs: false,
    recordOutputs: false
    })
    ],
    });