From 57783c5e556d5d59e8b553f05b7b3f6a323afd46 Mon Sep 17 00:00:00 2001 From: Kagura Chen Date: Fri, 14 Jun 2024 09:18:00 +0800 Subject: [PATCH] Fix: lint errors and update Field alias in models.py and AutoSelectionScorer initialization (#22846) This PR addresses several lint errors in the core package of LangChain. Specifically, the following issues were fixed: 1.Unexpected keyword argument "required" for "Field" [call-arg] 2.tests/integration_tests/chains/test_cpal.py:263: error: Unexpected keyword argument "narrative_input" for "QueryModel" [call-arg] --- libs/experimental/langchain_experimental/cpal/models.py | 6 +++--- .../tests/integration_tests/chains/test_cpal.py | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/libs/experimental/langchain_experimental/cpal/models.py b/libs/experimental/langchain_experimental/cpal/models.py index 6be95bc70f4fb..6e2d83cdc8c90 100644 --- a/libs/experimental/langchain_experimental/cpal/models.py +++ b/libs/experimental/langchain_experimental/cpal/models.py @@ -135,9 +135,9 @@ class ResultModel(BaseModel): class StoryModel(BaseModel): """Story data.""" - causal_operations: Any = Field(required=True) - intervention: Any = Field(required=True) - query: Any = Field(required=True) + causal_operations: Any = Field() + intervention: Any = Field() + query: Any = Field() _outcome_table: Any = PrivateAttr(default=None) _networkx_wrapper: Any = PrivateAttr(default=None) diff --git a/libs/experimental/tests/integration_tests/chains/test_cpal.py b/libs/experimental/tests/integration_tests/chains/test_cpal.py index c3ad368e5b0e3..ebb65839d1289 100644 --- a/libs/experimental/tests/integration_tests/chains/test_cpal.py +++ b/libs/experimental/tests/integration_tests/chains/test_cpal.py @@ -261,7 +261,7 @@ def test_query_chain(self) -> None: expected_output = { "chain_answer": None, "chain_data": QueryModel( - narrative_input="how many pets does jan have? ", + question="how many pets does jan have? ", llm_error_msg="", expression="SELECT name, value FROM df WHERE name = 'jan'", ),