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

Add _type for all parsers #4189

Merged
merged 4 commits into from
May 11, 2023
Merged

Conversation

sunishsheth2009
Copy link
Contributor

Used for serialization. Also add test that recurses through
our subclasses to check they have them implemented

Would fix #3217
Blocking: mlflow/mlflow#8297

@sunishsheth2009
Copy link
Contributor Author

Replicating the PR: #3332
Thank you for your help: @vowelparrot , happy to close this PR in favor of the original PR :)

@sunishsheth2009
Copy link
Contributor Author

@hwchase17, can you help take a look at this? Thank you :)
Appreciate all your work here

Copy link
Contributor

@dev2049 dev2049 left a comment

Choose a reason for hiding this comment

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

2 small comments, otherwise looks good!

langchain/output_parsers/fix.py Outdated Show resolved Hide resolved
tests/unit_tests/output_parsers/test_base_output_parser.py Outdated Show resolved Hide resolved
Signed-off-by: Sunish Sheth <sunishsheth2009@gmail.com>
@sunishsheth2009 sunishsheth2009 force-pushed the parser__type branch 2 times, most recently from 1c5f1b9 to a7c6043 Compare May 10, 2023 20:23
try:
# Most parsers just return a string. MagicMock lets
# the parsers that wrap another parsers slide by
cls._type.fget(MagicMock()) # type: ignore
Copy link
Contributor

Choose a reason for hiding this comment

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

not sure i understand, why is this needed?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I agree, its not needed here. There are no parsers that wrap another parser. Removed that code. :)
Thank you

Signed-off-by: Sunish Sheth <sunishsheth2009@gmail.com>
@dev2049 dev2049 merged commit 812e5f4 into langchain-ai:master May 11, 2023
13 checks passed
@sunishsheth2009 sunishsheth2009 deleted the parser__type branch May 11, 2023 16:09
jpzhangvincent pushed a commit to jpzhangvincent/langchain that referenced this pull request May 12, 2023
Used for serialization. Also add test that recurses through
our subclasses to check they have them implemented

Would fix langchain-ai#3217
Blocking: mlflow/mlflow#8297

---------

Signed-off-by: Sunish Sheth <sunishsheth2009@gmail.com>
Co-authored-by: Dev 2049 <dev.dev2049@gmail.com>
EandrewJones pushed a commit to Oogway-Technologies/langchain that referenced this pull request May 12, 2023
Used for serialization. Also add test that recurses through
our subclasses to check they have them implemented

Would fix langchain-ai#3217
Blocking: mlflow/mlflow#8297

---------

Signed-off-by: Sunish Sheth <sunishsheth2009@gmail.com>
Co-authored-by: Dev 2049 <dev.dev2049@gmail.com>
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.

Bug in saving agent since version v0.0.142
2 participants