AGENT SKILL

realtime-api

Use and debug speech-to-speech's OpenAI Realtime-compatible WebSocket/WebRTC API, session lifecycle, tool calls, cancellation, and LLM proxy endpoints.

License 许可
Apache-2.0
最近更新
2026-09-03
Stars
★ 351
Forks
27

01 前言 Front Matter

name
realtime-api
license
Apache 2.0
metadata
{ "disco-role": "operating" }
description
Use and debug speech-to-speech's OpenAI Realtime-compatible WebSocket/WebRTC API, session lifecycle, tool calls, cancellation, and LLM proxy endpoints.
disable-model-invocation
true

02 资源文件 5

03 SKILL.md 正文

Realtime API

Use this sub-skill when the task involves a client, service, gateway, or test that speaks to speech-to-speech over its OpenAI Realtime-compatible API.

Route by surface

  • WebSocket clients: read Realtime protocol for /v1/realtime, event ordering, PCM chunking, and turn lifecycle.
  • Python/OpenAI SDK clients or the packaged audio client: read Python client and proxy.
  • WebRTC clients: read WebRTC transport before using /v1/realtime/calls, RTP audio, or TURN/ICE settings.
  • LLM side-task proxy: read Python client and proxy before enabling /v1/chat/completions or /v1/responses on the speech server.
  • Command selection, server host/port, serve/local/talk: route to cli-and-server.
  • STT/LLM/TTS models, direct audio-input model compatibility, voices, and optional extras: route to components-and-backends.
  • Browser demo connection modes and web tools: route to browser-demo.

Operating sequence

  1. Confirm the server endpoint. WebSocket clients use a full URL ending in /v1/realtime; WebRTC clients POST SDP to /v1/realtime/calls.
  2. Send or inspect session.update before response generation. Session updates deep-merge explicit fields: changing output voice does not reset input turn detection or tools unless those fields are explicitly replaced or cleared.
  3. Stream microphone PCM over WebSocket with input_audio_buffer.append, or use RTP media over WebRTC. Do not send input_audio_buffer.append on the WebRTC data channel.
  4. Observe response serialization: only one response.create may be active at a time; wait for response.done or implement a client-side response queue.
  5. For barge-in/cancel bugs, track both protocol events and server-side generation/response-key behavior. See troubleshooting.
  6. Use the bundled probe when only endpoint readiness is needed: scripts/realtime_endpoint_probe.py.

Key invariants

  • Pipeline audio is 16 kHz PCM16 internally; WebSocket sends base64 PCM chunks as JSON events, while WebRTC uses RTP/Opus on the media track.
  • session.created is the first event after a WebSocket connection or data channel open. Successful session.update receives session.updated.
  • Assistant output may interleave text and tool calls. Tool results are sent as conversation.item.create with type: function_call_output; send response.create afterward only when the tool result needs a spoken/text follow-up.
  • Barge-in is cooperative: VAD emits speech events, the send loop cancels the active generation, stale LLM/TTS output is discarded, and clients clear unplayed audio.
  • The LLM proxy is unauthenticated by this package. Enable it only on loopback, a trusted network, or behind a gateway that owns access control.

Detailed event schemas, client patterns, transport differences, and recovery steps are bundled in the linked references above.

04 同仓库更多 Skills

VectorSpaceLab
VectorSpaceLab/AREX-Skill

passnet-triton-opt

Make a single PassNet Triton kernel fast AND numerically faithful: performance model (when a replacement can win at all), block/grid/warp tuning, autotune policy, launch overhead, and per-op numeric recipes to pass the dtype baseline tolerances. Use when a pass matches and is correct but speedup below expected, or when correctness fails by small numeric margins.

★ 351
VectorSpaceLab
VectorSpaceLab/AREX-Skill

passnet-solve

END-TO-END playbook for solving one PassNet sample: analyze the computation graphs, decide the optimization strategy (what to fuse, what to replace, what to leave alone), drive the iteration loop, and maximize the sample score. This is the ENTRY skill — invoke it first for any PassNet optimization task; it tells you when to use passnet-pattern-fusion, passnet-triton-opt and passnet-feedback.

★ 351
VectorSpaceLab
VectorSpaceLab/AREX-Skill

passnet-skill

PassNet GPU kernel optimization via compiler passes. Design and implement Triton-based optimization passes, create pass files under ./pass_dir/, self-evaluate with pass_evaluator, and iterate to maximize GPU speedup.

★ 351
VectorSpaceLab
VectorSpaceLab/AREX-Skill

passnet-pattern-fusion

Author PassNet pass files: write patterns that actually MATCH the FX graph, pick fusion regions (which ops to absorb into one Triton kernel), and structure multi-pass submissions with the mandatory shared-dispatch architecture. Use when creating or fixing pattern()/replacement_args()/replacement_func() files, when a pass "failed to match", or when deciding how to fuse multiple kernels/ops.

★ 351
VectorSpaceLab
VectorSpaceLab/AREX-Skill

passnet-orchestrate

Round/batch planning and decision support for PassNet graph optimization. Use for multi-sample triage, worker allocation, eval-budget policy, and post-eval keep/revert decisions. For solving one concrete sample end to end, use passnet-solve as the entry skill; consult this skill only when you need broader planning or a specific decision gate.

★ 351
VectorSpaceLab
VectorSpaceLab/AREX-Skill

passnet-feedback

Fast, deterministic feedback for PassNet work: pre-flight pattern/match verification WITHOUT burning a GPU evaluation, per-node bottleneck analysis of a sample's graphs, and eval-log parsing into per-variant status + estimated score + failure classification. Use BEFORE every GPU evaluation (check_pattern), at the START of a sample (analyze_graph), and AFTER every evaluation (parse_eval_log).

★ 351