embodia_robot_agent
EmbodiaRobotAgent — 可嵌入、可插拔、单进程的机器人端到端对话 SDK。
把 语音 / 文本 → ASR / Brain → TTSA → 机器人本体(骨骼 / 音频 / 表情) 封装成统一 SDK,渲染目标为物理机器人本体,本体驱动以 RobotAdapter 可插拔接入。
定位
在星云「驱动 SDK」(接收骨骼/音频/表情帧并按时序下发)之上叠加端到端编排,形成可被第三方嵌入的机器人对话 SDK。与既有紧耦合整机方案(Avatar 驱动 + 音频路由 + 本地桥接)的区别:单进程、无本地桥接、本体可插拔、ASR/Brain 由星云后端编排。
两条连接(核心)
SDK 同时持有:
- E2E WebSocket(
E2EMPServer /ws/session)— 麦克风音频上行 +ask/speak/interrupt/voice_end/audio_input_on/off+asr_result/llm_response/speak_state_change事件。 - TTSA Socket.IO(复用清洗后的驱动核心)—
pure_player线上默认路径,接收已调度的 bone/audio/expression/event 帧和清除信号。
ask/speak/interrupt 走 E2E WS 的 JSON 消息(不是 TTSA send_text);机器人渲染帧仍由 TTSA 直出。
TTSA event_data.voice_end 必须由 Agent 转发到 E2E WS,用于释放旧播报结束后的新回答门控。文本模式首次连接 E2E 时追加 audio_input_off=1,直到显式调用 start_asr()。
目标用法
from embodia_robot_agent import EmbodiaRobotAgent, AgentConfig
from embodia_robot_agent.asr import SoundDeviceAudioSource
from embodia_robot_agent.robot import RobotProfile
from embodia_robot_agent.robot.mujoco_visualizer import MuJoCoVisualizerAdapter
# 客户交付:wire 布局 (g1.json) + MJCF (g1/scene.xml,含 freejoint);profile 是构造期数据,不进 AgentConfig
profile = RobotProfile.from_file("g1.json")
adapter = MuJoCoVisualizerAdapter.from_profile(profile, model_path="g1/scene.xml")
agent = EmbodiaRobotAgent(AgentConfig(
app_id="app_xxx", app_secret="...",
gateway_server="https://nebula.example.com",
fps=24, raw_audio=True,
# 可选注入:session_client / audio_input_off / 自定义 AudioUplinkEncoder
adapter=adapter, # 真机则替换为厂商 RobotAdapter
audio_source=SoundDeviceAudioSource(), # 也可由 adapter.audio_source 提供
))
agent.on_asr_result(lambda text, is_final: print("asr", text, is_final))
await agent.init(); await agent.start()
await agent.speak("欢迎。")
await agent.start_asr()
await agent.stop_asr()
await agent.stop()
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file embodia_robot_agent-0.0.1-py3-none-any.whl.
File metadata
- Download URL: embodia_robot_agent-0.0.1-py3-none-any.whl
- Upload date:
- Size: 61.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.8.19
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
48f382011f74922f7c83d5d48173b6b443272c3c5b8e36ca257550c5133cb0c0
|
|
| MD5 |
313daa40f0b6d828c333231e110c2602
|
|
| BLAKE2b-256 |
18a5487bfc0cf129fc760136aafdbe9443f9c66bef56510bccd3d230ae45b141
|