Skip to content

Commit

Permalink
fix: openai adapter tool_choice 忽略 auto (#642)
Browse files Browse the repository at this point in the history
* fix tool_choice

* remove
  • Loading branch information
ZingLix authored Jul 4, 2024
1 parent ee9dc8d commit 5c914f4
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions python/qianfan/extensions/openai/adapter.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,8 @@ def add_if_exist(openai_key: str, qianfan_key: Optional[str] = None) -> None:
"type": "function",
"function": function_call,
}
if qianfan_request.get("tool_choice") == "auto":
qianfan_request.pop("tool_choice")
if "response_format" in openai_request:
response_format = openai_request["response_format"]
if not isinstance(response_format, str):
Expand Down

0 comments on commit 5c914f4

Please sign in to comment.