-
Notifications
You must be signed in to change notification settings - Fork 15.8k
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
community: upgrade openai>=1.30 for LocalAIEmbedings #22399
community: upgrade openai>=1.30 for LocalAIEmbedings #22399
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 1 Skipped Deployment
|
951d59b
to
42e1049
Compare
import httpx | ||
openai = LocalAIEmbeddings( | ||
openai_api_key="random-string", | ||
client=openai.OpenAI( |
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.
shouldn't need to pass in client directly
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.
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.
eg. I don't see actual proxy usage in https://github.com/langchain-ai/langchain/blob/master/libs/partners/openai/langchain_openai/embeddings/base.py
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.
shouldn't need to pass in client directly
I copied openai_proxy
handling from OpenAIEmbedding
I got back to the problem. |
402231a
to
5f1c46b
Compare
…FoundError: No module named 'openai'
@baskaryan kindly asking to check this PR out. I resolved the question regarding proxy. Note, after this PR is merged. I want to improve #22666 localai embeddings performance. |
Here's the key question: 0.x or 1.x?
ahhhh it's a bummer
UPD managed to keep up with old httpx |
ping @efriis pleaase |
Curious if there's any update on this or alternative solutions in the meantime? |
I can only rebase it from time to time. Let me know if it's necessary. I'll refresh. |
Unfortunately there isn't a great way to update these old community integrations that rely on openai sdk v0 in a way that's both backwards compatible + supports v1 without being a huge mess to maintain. This is one of the main motivations behind moving towards dedicated integration packages, which have replaced the community package as the right path forward. I'll close this PR, and would recommend reopening with just docs updates, as well as registering your package in Would also love to @deprecated this integration pointing to your new integration package, which can even lock to openai v1 sdk to avoid support for v0! Here's the guide, and if you have questions, feel free to leave them in the comments on those pages so others can see them! https://python.langchain.com/docs/contributing/how_to/integrations/ |
Thanks @efriis for checking stale PRs during the holiday season! The first question is, which account this integration package will belong to:
UPD: I've fixed the build. PS. The next (real target) is a performance via #22666 |
we won't create one under langchain-ai, and one under However, that being said, because it relies on the |
aaaghh I've got your point after all. Let me check if embeddings work this way! |
@efriis
I noticed that underneath OpenAIEmbeddings tokenizes text by cl100k_base and submits int array per the given string. LocalAI handles it somehow and yields vectors. Probably they are meaningful, but their values are different from what I've got from LocalAIEmbeddings, which submits texts as-is. |
Let me clarify. There's no chat model for LocalAI here, there's only |
I see makes sense. Feel free to publish a langchain-localai then! |
Thank you for contributing to LangChain!
PR title: "package: description"
Description: migrate LocalAIEmbeddings code to OpenAI 1.30
Issue: LocalAIEmbeddings fails due to old OpenAI 0.28 code openai.error see module 'openai' has no attribute 'error' #13368
Dependencies: OpenAI is already bumped 1.30
Add tests and docs: integration test with vcr
Lint and test:
Additional guidelines:
If no one reviews your PR within a few days, please @-mention one of baskaryan, efriis, eyurtsev, ccurme, vbarda, hwchase17.