Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

_stringify does not support non-english #26315

Closed
5 tasks done
aiml-gmlee opened this issue Sep 11, 2024 · 1 comment
Closed
5 tasks done

_stringify does not support non-english #26315

aiml-gmlee opened this issue Sep 11, 2024 · 1 comment
Labels
🤖:bug Related to a bug, vulnerability, unexpected error with an existing feature

Comments

@aiml-gmlee
Copy link

Checked other resources

  • I added a very descriptive title to this issue.
  • I searched the LangChain documentation with the integrated search.
  • I used the GitHub search to find a similar question and didn't find it.
  • I am sure that this is a bug in LangChain rather than my code.
  • The bug is not resolved by updating to the latest stable version of LangChain (or the specific integration package).

Example Code

langchain_core.tools.base

def _stringify(content: Any) -> str:
    try:
        return json.dumps(content)
    except Exception:
        return str(content)

this is not supports non-english

Error Message and Stack Trace (if applicable)

No response

Description

json.dumps not supports non-english

same issue on langgraph and solved with json.dumps(content, ensure_ascii=False)

System Info

System Information

OS: Darwin
OS Version: Darwin Kernel Version 23.5.0: Wed May 1 20:12:58 PDT 2024; root:xnu-10063.121.3~5/RELEASE_ARM64_T6000
Python Version: 3.10.14 | packaged by conda-forge | (main, Mar 20 2024, 12:51:49) [Clang 16.0.6 ]

Package Information

langchain_core: 0.2.39
langchain: 0.2.16
langchain_community: 0.2.10
langsmith: 0.1.117
langchain_experimental: 0.0.63
langchain_openai: 0.1.23
langchain_text_splitters: 0.2.2
langgraph: 0.2.19

Optional packages not installed

langserve

Other Dependencies

aiohttp: 3.9.5
async-timeout: 4.0.3
dataclasses-json: 0.6.7
httpx: 0.27.0
jsonpatch: 1.33
langgraph-checkpoint: 1.0.9
numpy: 1.26.4
openai: 1.44.1
orjson: 3.10.6
packaging: 24.1
pydantic: 2.8.2
PyYAML: 6.0.1
requests: 2.32.3
SQLAlchemy: 2.0.31
tenacity: 8.5.0
tiktoken: 0.7.0
typing-extensions: 4.12.2

@dosubot dosubot bot added the 🤖:bug Related to a bug, vulnerability, unexpected error with an existing feature label Sep 11, 2024
eyurtsev pushed a commit that referenced this issue Sep 11, 2024
…n't output string (#26319)

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

target issue is #26315 
same issue on langgraph -
langchain-ai/langgraph#1504
@aiml-gmlee
Copy link
Author

It solved

@aiml-gmlee aiml-gmlee reopened this Sep 13, 2024
Sheepsta300 pushed a commit to Sheepsta300/langchain that referenced this issue Oct 1, 2024
…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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🤖:bug Related to a bug, vulnerability, unexpected error with an existing feature
Projects
None yet
Development

No branches or pull requests

1 participant