From 5950c176caf585b04ac517003d1385833e5e4927 Mon Sep 17 00:00:00 2001 From: Christian Frantzen Date: Tue, 30 Apr 2024 05:19:06 +0200 Subject: [PATCH] Update langchainpy.md (#4037) Updated the code a bit --- docs/tutorials/langchainpy.md | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/docs/tutorials/langchainpy.md b/docs/tutorials/langchainpy.md index f6ee4fa3..b0235679 100644 --- a/docs/tutorials/langchainpy.md +++ b/docs/tutorials/langchainpy.md @@ -17,10 +17,12 @@ Let's start by asking a simple question that we can get an answer to from the ** Then we can create a model and ask the question: ```python -from langchain.llms import Ollama -ollama = Ollama(base_url='http://localhost:11434', -model="llama2") -print(ollama("why is the sky blue")) +from langchain_community.llms import Ollama +ollama = Ollama( + base_url='http://localhost:11434', + model="llama3" +) +print(ollama.invoke("why is the sky blue")) ``` Notice that we are defining the model and the base URL for Ollama.