Skip to content

Commit

Permalink
šŸ› Bug: Fix the bug of extra request body fields when all function calā€¦
Browse files Browse the repository at this point in the history
ā€¦ls are turned off.
  • Loading branch information
yym68686 committed May 20, 2024
1 parent 7c11fce commit 8de5c9f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

setup(
name="modelmerge",
version="0.5.0",
version="0.5.1",
description="modelmerge is a multi-large language model API aggregator.",
long_description=Path.open(Path("README.md"), encoding="utf-8").read(),
long_description_content_type="text/markdown",
Expand Down
7 changes: 5 additions & 2 deletions src/ModelMerge/models/chatgpt.py
Original file line number Diff line number Diff line change
Expand Up @@ -353,8 +353,11 @@ def ask_stream(
return
# print("response.text", response.text)
if response.status_code == 400:
del json_post["function_call"]
del json_post["functions"]
print("response.text", response.text)
if "function_call" in json_post:
del json_post["function_call"]
if "functions" in json_post:
del json_post["functions"]
continue
if response.status_code == 200:
break
Expand Down

0 comments on commit 8de5c9f

Please sign in to comment.