Skip to content

Commit

Permalink
core[patch]: Support non ASCII characters in tool output if user does…
Browse files Browse the repository at this point in the history
…n't output string (langchain-ai#26319)

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

target issue is langchain-ai#26315 
same issue on langgraph -
langchain-ai/langgraph#1504
  • Loading branch information
GyuminJack authored and Sheepsta300 committed Oct 1, 2024
1 parent fa5edac commit bcc836e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion libs/core/langchain_core/tools/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down

0 comments on commit bcc836e

Please sign in to comment.