Closed akashkumar398 closed 6 months ago
🤖
Hey there, @akashkumar398! Good to see you again! Looks like we're on another coding adventure, aren't we? 🚀
Based on the context provided, it seems like the from_messages
method you're trying to use doesn't exist in the PromptTemplate
class of the LangChain framework. This is why you're encountering the error "type object ‘PromptTemplate’ has no attribute ‘from_messages'".
The PromptTemplate
class might have been updated or changed in the version of LangChain you're using, or the from_messages
method might not have been a part of the PromptTemplate
class to begin with.
To resolve this issue, you could try a few things:
Check the documentation or source code of the PromptTemplate
class in the version of LangChain you're using to see if the from_messages
method is defined. If it's not, you'll need to use a different method or approach to achieve what you're trying to do.
If the from_messages
method is defined in a different class or module, make sure to import that class or module and use the method from there.
If from_messages
is a custom method you've defined elsewhere in your code, ensure that you've correctly imported it and are calling it on the right object.
Without the full code of the PromptTemplate
class or the langchain_core.prompts
module, it's difficult to provide a more specific solution. If you could provide more information about where the from_messages
method is supposed to be defined, I might be able to help you further.
I hope this helps! If you have any other questions or need further clarification, 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.
Checked other resources
Example Code
class SQLDbTool(BaseTool):
Error Message and Stack Trace (if applicable)
No response
Description
getting error : type object ‘PromptTemplate’ has no attribute ‘from_messages'
System Info
langchain==0.0.352 langchain-core==0.1.11