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)
显示属性错误:
AttributeError: partially initialized module 'langchain' has no attribute 'verbose' (most likely due to a circular import)