Repository navigation
接入 LabscriptAI MCP,并完善实验助手的拍照与小智语音 - #42
Merged
Merged
Conversation
The voice bridge now speaks only the conclusion (first sentence, at most 40 characters), greets with 收到。 and a single 还在做。, and ends the turn after a wait or question so the device can listen again. request_experiment_input accepts a voice_question that names only the missing facts, and a new request no longer replays the previous finished answer; an explicit progress query still reports it. Restore the voice diagnostics log for device-side verification.
capture_image and deck_vision_check results now carry a photoMarkdown or annotatedMarkdown line built from the absolute host path. The experiment prompt tells the assistant to place that line in its reply, so the chat renders the photo through the authenticated file route instead of leaving the operator with a bare local path.
Third-party racks such as the PE tip boxes are custom_beta definitions the local engine cannot resolve by name. The prompt now tells the assistant to fetch the exact load name, request its full definition with labware_lookup inspect include_definition, and load it with protocol.load_labware_from_definition.
Voice turns now open with 实验正在准备 and keep observing for up to two minutes with short progress lines; after that the device returns to standby and a late result is reported only when the operator asks. Missed results are no longer replayed on the next delegation, clarifications lead with the workbench voice_progress summary, and status queries can omit the job id. The browser also follows a changed voice session even without a new focus event, and replies show the annotated deck photo before the plain capture.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
问题
实验助手此前依赖内嵌的 LabscriptAI 源码和虚拟环境,协议模拟、台面拍照、识别和真机运行没有通过公开 MCP 接口提供;台面照片只显示原图,看不到本地 YOLO 的识别框。
小智语音在实际使用中还有三个问题:长任务在结果出来前就结束了本轮,操作员听不到结果;追问和结果会在下一次交办时被重复播报;网页不会跟随小智新开的对话。
修改
internal/experiment/labscriptai-tools.mjs。协议模拟、动画、配置图、台面拍照、识别、设备状态和运行都由锁定版本的外部插件负责;涉及设备的操作仍需要工作台确认,运行记录写回实验库。启动器按labscriptai-ot.lock.json安装并校验插件,替代内嵌源码与.venv;已有数据库打开时升级到 schema 3。升级说明见docs/upgrade-guide/v0.2.2-alpha.2/external-labscriptai。photoMarkdown/annotatedMarkdown,通过认证的文件路由在工作台内显示;提示词要求先贴带识别框的标注图,再贴原图。voice_progress)再说缺失条件(voice_question);查状态可以省略任务编号。policy: 'ask',不改变会话级策略(packages/interaction/user-approval)。限制:语音实际播报仍由托管模型决定,需在实体设备上验证;MCP 接口不提供空闲设备主动推送,2 分钟后才完成的结果只在用户主动询问时播报。
验证
node --import tsx/esm --test internal/xiaozhi/*.test.mjs internal/experiment/tests/agent-tools.test.mjs:61 个测试通过。pnpm exec vitest run packages/client/ui-sidebar-experiment:45 个测试通过。pnpm --filter @deepseek-ai/dsh-client-ui-sidebar-experiment bundle:客户端打包成功。pnpm run verify-translation-pairing:中英文配对检查通过。