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]
pull/22873/head^2
Kagura Chen 4 months ago committed by GitHub
parent 5bc774827b
commit 57783c5e55
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

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

@ -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'",
),

Loading…
Cancel
Save