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

Migrating Langchain's openai-python usage to v1.0.0 #13855

Conversation

JoshuaConcon
Copy link

@JoshuaConcon JoshuaConcon commented Nov 25, 2023

Copy link

vercel bot commented Nov 25, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
langchain ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 30, 2023 7:16pm

@@ -94,7 +94,7 @@ def _create_retry_decorator(
import openai

errors = [
openai.error.Timeout,
openai.Timeout,
Copy link
Collaborator

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

Copy link
Author

@JoshuaConcon JoshuaConcon Nov 27, 2023

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

Copy link
Author

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.

@JoshuaConcon JoshuaConcon force-pushed the JoshuaConcon/adapt_openai_beta_v1 branch from c1f8c8d to bd4ed4a Compare November 30, 2023 18:29
@JoshuaConcon JoshuaConcon marked this pull request as ready for review November 30, 2023 18:39
@dosubot dosubot bot added size:L This PR changes 100-499 lines, ignoring generated files. Ɑ: models Related to LLMs or chat model modules 🤖:improvement Medium size change to existing code to handle new use-cases labels Nov 30, 2023
Copy link
Contributor

@hwchase17 hwchase17 left a 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...

@hwchase17 hwchase17 closed this Jan 30, 2024
@baskaryan baskaryan reopened this Jan 30, 2024
@baskaryan
Copy link
Collaborator

closing given number of merge conflicts, can reopen if it's still being worked on

@baskaryan baskaryan closed this Mar 28, 2024
@mkhludnev
Copy link
Contributor

FYI: after discussion #22399, LocalAI integration were extracted to https://github.com/mkhludnev/langchain-localai where it depends on OpenAI SDK v1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🤖:improvement Medium size change to existing code to handle new use-cases Ɑ: models Related to LLMs or chat model modules size:L This PR changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants