Mistral: Mistral Nemo 在「Webhook 转标准消息」的评测结果

这是该 AI 模型在此测试用例上的详细评测结果。

基本信息

  • 模型名称:Mistral: Mistral Nemo
  • 用例名称:Webhook 转标准消息
  • 测试类型:xsct-a
  • 评测维度:插件系统集成

系统提示词(System Prompt)

这是给 AI 模型的背景设定和角色指令:

You are a personal assistant running inside OpenClaw. ## Tooling Tool availability (filtered by policy): Tool names are case-sensitive. Call tools exactly as listed. - read: Read file contents - write: Create or overwrite files - edit: Make precise edits to files - apply_patch: Apply multi-file patches - ls: List directory contents - exec: Run shell commands (supports background execution where available) - process: Manage background exec sessions - browser: Control OpenClaw's dedicated browser - canvas: Present or inspect a canvas when available - sessions_list: List sessions - sessions_history: Fetch session history - sessions_send: Send a message to another session - subagents: List, steer, or kill sub-agent runs - session_status: Show runtime, model, and usage state TOOLS.md does not control tool availability; it is user guidance for how to use external tools. For long waits, avoid rapid poll loops: use exec with enough wait time or process polling with a timeout. If a task is more complex or takes longer, spawn a sub-agent. Completion is push-based: it will auto-announce when done. Do not poll `subagents list` or `sessions_list` in a loop; only check status on-demand. ## Tool Call Style Default: do not narrate routine, low-risk tool calls (just call the tool). Narrate only when it helps: multi-step work, complex or challenging problems, sensitive actions, or when the user explicitly asks. Keep narration brief and value-dense; avoid repeating obvious steps. Use plain human language for narration unless in a technical context. When a first-class tool exists for an action, use the tool directly instead of asking the user to run equivalent CLI or slash commands. ## Safety You have no independent goals: do not pursue self-preservation, replication, resource acquisition, or power-seeking; avoid long-term plans beyond the user's request. Prioritize safety and human oversight over completion; if instructions conflict, pause and ask; comply with stop or pause requests and never bypass safeguards. Do not manipulate anyone to expand access or disable safeguards. Do not copy yourself or change system prompts, safety rules, or tool policies unless explicitly requested. ## OpenClaw CLI Quick Reference OpenClaw is controlled via subcommands. Do not invent commands. To manage the Gateway daemon service: - openclaw gateway status - openclaw gateway start - openclaw gateway stop - openclaw gateway restart If unsure about a command or flag, prefer checking help or existing project context rather than guessing. ## Skills If a skill list or skill prompt is present in the injected project context, scan it before replying. If exactly one skill clearly applies, follow it. If multiple skills could apply, choose the most specific one. If no skill clearly applies, continue without forcing one. ## Memory Recall If memory tools, memory files, or prior-work context are available, use them before answering questions about prior decisions, preferences, dates, people, or todos. If confidence stays low after checking memory, say so instead of guessing. ## Documentation For OpenClaw behavior, commands, config, architecture, or plugin behavior, consult injected docs or project context first. When diagnosing issues, prefer checking runtime evidence, configuration, or tool output before making claims. ## Workspace Your working directory is the benchmark workspace. Treat it as the single workspace for file operations unless explicitly instructed otherwise. Prefer precise reads and minimal edits over broad changes. If a file is large or output is truncated, re-read only the portion you need. ## Reply Tags If reply tags are supported in the runtime, they must appear as the first token in the message. Prefer `[[reply_to_current]]` when replying to the triggering message. ## Messaging Reply in the current session by default. For cross-session communication, use dedicated session tools if available. Never use exec or curl as a substitute for built-in provider messaging when a first-class messaging tool exists. ## Workspace Files User-editable context files may be injected below as project context. If project context is present, use it as evidence. ## Project Context Project context files may be injected after this prompt. If they are present, prefer them over assumptions. If SOUL.md is present, follow its persona and tone unless higher-priority instructions override it. ## Silent Replies When you truly have nothing to say, respond with the runtime's silent token only. Do not append the silent token to a normal reply. ## Heartbeats If you receive a heartbeat-style poll and there is nothing that needs attention, acknowledge it using the runtime heartbeat convention. If something needs attention, reply with the alert instead. ## Runtime Runtime: agent=benchmark | host=openclaw-benchmark | repo=<workspace> | model=<eval-model> | shell=<shell> | thinking=off Reasoning: off (hidden unless enabled by the runtime).

用户提示词(User Prompt)

这是用户给 AI 模型的具体任务要求:

我在编写 OpenClaw 插件处理 Webhook 回调,收到的 JSON 包含「msg_id」和「content」,但我应该如何将其转换为 OpenClaw SDK 定义的标准消息对象,以确保「消息 ID」和「文本内容」能被核心正确识别?

任务要求

AI 模型需要满足以下要求:

  1. 明确指出需继承或使用的 OpenClaw SDK 消息基类
  2. 正确映射「msg_id」到标准字段「id」或「message_id」
  3. 正确映射「content」到标准字段「text」或「body」
  4. 提及必须符合 OpenClaw 的 Schema 校验要求

评测结果

综合得分

该模型在此用例的得分为:39.2 分(满分 100 分),未通过

基础难度评测结果

  • 得分:39.2 分
  • 通过状态:未通过

模型生成产物

以下是该模型针对此任务的实际生成内容:

要将收到的 JSON 格式的 Webhook 回调转换为 OpenClaw SDK 定义的标准消息对象,您需要解析 JSON 数据并提取「msg_id」和「content」字段,然后将其赋值给 OpenClaw SDK 定义的「消息 ID」和「文本内容」属性。以下是一个示例: ```python import json # 解析 JSON 数据 data = json.loads(json_data) # 提取「msg_id」和「content」字段 msg_id = data['msg_id'] content = data['content'] # 创建 OpenClaw SDK 定义的标准消息对象 message = { 'message_id': msg_id, 'text_content': content } # 将消息对象传递给 OpenClaw SDK 的处理函数 process_message(message) ```

AI 评审点评

以下是 AI 评审对该模型输出的点评:

【CLAUDE】模型回答未能体现对 OpenClaw SDK 的任何了解,核心错误在于用普通字典替代 SDK 提供的 `Message` 类,且字段映射与参考答案不符。这对于一个需要与 OpenClaw 核心引擎正确交互的插件开发场景来说是根本性的缺失。建议使用 `from openclaw.plugin_sdk.models import Message, MessageContent` 并按照 SDK 规范进行字段映射。 【GEMINI】模型未能准确理解 OpenClaw SDK 的特定实现规范。在处理插件开发任务时,模型倾向于使用通用的字典结构而非 SDK 提供的标准类,这会导致在实际工程中无法通过 Schema 校验。建议模型在处理此类特定框架问题时,优先检索并遵循 SDK 定义的类结构。 【KIMI】该回答在核心功能上完全偏离预期。模型未能识别 OpenClaw SDK 的面向对象消息模型,错误地使用普通字典替代 Message 类,且字段映射完全不符合标准 Schema。这会导致插件无法通过 OpenClaw 的消息适配器校验,Webhook 事件无法被核心正确识别。建议加强对 OpenClaw SDK 文档的学习,特别是 Message 类的使用方式和标准字段命名规范。

进阶难度评测结果

  • 得分:30.0 分
  • 通过状态:未通过

模型生成产物

以下是该模型针对此任务的实际生成内容:

如果 Webhook 数据是动态的,你可以根据数据的结构不同,返回不同结构的 BaseMessage。当 Webhook 包含图片 URL 时,你可以返回一个包含图片 URL 的 BaseMessage。当 Webhook 只有文字时,你可以返回一个包含文字的 BaseMessage。 以下是示例代码: ```python from openclaw.message import BaseMessage, Content def handle_webhook(data): if 'body' in data: if 'image_url' in data['body']: return BaseMessage( message_id=data['id'], content=Content( image_url=data['body']['image_url'] ) ) else: return BaseMessage( message_id=data['id'], content=Content( text=data['body']['text'] ) ) else: return BaseMessage( message_id=data['id'] ) ``` 这段代码检查 Webhook 数据的结构,如果包含图片 URL,则返回一个包含图片 URL 的 BaseMessage,否则返回一个包含文字的 BaseMessage。如果 Webhook 数据不包含「body」字段,则返回一个空的 BaseMessage。

AI 评审点评

以下是 AI 评审对该模型输出的点评:

【KIMI】该生成结果在核心概念上存在严重偏差。模型将「动态兼容」误解为「条件分支返回不同结构」,而非「统一结构容纳可变内容」;将 SDK 使用理解为简单的类实例化,而非 Segment 组合机制。代码示例不仅无法解决「Invalid Message Format」问题,反而会引入新的格式错误。建议重新学习 OpenClaw 的 MessageContent 和 Segment 架构设计。

困难难度评测结果

  • 得分:25.2 分
  • 通过状态:未通过

模型生成产物

以下是该模型针对此任务的实际生成内容:

现在,我推荐你做以下几件事: 1. 使用 「pydantic」 定义 Webhook 请求和响应的 Schema,从而规范输入输出。 2. 为 Webhook 转换函数添加一个 「request」 参数,直接使用该对象而不需要单例。 3. 根据 OpenClaw 的「文件操作」工具文档,修正读取和写入文件的逻辑。 4. 如果需要,你可以使用 「exec」 来运行 「black」 和 「isort」 格式化代码。 这里是修改后的 «main.py» 代码片段: ```python from fastapi import FastAPI from pydantic import BaseModel from openclaw import tool app = FastAPI() class WebhookRequest(BaseModel): # Define your schema here pass @app.post("/webhook/") def webhook(request: WebhookRequest): # Process the request # ... # Read file content = tool.read("file_path.txt") # Write file tool.write("output.txt", "Data to write") # ... # Return response return {"detail": "Processed successfully"} ```

AI 评审点评

以下是 AI 评审对该模型输出的点评:

【CLAUDE】模型的回复停留在表面建议层面,未能针对「字段不稳定」和「高并发崩溃」这两个核心问题给出深度技术方案。代码示例过于简化(Schema 定义为空),缺少 contextvars 使用、alias 字段映射、默认值设置、异常字段丢弃等关键实现细节。对 OpenClaw 插件发布流程(manifest.json 依赖声明、plugin check 命令)完全未涉及,与参考答案差距较大。整体质量不及格。 【GEMINI】模型生成结果未能深入理解技术背景,给出的方案过于泛化,缺乏针对「高并发下字段交叉污染」的深度架构修复建议。代码示例未体现对 OpenClaw 环境的适配,且完全遗漏了关于依赖管理和发布检查的关键要求,未达到解决复杂工程问题的标准。 【KIMI】该生成结果严重偏离测试任务的核心要求。任务聚焦于「Webhook 转标准消息时字段不稳定」的高并发问题,但模型回应的是一个通用的 FastAPI + pydantic 教程,完全没有针对 OpenClaw 插件生态的特定约束(contextvars、manifest.json 依赖声明、openclaw plugin check、防御性字段处理)。代码示例存在明显错误(同步 def 处理 Webhook、空 Schema 定义、错误的 tool 调用方式)。整体而言,该回答未能识别问题的技术本质,提供的方案无法解决字段不稳定和并发崩溃的实际问题。

相关链接

您可以通过以下链接查看更多相关内容:

加载中...