DCFA_failure_attribution.py:1093: An error occurred during processing of ./DCFA/...

2026年04月04日 19:29 processing

错误信息

--- Starting Analysis for ./DCFA/test_input/log_251_wb.json --- [2026-04-04 19:24:28] INFO DCFA_failure_attribution.py:234: --- Running: Event Extraction --- [2026-04-04 19:24:29] INFO _base_client.py:1071: Retrying request to /chat/completions in 0.497493 seconds [2026-04-04 19:24:30] INFO _base_client.py:1071: Retrying request to /chat/completions in 0.929327 seconds [2026-04-04 19:24:31] ERROR DCFA_failure_attribution.py:1093: An error occurred during processing of ./DCFA/test_input/log_251_wb.json: Error code: 503 - {'error': {'code': '', 'message': '所有令牌分组 default 下对于模型 deepseek-r1-32b 均无可用渠道,请更换分组尝试 (request id: 2026040419243113779537144pnrXfH)', 'type': 'rix_api_error'}}. Skipping to next log file.

AI 解决方案

报错分析报告

1.错误翻译


原文:All token groups under the default group have no available channels for the model deepseek-r1-32b, please try changing the group
译文:所有令牌分组 default 下对于模型 deepseek-r1-32b 均无可用渠道,请更换分组尝试

2.原因分析


  • 根本原因:DMXAPI平台默认令牌分组(default)中,模型deepseek-r1-32b无可用调用渠道。

  • 发生位置DCFA_failure_attribution.py:1093处理./DCFA/test_input/log_251_wb.json时,调用/chat/completions接口重试后触发503错误(rix_api_error类型)。
  • 3. 解决方案


    修改API调用的令牌分组为可用分组(如new_group),示例代码如下:
    from openai import OpenAI
    
    # 初始化客户端时指定备用分组
    client = OpenAI(
        api_key="your_dmxapi_key",
        base_url="https://api.dmxapi.cn/v1",  # 替换为实际BaseURL
        default_headers={"Group": "new_group"}  # 更换为平台允许的可用分组
    )
    
    # 调用示例(保持原逻辑)
    response = client.chat.completions.create(
        model="deepseek-r1-32b",
        messages=[{"role": "user", "content": "test"}]
    )
    

    注:需先通过DMXAPI控制台确认new_group分组下有该模型的可用渠道。

    4. 预防措施


  • 前置检查:调用API前通过平台「渠道状态接口」验证目标模型+分组的可用性,避免盲目重试。

  • 容错设计:配置分组 fallback 列表(如["group1", "group2"]),默认分组失败时自动切换。
  • 推荐工具:DMXAPI控制台(查看渠道状态)、Postman(测试分组可用性)。

    ---
    分析完成,请优先确认平台可用分组后调整配置。