From 44edb56cf78e6c9afab003d9a6dfc3a183f7ddae Mon Sep 17 00:00:00 2001 From: root <12112723@mail.sustech.edu.cn> Date: Wed, 25 Dec 2024 09:29:37 +0000 Subject: [PATCH] update tool_call --- libs/core/langchain_core/messages/tool.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/core/langchain_core/messages/tool.py b/libs/core/langchain_core/messages/tool.py index 25e6d368d8bd8..4dbe96f24f92a 100644 --- a/libs/core/langchain_core/messages/tool.py +++ b/libs/core/langchain_core/messages/tool.py @@ -7,7 +7,6 @@ from langchain_core.messages.base import BaseMessage, BaseMessageChunk, merge_content from langchain_core.utils._merge import merge_dicts, merge_obj -import re class ToolOutputMixin: @@ -210,6 +209,7 @@ class ToolCall(TypedDict): def tool_call(*, name: str, args: dict[str, Any], id: Optional[str]) -> ToolCall: + import re if isinstance(args, str): try: # Extract JSON-like dictionary from string using regex