This commit is contained in:
Timothy Jaeryang Baek 2025-09-26 15:57:03 -05:00
parent cda4c95c86
commit 4997ef2662
1 changed files with 17 additions and 0 deletions

View File

@ -304,6 +304,13 @@ async def chat_completion_tools_handler(
): ):
tool_result, tool_response_headers = tool_result tool_result, tool_response_headers = tool_result
try:
if not isinstance(tool_response_headers, dict):
tool_response_headers = dict(tool_response_headers)
except Exception as e:
tool_response_headers = {}
log.debug(e)
if tool_response_headers and isinstance( if tool_response_headers and isinstance(
tool_response_headers, dict tool_response_headers, dict
): ):
@ -2634,6 +2641,16 @@ async def process_chat_response(
): ):
tool_result, tool_response_headers = tool_result tool_result, tool_response_headers = tool_result
try:
if not isinstance(tool_response_headers, dict):
tool_response_headers = dict(tool_response_headers)
except Exception as e:
tool_response_headers = {}
log.debug(e)
print(tool_response_headers)
print(type(tool_response_headers))
if tool_response_headers and isinstance( if tool_response_headers and isinstance(
tool_response_headers, dict tool_response_headers, dict
): ):