mirror of
https://github.com/dogkeeper886/ollama37.git
synced 2025-12-18 19:56:59 +00:00
add langchain examples
This commit is contained in:
15
examples/langchain/README.md
Normal file
15
examples/langchain/README.md
Normal file
@@ -0,0 +1,15 @@
|
||||
# LangChain
|
||||
|
||||
This example is a basic "hello world" of using LangChain with Ollama.
|
||||
|
||||
## Setup
|
||||
|
||||
```
|
||||
pip install -r requirements.txt
|
||||
```
|
||||
|
||||
## Run
|
||||
|
||||
```
|
||||
python main.py
|
||||
```
|
||||
4
examples/langchain/main.py
Normal file
4
examples/langchain/main.py
Normal file
@@ -0,0 +1,4 @@
|
||||
from langchain.llms import Ollama
|
||||
llm = Ollama(model="llama2")
|
||||
res = llm.predict("hi!")
|
||||
print (res)
|
||||
1
examples/langchain/requirements.txt
Normal file
1
examples/langchain/requirements.txt
Normal file
@@ -0,0 +1 @@
|
||||
langchain==0.0.259
|
||||
Reference in New Issue
Block a user