From 3e0febeab31bff873afdf81b2629a3fbc6ee7750 Mon Sep 17 00:00:00 2001 From: Christopher Queen Date: Wed, 13 Dec 2023 12:57:11 -0500 Subject: [PATCH 1/2] Update tools.py Need to set by_alias=True so that alias names will be included in the final results --- libs/core/langchain_core/tools.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/core/langchain_core/tools.py b/libs/core/langchain_core/tools.py index 8b73580358a29..55753fcf6f278 100644 --- a/libs/core/langchain_core/tools.py +++ b/libs/core/langchain_core/tools.py @@ -244,7 +244,7 @@ def _parse_input( else: if input_args is not None: result = input_args.parse_obj(tool_input) - return {k: v for k, v in result.dict().items() if k in tool_input} + return {k: v for k, v in result.dict(by_alias=True).items() if k in tool_input} return tool_input @root_validator() From 896d9eab10a83dd3b671e73743c81ae7fef0811d Mon Sep 17 00:00:00 2001 From: Christopher Queen Date: Thu, 28 Dec 2023 00:44:26 -0500 Subject: [PATCH 2/2] Revert tools.py --- libs/core/langchain_core/tools.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/core/langchain_core/tools.py b/libs/core/langchain_core/tools.py index 55753fcf6f278..8b73580358a29 100644 --- a/libs/core/langchain_core/tools.py +++ b/libs/core/langchain_core/tools.py @@ -244,7 +244,7 @@ def _parse_input( else: if input_args is not None: result = input_args.parse_obj(tool_input) - return {k: v for k, v in result.dict(by_alias=True).items() if k in tool_input} + return {k: v for k, v in result.dict().items() if k in tool_input} return tool_input @root_validator()