mirror of
https://github.com/open-webui/open-webui
synced 2025-05-29 09:42:12 +00:00
enh: tool args parse json fallback
This commit is contained in:
parent
03e61e7a4a
commit
b5909ffe97
@ -1846,6 +1846,15 @@ async def process_chat_response(
|
|||||||
)
|
)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
log.debug(e)
|
log.debug(e)
|
||||||
|
# Fallback to JSON parsing
|
||||||
|
try:
|
||||||
|
tool_function_params = json.loads(
|
||||||
|
tool_call.get("function", {}).get("arguments", "{}")
|
||||||
|
)
|
||||||
|
except Exception as e:
|
||||||
|
log.debug(
|
||||||
|
f"Error parsing tool call arguments: {tool_call.get('function', {}).get('arguments', '{}')}"
|
||||||
|
)
|
||||||
|
|
||||||
tool_result = None
|
tool_result = None
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user