core[patch]: Support non ASCII characters in tool output if user doesn't output string (#26319)

### simple modify
core: add supporting non english character

target issue is #26315 
same issue on langgraph -
https://github.com/langchain-ai/langgraph/issues/1504
This commit is contained in:
이규민 2024-09-12 00:21:00 +09:00 committed by GitHub
parent b993172702
commit 7feae62ad7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -822,7 +822,7 @@ def _is_message_content_block(obj: Any) -> bool:
def _stringify(content: Any) -> str:
try:
return json.dumps(content)
return json.dumps(content, ensure_ascii=False)
except Exception:
return str(content)