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]
This commit is contained in:
Kagura Chen
2024-06-14 09:18:00 +08:00
committed by GitHub
parent 5bc774827b
commit 57783c5e55
2 changed files with 4 additions and 4 deletions

View File

@@ -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)

View File

@@ -261,7 +261,7 @@ class TestUnitCPALChain_MathWordProblems(unittest.TestCase):
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'",
),