mirror of
https://github.com/runyanjake/memechain.git
synced 2025-10-04 23:57:29 -07:00
17 lines
358 B
Python
17 lines
358 B
Python
from langchain_core.prompts import ChatPromptTemplate
|
|
from langchain_ollama.llms import OllamaLLM
|
|
|
|
template = """Question: {question}
|
|
|
|
Answer: Let's think step by step."""
|
|
|
|
prompt = ChatPromptTemplate.from_template(template)
|
|
|
|
model = OllamaLLM(model="llama3")
|
|
|
|
chain = prompt | model
|
|
|
|
result = chain.invoke({"question": "What is LangChain?"})
|
|
|
|
print(result)
|