{
  "id": "llm/parallel-function-call-schema-conflict",
  "signature": "Error: Parallel function calls require distinct function names — duplicate 'get_weather' detected",
  "signature_zh": "错误：并行函数调用需要不同的函数名称——检测到重复的'get_weather'",
  "regex": ".*Parallel function calls require distinct function names.*duplicate.*",
  "domain": "llm",
  "category": "config_error",
  "subcategory": null,
  "root_cause": "When using parallel function calling, the LLM may attempt to call the same function multiple times concurrently; the API rejects duplicate function names in a single response's tool_calls array.",
  "root_cause_type": "generic",
  "root_cause_zh": "使用并行函数调用时，LLM 可能尝试同时多次调用同一函数；API 会拒绝单个响应中 tool_calls 数组内的重复函数名称。",
  "versions": [
    {
      "version": "openai>=1.0.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "gpt-4-0125-preview",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "gpt-4-turbo-2024-04-09",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "Function names are defined in the tools array and must be static; dynamic renaming breaks schema consistency",
      "fail_rate": 0.9,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "Disabling parallel calls reduces throughput and may cause timeouts for workflows requiring multiple tool invocations",
      "fail_rate": 0.5,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "The LLM may consistently generate duplicate calls for certain inputs; retries are unreliable and waste tokens",
      "fail_rate": 0.7,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Allow duplicate function names by design: define the function once in tools, and handle multiple calls to the same function in your application logic by iterating over the tool_calls array.",
      "success_rate": 0.9,
      "how": "Allow duplicate function names by design: define the function once in tools, and handle multiple calls to the same function in your application logic by iterating over the tool_calls array.",
      "condition": "",
      "sources": []
    },
    {
      "action": "If parallel calls are not required, set parallel_tool_calls=false in the request to force sequential function calling.",
      "success_rate": 0.85,
      "how": "If parallel calls are not required, set parallel_tool_calls=false in the request to force sequential function calling.",
      "condition": "",
      "sources": []
    },
    {
      "action": "Implement a deduplication layer: before processing tool_calls, merge duplicate function calls with the same name into a single call with combined parameters, or reject duplicates with a clear error message.",
      "success_rate": 0.8,
      "how": "Implement a deduplication layer: before processing tool_calls, merge duplicate function calls with the same name into a single call with combined parameters, or reject duplicates with a clear error message.",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [
    "允许重复的函数名称：在 tools 中定义一次函数，并通过遍历 tool_calls 数组在应用逻辑中处理对同一函数的多次调用。",
    "如果不需要并行调用，在请求中设置 parallel_tool_calls=false 以强制顺序函数调用。",
    "实现去重层：在处理 tool_calls 之前，将具有相同名称的重复函数调用合并为具有合并参数的单个调用，或用清晰的错误消息拒绝重复。"
  ],
  "transition_graph": {
    "leads_to": [],
    "preceded_by": [],
    "frequently_confused_with": []
  },
  "official_doc_url": "https://platform.openai.com/docs/guides/function-calling/parallel-function-calling",
  "official_doc_section": null,
  "error_code": null,
  "verification_tier": "ai_generated",
  "confidence": 0.82,
  "fix_success_rate": 0.8,
  "resolvable": "true",
  "first_seen": "2024-06-10",
  "last_confirmed": "2024-06-01",
  "last_updated": "2024-06-01",
  "evidence_count": 1,
  "tags": [],
  "locale": "en",
  "aliases": []
}