Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support LangChain 0.3.0 #14

Merged
merged 2 commits into from
Sep 19, 2024
Merged

Support LangChain 0.3.0 #14

merged 2 commits into from
Sep 19, 2024

Conversation

B-Step62
Copy link
Collaborator

Update pydantic related logic to be compatible with LangChain 0.3.0.

Testing
Validated on notebook with different env settings:

langchain                          0.3.0
langchain-core                     0.3.1
pydantic                           2.8.2
pydantic_core                      2.20.1
langchain                          0.2.16
langchain-core                     0.2.40
pydantic                           2.8.2
pydantic_core                      2.20.1
langchain                          0.2.16
langchain-core                     0.2.40
pydantic                           1.10.18
pydantic_core                      0.42.0

@B-Step62 B-Step62 requested review from efriis, harupy and BenWilson2 and removed request for efriis September 18, 2024 07:00
@B-Step62
Copy link
Collaborator Author

B-Step62 commented Sep 18, 2024

@efriis Let me tag you for double-checking if there is anything missing for supporting LangChain 0.3.0. Thank you!

@@ -225,13 +222,16 @@ class GetPopulation(BaseModel):
"""List of strings to stop generation at."""
max_tokens: Optional[int] = None
"""The maximum number of tokens to generate."""
extra_params: dict = Field(default_factory=dict)
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

note: After updating to pydantic v2 import, this field starts to return FieldInfo object as default value instead of factory. Might be pydantic issue, but I couldn't figure it out the root cause so just using None as a workaround.

python = ">=3.8.1,<3.12"
langchain-core = "^0.2.35"
mlflow = ">=2.9"
python = ">=3.9,<4.0"
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

note: The langchain-core bumps minimum Python version. We need to follow it otherwise poetry complains.

Copy link
Collaborator

@harupy harupy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@B-Step62 B-Step62 merged commit c2dd754 into langchain-ai:main Sep 19, 2024
12 checks passed
@B-Step62 B-Step62 deleted the lc-3 branch September 19, 2024 00:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants