From c888ea409cc1cae732514471258042d03b735cc3 Mon Sep 17 00:00:00 2001 From: keenborder786 <21110290@lums.edu.pk> Date: Sun, 27 Apr 2025 04:52:42 +0500 Subject: [PATCH] [fix]: Tests --- libs/core/langchain_core/tools/base.py | 2 +- libs/core/tests/unit_tests/test_tools.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/libs/core/langchain_core/tools/base.py b/libs/core/langchain_core/tools/base.py index 8f2e9eb204f..88d8088902c 100644 --- a/libs/core/langchain_core/tools/base.py +++ b/libs/core/langchain_core/tools/base.py @@ -1082,7 +1082,7 @@ def get_all_basemodel_annotations( for name, param in cls.model_fields.items(): if param.alias and param.alias != name: warnings.warn( - f"Field '{name}' has alias '{param.alias}'. The alias will be used instead of the field name.", + f"Field '{name}' has alias '{param.alias}'. The alias will be used in tool schema instead of the field name.", stacklevel=2 ) for name, param in inspect.signature(cls).parameters.items(): diff --git a/libs/core/tests/unit_tests/test_tools.py b/libs/core/tests/unit_tests/test_tools.py index d3408641196..6bbe24501be 100644 --- a/libs/core/tests/unit_tests/test_tools.py +++ b/libs/core/tests/unit_tests/test_tools.py @@ -2709,5 +2709,5 @@ def test_get_all_basemodel_annotations_warning() -> None: class ModelWithAlias(BaseModel): field_with_alias: str = Field(alias="alias_field") - with pytest.warns(UserWarning, match="Field 'field_with_alias' has alias 'alias_field'. The alias will be used instead of the field name."): + with pytest.warns(UserWarning, match="Field 'field_with_alias' has alias 'alias_field'. The alias will be used in tool schema instead of the field name."): get_all_basemodel_annotations(ModelWithAlias)