Closed umair313 closed 6 months ago
π€
Hello @umair313,
Nice to talk to you again! I see you're having some trouble with tests failing in your local development environment. I will take a look into this issue and get back to you with a more complete response shortly.
π€
Based on the error messages you've shared, it seems like the version of the OpenAI library you're using (v1.1.1) might not be compatible with the current version of LangChain (v0.0.331rc2). The errors indicate that the 'ChatCompletion' and 'Completion' attributes are not found in the 'openai' module, which suggests that these attributes might have been introduced in a later version of the OpenAI library.
The LangChain framework is compatible with version 1.0.0 and above of the OpenAI library. However, the 'ChatCompletion' and 'Completion' attributes are used extensively in the LangChain codebase, particularly in the 'ChatOpenAI' class and the 'completion_with_retry' and 'acompletion_with_retry' methods. If these attributes are not found in the 'openai' module, it's likely due to an old version of the 'openai' package, and users are advised to upgrade it.
I would recommend updating your OpenAI library to the latest version and then try running the tests again. You can do this by running the following command in your terminal:
pip install --upgrade openai
After upgrading, please try running the tests again and let me know if you're still encountering these issues.
This response is meant to be useful and save you time. It is not meant to be a precise solution, but rather a starting point for your own research.
Help me be more useful! Please leave a π if this is helpful and π if it is irrelevant.
If you want to continue the conversation, start your reply with @dosu-bot.
@dosu-bot what are steps to start contributing?
π€
Sure, I'd be happy to guide you on how to start contributing to the LangChain project. Here are the steps you can follow:
Please note that all fields are required, so make sure to fill in all the information before submitting your feature request.
If you are a first-time contributor, you can start by trying one of the PRs with the βgood first issueβ tag. You can also become an expert by helping the community answer product questions in Discord. If you have a product that integrates with LangChain, you can become an Integration Maintainer and partner with the LangChain team to ensure your integration stays up-to-date. For these roles, introduce yourself by sending an email to hello@langchain.dev.
Once you have made your changes and are ready to submit a pull request, you can use the create_pull_request
method of the GitHubAPIWrapper
class. This method takes a string parameter pr_query
which contains the PR title and the PR body. The title is the first line in the string, and the body are the rest of the string. Here is the relevant code snippet:
def create_pull_request(self, pr_query: str) -> str:
"""
Makes a pull request from the bot's branch to the base branch
Parameters:
pr_query(str): a string which contains the PR title
and the PR body. The title is the first line
in the string, and the body are the rest of the string.
For example, "Updated README\nmade changes to add info"
Returns:
str: A success or failure message
"""
if self.github_base_branch == self.github_branch:
return """Cannot make a pull request because
commits are already in the master branch"""
else:
try:
title = pr_query.split("\n")[0]
body = pr_query[len(title) + 2 :]
pr = self.github_repo_instance.create_pull(
title=title,
body=body,
head=self.github_branch,
base=self.github_base_branch,
)
return f"Successfully created PR number {pr.number}"
except Exception as e:
return "Unable to make pull request due to error:\n" + str(e)
This method will return a success message with the PR number if the pull request is created successfully, or an error message if the pull request creation fails.
I hope this helps! If you have any other questions, feel free to ask.
This response is meant to be useful and save you time. It is not meant to be a precise solution, but rather a starting point for your own research.
Help me be more useful! Please leave a π if this is helpful and π if it is irrelevant.
If you want to continue the conversation, start your reply with @dosu-bot.
Hi, @umair313,
I'm helping the LangChain team manage their backlog and am marking this issue as stale. From what I understand, the issue involves failing tests in local development due to missing attributes in the openai module. The recommended solution is to upgrade the OpenAI library to the latest version and rerun the tests. Additionally, there is guidance on proposing new features and submitting pull requests for contributing to the LangChain project.
Could you please confirm if this issue is still relevant to the latest version of the LangChain repository? If it is, please let the LangChain team know by commenting on the issue. Otherwise, feel free to close the issue yourself, or it will be automatically closed in 7 days.
Thank you for your understanding and cooperation. If you have any further questions or need assistance, feel free to reach out.
System Info
langchain cloned peortry with python v3.11.4 openai v1.1.1
Who can help?
No response
Information
Related Components
Reproduction
cloned the repositpry cd to
libs/langchain
output
Expected behavior
All tests should pass or skipped without failing.