系统管理

系统初始化、就绪检查和关闭功能。

系统初始化

获取 API 实例

get_api_instance(task='terminal', namespace='', parameters='')

get singleton DayStarAPI instance

Parameters:
  • task (str) –

  • namespace (str) –

  • parameters (str) –

Return type:

DayStarAPI

系统就绪检查

daystar_ready(timeout=30)
Parameters:

timeout (int) –

Return type:

State

系统关闭

daystar_shutdown(exit=True)

shutdown

Parameters:

exit (bool) –

Return type:

None

Agent 控制面

转发到 daystar_agent 进程的控制面接口(经 /sdk/agent/* ROS 服务 → agent 对内 /agent/*)。属外部控制面操作,不供机器人自身任务规划。

切换 LLM 模型组

switch_llm_group(group, timeout=8)

切换 agent 的 LLM 模型组(一键 local / 云端 / 混合)。

Parameters:
  • group (str) – 目标模型组名。常用取值:cloud(全云端)/ local(全本地)/ hybrid(本地分类+云端规划)。

  • timeout (int) – 超时秒数(默认 8);<=0 表示无限等待直到服务返回。

Returns:

切换结果
  • success: 是否成功

  • message: 结果说明

  • active_group: 切换后当前激活组(失败时为切换前的组)

  • available_groups: 所有可用模型组名

Return type:

SwitchLlmGroupResponse

Examples:

result = switch_llm_group("local")
if result.success:
    print("已切换到", result.active_group)

Note

  • 转发到 daystar_agent 对内服务 /agent/switch_llm_group。

  • 属外部控制面操作;agent 进程持有 LLMManager 状态,由其托管。

语音服务开关

enable_voice_service(enabled, timeout=8)

开关本体语音服务(F1)。关闭后停止 ASR/TTS 引擎与唤醒,仅 Web/文字通道可用。

Parameters:
  • enabled (bool) – True 开启,False 关闭。

  • timeout (int) – 超时秒数(默认 8);<=0 表示无限等待直到服务返回。

Returns:

success / message

Return type:

AgentSwitchResponse

Examples:

enable_voice_service(False)   # 关闭语音服务

Note

  • 转发到 daystar_agent 对内服务 /agent/enable_voice_service。

连续对话开关

enable_continuous_dialog(enabled, timeout=8)

开关连续对话(F2)。开启时一句播报后保留免唤醒窗口,可多轮 follow-up。

Parameters:
  • enabled (bool) – True 开启,False 关闭。

  • timeout (int) – 超时秒数(默认 8);<=0 表示无限等待直到服务返回。

Returns:

success / message

Return type:

AgentSwitchResponse

Examples:

enable_continuous_dialog(True)

Note

  • 转发到 daystar_agent 对内服务 /agent/enable_continuous_dialog。

声源朝向开关

enable_sound_orientation(enabled, timeout=8)

开关音源朝向反馈(F3)。开启后唤醒时朝声源方向反馈。

Parameters:
  • enabled (bool) – True 开启,False 关闭。

  • timeout (int) – 超时秒数(默认 8);<=0 表示无限等待直到服务返回。

Returns:

success / message

Return type:

AgentSwitchResponse

Examples:

enable_sound_orientation(True)

Note

  • 转发到 daystar_agent 对内服务 /agent/enable_sound_orientation。

安全模式开关

enable_safety_mode(enabled, timeout=8)

开关安全模式(F4)。开启后受 safety_mode 前置约束的动作会被拦截。

Parameters:
  • enabled (bool) – True 开启,False 关闭。

  • timeout (int) – 超时秒数(默认 8);<=0 表示无限等待直到服务返回。

Returns:

success / message

Return type:

AgentSwitchResponse

Examples:

enable_safety_mode(True)

Note

  • 转发到 daystar_agent 对内服务 /agent/enable_safety_mode。

相关数据类型