mirror of
https://github.com/ollama/ollama.git
synced 2025-08-03 10:43:55 +02:00
simple gen to simple
Signed-off-by: Matt Williams <m@technovangelist.com>
This commit is contained in:
21
examples/langchain-python-simple/README.md
Normal file
21
examples/langchain-python-simple/README.md
Normal file
@@ -0,0 +1,21 @@
|
||||
# LangChain
|
||||
|
||||
This example is a basic "hello world" of using LangChain with Ollama.
|
||||
|
||||
## Setup
|
||||
|
||||
```
|
||||
pip install -r requirements.txt
|
||||
```
|
||||
|
||||
## Run
|
||||
|
||||
```
|
||||
python main.py
|
||||
```
|
||||
|
||||
Running this example will print the response for "hello":
|
||||
|
||||
```
|
||||
Hello! It's nice to meet you. hopefully you are having a great day! Is there something I can help you with or would you like to chat?
|
||||
```
|
4
examples/langchain-python-simple/main.py
Normal file
4
examples/langchain-python-simple/main.py
Normal file
@@ -0,0 +1,4 @@
|
||||
from langchain.llms import Ollama
|
||||
llm = Ollama(model="llama2")
|
||||
res = llm.predict("hello")
|
||||
print (res)
|
1
examples/langchain-python-simple/requirements.txt
Normal file
1
examples/langchain-python-simple/requirements.txt
Normal file
@@ -0,0 +1 @@
|
||||
langchain==0.0.259
|
Reference in New Issue
Block a user