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

update get_embedding function to account for new openai client #14

Merged
merged 3 commits into from
Jan 8, 2024

Conversation

bbytiger
Copy link
Contributor

@bbytiger bbytiger commented Jan 4, 2024

Because of OpenAI python client 1.0.0 upgrade, we can no longer have openai.Embedding

See similar issue here:
langchain-ai/langchain#12943

@pkavumba
Copy link
Owner

pkavumba commented Jan 4, 2024

@bbytiger Thank you for the pull request. Implementing this change may pose a compatibility issue for users on the old OpenAI version 0.28 and below. To maintain backward compatibility, could we consider incorporating a version-aware implementation? Specifically, utilize this implementation for versions above 1, and stick to the old implementation for those on version 0.28 and below. If it’s not too much to ask for, we could consider relocating the old and new implementations to separate files. Subsequently, we could import the appropriate function based on the user's OpenAI version (openai.__version__), ensuring a cleaner and version-specific implementation

Copy link
Owner

@pkavumba pkavumba left a comment

Choose a reason for hiding this comment

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

I will merge this PR for now, then implement the version-aware class later

@pkavumba pkavumba merged commit 278fe9f into pkavumba:main Jan 8, 2024
5 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.

None yet

2 participants