langchain-ai / langchain

🦜🔗 Build context-aware reasoning applications
https://python.langchain.com
MIT License
92.47k stars 14.79k forks source link

Unicode escaping issue with tools in SlackToolkit #16610

Closed taimo3810 closed 7 months ago

taimo3810 commented 7 months ago

Checked other resources

Example Code

toolkit = SlackToolkit()
tools = toolkit.get_tools()
llm = ChatOpenAI(temperature=0, model="gpt-4")
prompt = hub.pull("hwchase17/react")
agent = create_react_agent(
    tools=toolkit.get_tools(),
    llm=llm,
    prompt=prompt,
)
agent_executor = AgentExecutor(agent=agent, tools=tools, verbose=True)
agent_executor.invoke(
    {
        "input": "Tell me the number of messages sent in the #introductions channel from the past month."
    }
)

Output

Entering new AgentExecutor chain... First, I need to identify the channel ID for the #introductions channel. Action: get_channelid_name_dict Action Input: None[{"id": "C052SCUP4UD", "name": "general", "created": 1681297313, "num_members": 1}, {"id": "C052VBBU4M8", "name": "test-bots", "created": 1681297343, "num_members": 2}, {"id": "C053805TNUR", "name": "random", "created": 1681297313, "num_members": 2}, {"id": "C06FQGQ97AN", "name": "\u65e5\u672c\u8a9e\u30c1\u30e3\u30f3\u30cd\u30eb", "created": 1706240229, "num_members": 1}]The #introductions channel is not listed in the observed channels. I cannot proceed with the original question. Final Answer: The #introductions channel does not exist. Finished chain.

Description

Characters in languages like Japanese, which are not part of the ASCII character set, will be converted to their Unicode escape sequences (like \uXXXX). NOTE: I have the plan to fix the issue. I will send pull request later.

System Info

Langchain:

langchain_core: 0.1.13
langchain: 0.1.1
langchain_community: 0.0.1

Platform: mac Python: 3.9.6

dosubot[bot] commented 7 months ago

🤖

It's great to hear that you have a plan to fix the Unicode escaping issue! We look forward to your pull request. Thank you for your contribution to the project.


This response is meant to be useful and save you time. It is not meant to be a precise solution, but rather a starting point for your own research.

Help me be more useful! Please leave a 👍 if this is helpful and 👎 if it is irrelevant.

If you want to continue the conversation, start your reply with @dosu-bot.