voicesim

GitHub

本地模拟 ElevenLabs 语音交互及 OpenAI 音频服务,提供固定脚本响应与调试控制台。用于在不依赖真实 API 的情况下测试语音代理、签名 URL 生成及通话流程,支持状态查看、调用清理及负载限制配置。

.claude/skills/voicesim/SKILL.md langwatch/langwatch

Trigger Scenarios

测试语音代理逻辑 模拟 ElevenLabs 签名 URL 本地语音通话调试 验证语音提供商集成

Install

npx skills add langwatch/langwatch --skill voicesim -g -y
More Options

Non-standard path

npx skills add https://github.com/langwatch/langwatch/tree/main/.claude/skills/voicesim -g -y

Use without installing

npx skills use langwatch/langwatch@voicesim

指定 Agent (Claude Code)

npx skills add langwatch/langwatch --skill voicesim -a claude-code -g -y

安装 repo 全部 skill

npx skills add langwatch/langwatch --all -g -y

预览 repo 内 skill

npx skills add langwatch/langwatch --list

SKILL.md

Frontmatter
{
    "name": "voicesim",
    "description": "Run ElevenLabs voice calls locally against voicesim, haven's voice-provider stand-in. Use when someone says 'haven voice', 'voicesim', 'haven up +voice', 'test a voice agent without ElevenLabs', 'signed URL', 'convai socket', 'fake ElevenLabs', 'voice call console', 'haven sim voice', or needs a deterministic voice call in a test.",
    "user-invocable": true
}

voicesim

Fakes ElevenLabs Conversational AI (the signed-URL mint and the conversation socket) and OpenAI's pcm speech and transcription. Every answer is canned: tones for audio, four scripted agent lines, one fixed caller transcript. Keys are accepted and never checked: a dev shim, never expose it. Code: services/sims/voicesim, console apps/sims/src/voice.

Run it

  • Opt-in: haven up +voice (sticky). Runs in the go lane by default (see sims).
  • Already on? haven sim voice status answers with the base URLs; the seeded org then has an ElevenLabs provider at voicesim, no clean instance needed.
  • Console: https://voice.<slug>.langwatch.localhost (calls, transcripts, events, Clear calls); haven status shows the loopback port.
  • Unless .env names ELEVENLABS_BASE_URL, the overlay sets it to http://127.0.0.1:<port>, a dummy ELEVENLABS_API_KEY when none is set, and VOICE_UNSAFE_ALLOW_LOOPBACK_PROVIDERS=1.
  • The seed then stores the ElevenLabs provider row at voicesim. Standalone: make service svc=voicesim (:5591).

The dev switch

VOICE_UNSAFE_ALLOW_LOOPBACK_PROVIDERS (packages/config/src/deployment-facts.ts) is the only thing that lets the product call a loopback voice host. One rule decides it, isAllowedElevenLabsUrl in @langwatch/model-provider-contract, used by the seed's keys schema, the gateway's credential read and the signed-URL check. On, it admits http/ws on 127.0.0.1 or localhost with an explicit port, nothing else. Off (every production process), those three points refuse loopback. The registry schema never carries the switch, so the settings form still refuses a loopback base URL.

OpenAI audio is not redirected: the product has no audio-only OpenAI base URL, and OPENAI_BASE_URL would move every model call.

Inspect and assert

GET /_sim/api/calls     # newest first: turns, frame counts, protocol events
DELETE /_sim/api/calls  # forget every call (204); ids keep counting
GET /_sim/api/status    # stack, call count, the base URLs to point a provider at
GET /v1/convai/conversation/get-signed-url?agent_id=<id>
POST /v1/audio/speech   POST /v1/audio/transcriptions

A call id is conv_voicesim_0001, 0002, ... An unfaked provider path answers 404.

Seed and reset

  • VOICESIM_SEED=1 (haven sets it) records one finished two-turn call for agent agent_voicesim_seed, so the console starts with content.
  • Nothing persists: a restart of the lane that hosts it (haven restart go) empties it.

Tests and load

  • Caps: VOICESIM_MAX_CALLS (default 200, oldest dropped) and VOICESIM_MAX_EVENTS_PER_CALL (default 500, the rest counted as droppedEvents).
  • Drive the loopback port directly; go test ./services/sims/voicesim covers the protocol.
  • The Twilio phone transport is not faked.

From a terminal or agent

--json on every read; non-zero exit on failure; --stack <slug> reads another worktree.

haven sim voice status | list | get <id> | clear

Version History

  • c0c14dc Current 2026-10-19 19:35

Same Skill Collection

.claude/skills/analyticssim/SKILL.md
.claude/skills/browser-pair/SKILL.md
.claude/skills/browser-test/SKILL.md
.claude/skills/chakra-ui-builder/SKILL.md
.claude/skills/chakra-ui-refactor/SKILL.md
.claude/skills/code-review/SKILL.md
.claude/skills/code-search/SKILL.md
.claude/skills/feature-map/SKILL.md
.claude/skills/githubsim/SKILL.md
.claude/skills/haven-auth/SKILL.md
.claude/skills/haven-db/SKILL.md
.claude/skills/haven-orb/SKILL.md
.claude/skills/haven-play/SKILL.md
.claude/skills/haven-seed/SKILL.md
.claude/skills/haven-setup/SKILL.md
.claude/skills/idpsim/SKILL.md
.claude/skills/lambdasim/SKILL.md
.claude/skills/langwatch-kanban/SKILL.md
.claude/skills/llmsim/SKILL.md
.claude/skills/mailsim/SKILL.md
.claude/skills/module/SKILL.md
.claude/skills/outboundsim/SKILL.md
.claude/skills/ownership/SKILL.md
.claude/skills/repo-tree/SKILL.md
.claude/skills/storagesim/SKILL.md
plugins/langwatch/skills/langwatch/SKILL.md
services/langy-agent/skills/github/SKILL.md
skills/_compiled/native/agent-best-practices/SKILL.md
skills/_compiled/native/agent-performance/SKILL.md
skills/_compiled/native/automations/SKILL.md
skills/_compiled/native/code-changes/SKILL.md
skills/_compiled/native/context-sweet-spot/SKILL.md
skills/_compiled/native/daily-insights/SKILL.md
skills/_compiled/native/dashboard-widgets/SKILL.md
skills/_compiled/native/datasets/SKILL.md
skills/_compiled/native/debug-instrumentation/SKILL.md
skills/_compiled/native/debug-with-langwatch/SKILL.md
skills/_compiled/native/drive-the-ui/SKILL.md
skills/_compiled/native/eval-triage/SKILL.md
skills/_compiled/native/evaluate-multimodal/SKILL.md
skills/_compiled/native/evaluations/SKILL.md
skills/_compiled/native/experiments/SKILL.md
skills/_compiled/native/find-traces/SKILL.md
skills/_compiled/native/generate-rag-dataset/SKILL.md
skills/_compiled/native/github/SKILL.md
skills/_compiled/native/guided-onboarding/SKILL.md
skills/_compiled/native/level-up/SKILL.md
skills/_compiled/native/lwql-charts/SKILL.md
skills/_compiled/native/online-evaluations/SKILL.md

Metadata

Files
0
Version
c0c14dc
Hash
81a8c25a
Indexed
2026-10-19 19:35

Home - Wiki
Copyright © 2011-2026 iteam. Current version is 2.155.2. UTC+08:00, 2026-10-20 05:40
浙ICP备14020137号-1