-
Notifications
You must be signed in to change notification settings - Fork 147
LangChain Compability Restored #442
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
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work, I haven't read everything yet, but left a few comments/questions.
| return_context = False | ||
| if isinstance(self.llm, LLMInterface): | ||
| warnings.warn( | ||
| "The default value of 'return_context' will change from 'False'" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These changes seem to be related to line length only, are there made on purpose? (asking because I know Nathalie had some issues about this in the past)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
True, pylint was warning about that line is too long. Autolinter in my ide splitted this line to many lines. I can revert them back if you think it may cause any issue.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's just that the next person pushing to the repo will have to make the opposite change, so we should agree on a convention. Is this something we should add to a config file in the repo?
| input: List[LLMMessage], | ||
| ) -> LLMResponse: ... | ||
|
|
||
| @overload # type: ignore[no-overload-impl] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you know why we need these two type ignore comments: # type: ignore[no-overload-impl] and later # type: ignore[no-redef]?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
seems like a mypy bug. alternatively we can move overload definitions to same file with pyi extension but it may make repo complexer.
Description
The additional arguments we previously introduced to the invoke function in LLMInterface broke compatibility with LangChain. This change introduces a new
LLMInterfaceV2contract that is fully compatible with LangChain while maintaining backward compatibility. If any users have implemented the old LLMInterface manually, their implementations will continue to work without modification.Resolves #383
Type of Change
Complexity
Moderate. Even though a new contract provided, the old contact is still valid to offer backward compability.
Complexity:
How Has This Been Tested?
Checklist
The following requirements should have been met (depending on the changes in the branch):