Merge pull request #5777 from smonux/dev

Fix: sanitize function calling json
This commit is contained in:
Timothy Jaeryang Baek 2024-09-28 10:07:52 +02:00 committed by GitHub
commit 9636913de0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -448,6 +448,7 @@ async def chat_completion_tools_handler(
if not content:
return body, {}
content = content[content.find("{") : content.rfind("}") + 1]
result = json.loads(content)
tool_function_name = result.get("name", None)