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

Fix/nvidia ai endpoints streaming #654

Merged
merged 2 commits into from
Aug 20, 2024
Merged

Conversation

Pouyanpi
Copy link
Collaborator

This PR fixes the streaming issue introduced with langchain_nvidia_ai_endpoints package.

  • It creates a patched version of ChatNVIDIA based on the version of the langchain_nvidia_ai_endpoints package. Two patched versions are created for the version ranges 0.1. - 0.2.0 and 0.2.0 - 0.3.0. The ChatNVIDIAFactory is responsible for checking the package version and returning the corresponding patched class. The patched class is then assigned to ChatNVIDIA, which will be used in providers.

  • Imodifies the import statement in the providers module to import the patched version of ChatNVIDIA from the _langchain_nvidia_ai_endpoints_patch module.

  • it is tested on langchain_nvidia_ai_endpoints versions 0.1.3.0 - 0.1.4 - 0.1.5 - 0.1.6 - 0.1.7 and 0.2.0

Note: Only the streaming support is tested

This commit introduces a factory pattern to create a patched version of
ChatNVIDIA based on the version of the langchain_nvidia_ai_endpoints
package. Two patched versions are created for the version ranges
0.1. - 0.2.0 and 0.2.0 - 0.3.0. The  ChatNVIDIAFactory
is responsible for checking the package version and returning the
corresponding patched class. The patched class is then assigned to
ChatNVIDIA, which will be used in providers.
This commit modifies the import statement in the providers module to
import the patched version of ChatNVIDIA from the
_langchain_nvidia_ai_endpoints_patch module.
@Pouyanpi Pouyanpi requested a review from drazvan July 26, 2024 13:00
@Pouyanpi Pouyanpi self-assigned this Jul 26, 2024
Copy link
Collaborator

@drazvan drazvan left a comment

Choose a reason for hiding this comment

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

Looks good. I think there is a way to patch this in a more future-proof way, i.e., working for 0.4.x+ versions as well. This is good enough for now.

@drazvan drazvan merged commit f0e97b0 into develop Aug 20, 2024
4 checks passed
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