-
Notifications
You must be signed in to change notification settings - Fork 16k
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
Migrating Langchain's openai-python usage to v1.0.0 #13855
Migrating Langchain's openai-python usage to v1.0.0 #13855
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
@@ -94,7 +94,7 @@ def _create_retry_decorator( | |||
import openai | |||
|
|||
errors = [ | |||
openai.error.Timeout, | |||
openai.Timeout, |
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.
this code is only reached if openai<1 is installed, so don't think we want to update
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.
Thank you for reviewing this PR. Just to confirm. are you suggesting that we should not update to openai v1.0.0? This would mean that the error we are receiving that is documented in #11755 that is solved by updating to openai v1.0.0 (openai/openai-python#574) will still persist. Is there an alternative approach to solving this issue? @baskaryan
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.
Hello @baskaryan , any updates? Just wanted to confirm that, as you mentioned, langchain is not looking to update to openai v1.0.0.
c1f8c8d
to
bd4ed4a
Compare
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.
thanks for this @JoshuaConcon
we've made the core openai classes compatible with both v1 and v0 of OpenAI (this is relevant for the comment @baskaryan made about not reaching that code path - we have some conditional logic that checks for that ahead of time)
what to do with other classes is an interesting question...
closing given number of merge conflicts, can reopen if it's still being worked on |
FYI: after discussion #22399, LocalAI integration were extracted to https://github.com/mkhludnev/langchain-localai where it depends on OpenAI SDK v1 |
Description:
TODO:
openai migrate
libs/langchain/chains/moderation.py
libs/langchain/chat_models/jinachat.py
libs/langchain/chat_models/openai.py
libs/langchain/document_loaders/parsrs/audio.py
libs/langchain/embeddings/localai.py
libs/langchain/embeddings/openai.py
libs/langchain/llms/gooseai.py
libs/langchain/llms/openai.py
libs/langchain/utilities/dalle_image_generator.py
tests/integration_tests/adapters/test_openai.py
tests/integration_tests/embeddings/test_azure_openai.py
tests/integration_tests/embeddings/test_openai.py
tests/integration_tests/unit_tests/llms/test_openai.py
Issue: Adapt to openai-python v1.0.0 Beta #11755
Dependencies: openai-python v1.0.0
Tag maintainer: @baskaryan @eyurtsev @hwchase17
Twitter handle: @Joshua_Concon