-
Notifications
You must be signed in to change notification settings - Fork 15.3k
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
OpenAI instance of Runnable expected #13053
Comments
🤖 Hello @wonderkidshihab, I'm Dosu, a friendly bot here to assist you in navigating the LangChain repository. I can help you solve bugs, answer your questions, and guide you on your journey to becoming a contributor. While we're waiting for a human maintainer, I'm here to help. I'm currently reviewing your issue and will provide a more complete response shortly. Thank you for your patience. |
🤖 It seems like the error you're encountering is due to the In LangChain, a The A similar issue was encountered and solved in the LangChain repository. The solution was to create a wrapper class for the language model that inherits from from langchain.schema.language_model import BaseLanguageModel
from openai import OpenAI
class OpenAIWrapper(BaseLanguageModel):
def __init__(self):
self.llm = OpenAI()
def generate(self, prompts, **kwargs):
# Implement the generate method using self.llm
pass
# Implement other required methods... Then, you can use this wrapper class when creating an instance of llm = OpenAIWrapper()
name_chain = LLMChain(
llm=llm,
prompt=prompt_template,
) Please note that you'll need to implement the You can refer to the Issue with Langchain LLM Chains for more details. I hope this helps! If you have any other questions or if something is unclear, feel free to ask. Sources
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. |
I faced this issue and the resolution is following: The issue is this line: Replace above line with following: Hence, the prob is wrong package. |
@adfriend2003 Thanks man... it helped me a lot |
For me this issue was caused by importing a function named "llm" that shadowed the actual llm variable i wanted to use. to
|
I am facing the similar problem with
Can someone help me out here? |
System Info
Hi there,
I have started learning about Langchain today. I was creating my first langchain prompt template but something doesn't seem to work.
Here is my code in main.py:
While I think the code is okay and I have followed the GitHub get started it doesn't seem to work and throwing me this error:
Please Help me as I am not that proficient in Python.
Who can help?
@agola11
Information
Related Components
Reproduction
Just copy the code given there and run it. You will see the error.
Expected behavior
Run the code and get a response without error
The text was updated successfully, but these errors were encountered: