fix(protocol): effective_tool_choice preserves namespace/type

This commit is contained in:
2026-11-13 23:22:21 +08:00
parent 68c2af7957
commit cac60f7c2e
@@ -2115,7 +2115,10 @@ class ResponsesRequest(PDRoutingFields):
"name"
)
if tool_choice.get("type") in ("function", "custom") and name:
return {"type": "function", "name": name}
choice = {"type": tool_choice["type"], "name": name}
if "namespace" in tool_choice:
choice["namespace"] = tool_choice["namespace"]
return choice
return "auto"
def to_sampling_params(