From d3d9244fee622c1c5509823cd645285ae66c3d42 Mon Sep 17 00:00:00 2001 From: taimo <132860814+taimo3810@users.noreply.github.com> Date: Tue, 30 Jan 2024 01:38:12 +0900 Subject: [PATCH] langchain-community: fix unicode escaping issue with SlackToolkit (#16616) - **Description:** fix unicode escaping issue with SlackToolkit - **Issue:** #16610 --- libs/community/langchain_community/tools/slack/get_channel.py | 2 +- libs/community/langchain_community/tools/slack/get_message.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/libs/community/langchain_community/tools/slack/get_channel.py b/libs/community/langchain_community/tools/slack/get_channel.py index a3dbe13939a..4cee16a9350 100644 --- a/libs/community/langchain_community/tools/slack/get_channel.py +++ b/libs/community/langchain_community/tools/slack/get_channel.py @@ -31,7 +31,7 @@ class SlackGetChannel(SlackBaseTool): and "created" in channel and "num_members" in channel ] - return json.dumps(filtered_result) + return json.dumps(filtered_result, ensure_ascii=False) except Exception as e: return "Error creating conversation: {}".format(e) diff --git a/libs/community/langchain_community/tools/slack/get_message.py b/libs/community/langchain_community/tools/slack/get_message.py index c0e9cde3427..06ec9a9f570 100644 --- a/libs/community/langchain_community/tools/slack/get_message.py +++ b/libs/community/langchain_community/tools/slack/get_message.py @@ -39,6 +39,6 @@ class SlackGetMessage(SlackBaseTool): for message in messages if "user" in message and "text" in message and "ts" in message ] - return json.dumps(filtered_messages) + return json.dumps(filtered_messages, ensure_ascii=False) except Exception as e: return "Error creating conversation: {}".format(e)