Skip to content

Instrument ElevenLabs request/response speech generation and transcription #2439

Description

@lforst

Sub-issue of #2293 tracking the APIs covered by the current implementation.

Scope is AI operations where the application sends a request and consumes its result in the same process. Promise-based calls and response streams qualify.

Covered APIs in @elevenlabs/elevenlabs-js v2.67+ (2.x):

  • client.textToSpeech.convert(voiceId, request, options)
  • client.textToSpeech.stream(voiceId, request, options)
  • client.textToSpeech.convertWithTimestamps(voiceId, request, options)
  • client.textToSpeech.streamWithTimestamps(voiceId, request, options)
  • client.speechToText.convert(request, options) when webhook is omitted or false.

Implementation requirements:

  • Manual wrapElevenLabs() and automatic instrumentation share the existing Orchestrion/channel/plugin path.
  • Stable span names, provider/model metadata, canonical speech/transcription inputs and outputs, audio attachments, timestamps, streaming timing, and error capture.
  • Preserve promise helpers such as .withRawResponse(), stream identity and consumption behavior, cancellation, and errors. Wrapping plus automatic instrumentation must not duplicate spans.
  • Real-model e2e recordings for TTS and transcription, replay coverage for pinned and latest SDK aliases in wrapped, automatic, and combined modes, and regression checks that deferred APIs emit no provider spans.

Speech Engine sessions and webhook transcription are excluded. Their result lifecycle does not fit this request/response boundary. This issue tracks the current working implementation; it does not imply the change has been merged or released.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions