Skip to content

feat: record and replay Seed Speech TTS, ElevenLabs Scribe and Audio Isolation - #601

Merged
jpr5 merged 3 commits into
CopilotKit:mainfrom
tombeckenham:600-seed-speech-tts-elevenlabs-scribe-and-audio-isolation-record-replay
Nov 10, 2026
Merged

jpr5 merged 3 commits into
CopilotKit:mainfrom
tombeckenham:600-seed-speech-tts-elevenlabs-scribe-and-audio-isolation-record-replay

Conversation

@tombeckenham

@tombeckenham tombeckenham commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

Closes #600

Record + replay for the three audio routes OpenStory's voice pipeline chains together.

Route Fixture endpoint Match key Recorded as
POST /api/v3/tts/create (BytePlus Seed Speech) byteplus-tts model + text_prompt + one [reference sha256:…] line per references[].audio_data { json, status }
POST /v1/speech-to-text (ElevenLabs Scribe, multipart) elevenlabs-stt model_id + sha256:<hex> of file { json, status }
POST /v1/audio-isolation (ElevenLabs, multipart) elevenlabs-audio-isolation sha256:<hex> of audio audio fixture (audio/mpeg)
  • X-Api-Request-Id is never part of the key. Matching is substring, so a hand-written Seed fixture can key on the prompt alone.
  • Recorded errors replay with their status and body (a recorded 429 replays as a 429).
  • Strict mode refuses a miss with 503, same as the other ElevenLabs routes.
  • New record provider byteplus-speech (Seed Speech lives on voice.*.bytepluses.com, not the Ark host): --provider-byteplus-speech, AIMOCK_PROVIDER_BYTEPLUS_SPEECH_KEY, injected as X-Api-Key.

Implementation notes

  • One handler, src/audio-pipeline.ts, for all three routes.
  • Multipart bodies are read as a Buffer and parsed as latin1, so the existing extractFormField works and the bytes hash and proxy unchanged. proxyAndRecord now accepts a Buffer body (previously string-only, which would have corrupted binary uploads on the way upstream).
  • Body cap for these routes is 64 MB (Seed references can be several MB of base64).
  • OpenAPI catalog, route registry, docs (docs/speech) and CHANGELOG updated.

Public API

Additive only: three new FixtureMatch.endpoint members and a new RecordProviderKey (byteplus-speech). Needs the public-api-addition label.

Not covered

Seedream on the Ark data plane and the Ark asset control plane (mentioned in the issue as possibly separate) are not in this PR.

Testing

src/__tests__/audio-pipeline.test.ts: record + replay for each route against a stub upstream, byte-exact multipart forwarding (bytes above 0x7f), recorded 429 replay, strict 503, prompt-only hand-written fixture, 400s for missing fields.

Locally, two suites fail for environmental reasons unrelated to this diff: response-a9-equivalence ("requires 2 GiB free memory") and unreleased-check-workflow (git tag fails with "no tag message?" under local git config).

@pkg-pr-new

pkg-pr-new Bot commented Nov 5, 2026 •

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/@copilotkit/aimock@601

commit: c35ba8b

@tombeckenham

Copy link
Copy Markdown
Contributor Author

Could a maintainer add the public-api-addition label? The etc/ API report changes only add things: three new endpoint names and the byteplusSpeech provider key. Nothing is removed.

@tombeckenham

Copy link
Copy Markdown
Contributor Author

@jpr5 could you add public-api-addition here? The API report changes only add things - nothing is removed.

…ring

userMessage matching is a substring test, so a recorded Seed TTS key of
text_prompt plus reference lines also answered any longer prompt that
contained it, and the same prompt with other references, in replay and
in record mode. End the key with a full sha256 over model, text_prompt
and reference hashes, so a recorded fixture only matches an identical
request. Hand-written fixtures can still key on part of the prompt.
@jpr5 jpr5 added the public-api-addition Intended public API report changes reviewed for compatibility; freshness remains required label Nov 10, 2026
@jpr5

jpr5 commented Nov 10, 2026

Copy link
Copy Markdown
Contributor

Thanks Tom, this is a great addition. Seed Speech, Scribe and Audio Isolation all fit right into how aimock already does record and replay. We pushed one fix on top of your branch: recorded Seed fixtures were matched by substring, so a recording for "Hello" would also answer "Hello there, traveller." or "Hello" with a different reference voice. Recorded Seed fixtures now match only the exact request, while hand-written prompt-only fixtures still match by substring as your docs describe. Shout if anything looks off.

@jpr5
jpr5 merged commit 21774b2 into CopilotKit:main Nov 10, 2026
30 checks passed
@jpr5 jpr5 mentioned this pull request Nov 11, 2026
jpr5 added a commit that referenced this pull request Nov 11, 2026
**Merging this publishes @copilotkit/aimock 1.48.0 to npm and
aimock-pytest 0.7.2 to PyPI.**

## [1.48.0] - 2026-11-10

### Added

- A2A `onConversation()` scripts multi-turn tasks that ask for input,
then complete (#591)
- Record and replay native citations and annotations from real provider
turns (#594)
- Record and replay BytePlus Seed Speech TTS, ElevenLabs Scribe and
Audio Isolation (#601)

### Changed

- `aimock-pytest` 0.7.2 defaults to `@copilotkit/aimock` 1.48.0

### Fixed

- A2A Get/CancelTask return task as `result`; split Responses attachment
turns match (#595, #611)

## Version carriers (from `git grep -F 1.47.0`)

Bumped to 1.48.0:
- `package.json` version
- `charts/aimock/Chart.yaml` appVersion
- `.claude-plugin/plugin.json` version
- `.claude-plugin/marketplace.json` source version (`^1.48.0`)
- `docs/index.html` banner
- `packages/aimock-pytest/README.md` `--aimock-version` default
- `packages/aimock-pytest/src/aimock_pytest/_version.py`
`AIMOCK_VERSION`

Also bumped: `packages/aimock-pytest/pyproject.toml` 0.7.1 → 0.7.2,
because the pin moved (same pattern as #589).

Left as is (not carriers): the `## [1.47.0]` CHANGELOG heading, the
three "New in 1.47.0" notes in `docs/docs/index.html`, and the three
"1.47.0+" notes in the `docs/index.html` comparison matrix. These mark
when a feature first shipped.

## README

#601 added docs to the speech page but not to the README. This PR adds:
- Seed Speech, Scribe and Audio Isolation to the LLMock row and the
Multimedia APIs line
- `AIMOCK_PROVIDER_BYTEPLUS_SPEECH_KEY` to the upstream-key table

The CHANGELOG `#600` reference is corrected to `#601`. #600 is not a PR.

The other features already have docs: A2A conversations (#591), citation
recording (#594) and the GetTask result shape (#595). The package.json
description is synced from the README subtitle on publish.

## Local checks
- `pnpm install --frozen-lockfile`, `format:check`, `lint`, `typecheck`,
`build`: pass
- `api:report`: 14 entries, 0 failed, no report change
- `vitest run`: 488 files, 20,073 passed, 11 skipped (includes the docs
tests)
- `pytest` in `packages/aimock-pytest` against the local build: 251
passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

public-api-addition Intended public API report changes reviewed for compatibility; freshness remains required

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Seed Speech TTS + ElevenLabs Scribe and Audio Isolation record & replay

2 participants