mirror of
https://github.com/hwchase17/langchain.git
synced 2025-05-31 12:09:58 +00:00
Permit unicode outputs when dumping json in GetElementsTool (#4276)
Adds ensure_ascii=False when dumping json in the GetElementsTool Fixes issue https://github.com/hwchase17/langchain/issues/4265
This commit is contained in:
parent
a1001b29eb
commit
6f386628c2
@ -89,7 +89,7 @@ class GetElementsTool(BaseBrowserTool):
|
|||||||
page = get_current_page(self.sync_browser)
|
page = get_current_page(self.sync_browser)
|
||||||
# Navigate to the desired webpage before using this tool
|
# Navigate to the desired webpage before using this tool
|
||||||
results = _get_elements(page, selector, attributes)
|
results = _get_elements(page, selector, attributes)
|
||||||
return json.dumps(results)
|
return json.dumps(results, ensure_ascii=False)
|
||||||
|
|
||||||
async def _arun(
|
async def _arun(
|
||||||
self,
|
self,
|
||||||
@ -103,4 +103,4 @@ class GetElementsTool(BaseBrowserTool):
|
|||||||
page = await aget_current_page(self.async_browser)
|
page = await aget_current_page(self.async_browser)
|
||||||
# Navigate to the desired webpage before using this tool
|
# Navigate to the desired webpage before using this tool
|
||||||
results = await _aget_elements(page, selector, attributes)
|
results = await _aget_elements(page, selector, attributes)
|
||||||
return json.dumps(results)
|
return json.dumps(results, ensure_ascii=False)
|
||||||
|
Loading…
Reference in New Issue
Block a user