ollama/examples/langchain-python-simple/main.py
Simon Schampijer cfb1ddd6fc
examples: update langchain-python-simple (#3591)
- better formatting of input prompt
- use invoke instead of predict
2024-11-24 16:06:22 -08:00

6 lines
146 B
Python

from langchain.llms import Ollama
input = input("What is your question?\n> ")
llm = Ollama(model="llama3.2")
res = llm.invoke(input)
print (res)