examples: update langchain-python-simple (#3591)

- better formatting of input prompt
- use invoke instead of predict
This commit is contained in:
Simon Schampijer 2024-11-25 01:06:22 +01:00 committed by GitHub
parent 3987acd7ec
commit cfb1ddd6fc
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1,6 +1,6 @@
from langchain.llms import Ollama from langchain.llms import Ollama
input = input("What is your question?") input = input("What is your question?\n> ")
llm = Ollama(model="llama3.2") llm = Ollama(model="llama3.2")
res = llm.predict(input) res = llm.invoke(input)
print (res) print (res)