Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

No Attribute called verbose

Here is my code:

from langchain_core.prompts import ChatPromptTemplate
from langchain_ollama import ChatOllama

llm = ChatOllama(
    model = 'llama3.2',
    temperature = 0
)

chat_template = ChatPromptTemplate.from_messages(
    [
        ('system', "you have to give two line definition of the word given by user"),
        ('human', 'the word is {user_input}')
    ]
)

message = chat_template.format_messages(user_input = 'backlog')
print(message)

response = llm.invoke(message)
print(message)

And it is showing Attribute error:

AttributeError: partially initialized module 'langchain' has no attribute 'verbose' (most likely due to a circular import)

How can I fix this?
I was trying to create basic word meaning chatbot using langchain.

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

You are getting this error because you have a file named langchain.py

Please change your file name to some other name.

Also, please refrain from naming your file names to module names, keywords, etc.

https://github.com/langchain-ai/langchain/discussions/23071

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading