错误信息: (request id: 20260403075435567712354AIpp5uU5) 堆栈信息: AI_APICallError: (requ...

2026年04月03日 15:59 processing

错误信息

错误名称: AI_APICallError 错误信息: (request id: 20260403075435567712354AIpp5uU5) 堆栈信息: AI_APICallError: (request id: 20260403075435567712354AIpp5uU5) at file:///Applications/Cherry%20Studio.app/Contents/Resources/app.asar/out/renderer/assets/dist-DWBkLJID.js:1704:11 at async postToApi (file:///Applications/Cherry%20Studio.app/Contents/Resources/app.asar/out/renderer/assets/dist-DWBkLJID.js:1599:24) at async OpenAICompatibleChatLanguageModel.doStream (file:///Applications/Cherry%20Studio.app/Contents/Resources/app.asar/out/renderer/assets/dist-MiiZ7jiT.js:452:48) at async wrapStream (file:///Applications/Cherry%20Studio.app/Contents/Resources/app.asar/out/renderer/assets/store-CA-rHPlI.js:48641:32) at async fn (file:///Applications/Cherry%20Studio.app/Contents/Resources/app.asar/out/renderer/assets/store-CA-rHPlI.js:47507:17) at async file:///Applications/Cherry%20Studio.app/Contents/Resources/app.asar/out/renderer/assets/store-CA-rHPlI.js:43861:19 at async _retryWithExponentialBackoff (file:///Applications/Cherry%20Studio.app/Contents/Resources/app.asar/out/renderer/assets/store-CA-rHPlI.js:44024:10) at async streamStep (file:///Applications/Cherry%20Studio.app/Contents/Resources/app.asar/out/renderer/assets/store-CA-rHPlI.js:47476:109) at async fn (file:///Applications/Cherry%20Studio.app/Contents/Resources/app.asar/out/renderer/assets/store-CA-rHPlI.js:47782:5) at async file:///Applications/Cherry%20Studio.app/Contents/Resources/app.asar/out/renderer/assets/store-CA-rHPlI.js:43861:19 错误原因: "[undefined]" 状态码: 503 请求路径: https://www.dmxapi.cn/v1/chat/completions 请求体: { "model": "claude-opus-4-6-thinking", "user": "[undefined]", "max_tokens": "[undefined]", "temperature": "[undefined]", "top_p": 1, "frequency_penalty": "[undefined]", "presence_penalty": "[undefined]", "response_format": "[undefined]", "stop": "[undefined]", "seed": "[undefined]", "thinking": { "type": "enabled", "budget_tokens": 3686 }, "serviceTier": "[undefined]", "reasoning_effort": "[undefined]", "verbosity": "[undefined]", "messages": [ { "role": "system", "content": "# "reasoning_content": "The user wants me to analyze their Q11 answer and then ask more questions specifically about the \"扩充prompt\" (expansion prompts) design, since they emphasized this is very important for intellectual openness and innovation.\n\nLet me analyze their answer and think about what additional details I need to clarify about the expansion prompt mechanism.\n\nTheir answer clarifies:\n1. Expansion prompts are lightweight - not full architectural builds\n2. They serve as \"dimension expansions\" for areas the main prompt doesn't cover\n3. They're intellectual explorations / thought openers\n4. After review, they CAN be merged back into the main prompt\n\nThis means the expansion prompt mechanism needs careful design because:\n\n\n- They need genuine creativity rather than superficial variations\n- Identifying real blind spots is crucial, not just rephrasing existing content\n- The pathway for merging successful expansions back into the main prompt needs to be well-defined\n- The quality of blind spot detection directly impacts the system's effectiveness\n\nNow I'm considering what to ask next: whether blind spot identification should be free-form or follow structured categories, if expansion prompts should include merge suggestions, what the optimal number of expansions is to balance coverage without overwhelming the system, and whether certain expansions should be prioritized over others.\n\nI'm also thinking about whether the priority system with high/medium/low labels should remain, if domain-specific context matters for blind spot scanning, and how explicitly the system should map where each expansion could fit back into the original prompt.\n", "tool_calls": "[undefined]" }, { "role": "user", "content": "Q12 我认为你的这些扫描维度都和“思维探针”没关系,你这些扫描维度感觉都是诊断层面的,不属于思维开拓层面,还有我认为不需要在元提示词中做这方面的硬性设置\nQ13 A\nQ14 聚焦最有价值的维度\nQ15 B,少量会严重影响最终交付质量的A\n\n请分析我的回答,然后继续向我提问确认更多细节。" } ], "tools": "[undefined]", "tool_choice": "[undefined]", "stream": true, "stream_options": { "include_usage": true } } 响应首部: { "cache-control": "no-cache", "content-type": "text/event-stream", "date": "Fri, 03 Apr 2026 07:54:48 GMT", "server": "nginx", "x-rixapi-request-id": "202604031553216072100950bI2MVRR" } 响应内容: { "error": { "message": " (request id: 20260403075435567712354AIpp5uU5)", "type": "rix_api_error", "param": "", "code": null } } 数据: { "error": { "message": " (request id: 20260403075435567712354AIpp5uU5)", "type": "rix_api_error", "param": "", "code": null } }

AI 解决方案

报错分析报告

1.错误翻译


原文:AI_APICallError: (request id: 20260403075435567712354AIpp5uU5)
译文:AI_API调用错误:(请求ID: 20260403075435567712354AIpp5uU5)

2.原因分析


  • 根本原因:向DMXAPI的/v1/chat/completions接口发送请求时,同时存在两个问题:

  • 1. 服务器返回503状态码(服务暂时不可用);
    2. 请求体中多个关键参数(user/max_tokens/temperature等)被设为[undefined],导致参数无效。
  • 发生位置postToApi函数调用OpenAICompatibleChatLanguageModel.doStream的异步API请求过程中(dist-DWBkLJID.js:1599:24)。
  • 3. 解决方案


    替换[undefined]参数为有效值,验证服务状态后重试。以下是JavaScript修复示例
    // 修复后的API调用代码(Fetch示例)
    const API_KEY = "your_dmxapi_key";
    const API_URL = "https://www.dmxapi.cn/v1/chat/completions";
    
    async function callDmxApi() {
      const requestBody = {
        model: "claude-opus-4-6-thinking",
        messages: [
          { role: "system", content: "你的系统提示" },
          { role: "user", content: "用户问题" }
        ],
        max_tokens: 4096,       // 替换为有效数值
        temperature: 0.7,        // 替换为合理范围值(0-2)
        top_p: 1,
        stream: true,
        thinking: { type: "enabled", budget_tokens: 3686 }
      };
    
      try {
        const response = await fetch(API_URL, {
          method: "POST",
          headers: {
            "Content-Type": "application/json",
            "Authorization": `Bearer ${API_KEY}`
          },
          body: JSON.stringify(requestBody)
        });
        if (!response.ok) throw new Error(`HTTP ${response.status}`);
        return response;
      } catch (error) {
        console.error("API调用失败:", error);
        // 可添加重试逻辑(如指数退避)
      }
    }
    

    4.️ 预防措施


  • 参数校验:调用API前用工具(如TypeScript/Joi)验证所有必填参数,禁止传递undefined

  • 服务容错:实现指数退避重试(参考_retryWithExponentialBackoff逻辑),并监控DMXAPI状态页;

  • 工具推荐:用Postman/Insomnia预测试请求体,确保参数符合文档要求。
  • ---
    :若服务持续503,请联系DMXAPI支持确认节点可用性。