mirror of
https://github.com/hwchase17/langchain.git
synced 2025-06-06 07:04:01 +00:00
templates[patch]: Rag redis template dependency update (#13614)
- **Description:** Update RAG Redis template readme and dependencies.
This commit is contained in:
parent
a14cf87576
commit
dc31714ec5
@ -1,15 +1,19 @@
|
||||
|
||||
# rag-redis
|
||||
|
||||
This template performs RAG using Redis and OpenAI on financial 10k filings docs (for Nike).
|
||||
This template performs RAG using Redis (vector database) and OpenAI (LLM) on financial 10k filings docs for Nike.
|
||||
|
||||
It relies on the sentence transformer `all-MiniLM-L6-v2` for embedding chunks of the pdf and user questions.
|
||||
|
||||
## Environment Setup
|
||||
|
||||
Set the `OPENAI_API_KEY` environment variable to access the OpenAI models.
|
||||
Set the `OPENAI_API_KEY` environment variable to access the [OpenAI](https://platform.openai.com) models:
|
||||
|
||||
The following Redis environment variables need to be set:
|
||||
```bash
|
||||
export OPENAI_API_KEY= <YOUR OPENAI API KEY>
|
||||
```
|
||||
|
||||
Set the following [Redis](https://redis.com/try-free) environment variables:
|
||||
|
||||
```bash
|
||||
export REDIS_HOST = <YOUR REDIS HOST>
|
||||
@ -33,10 +37,10 @@ We use a variety of environment variables to configure this application
|
||||
|
||||
## Usage
|
||||
|
||||
To use this package, you should first have the LangChain CLI installed:
|
||||
To use this package, you should first have the LangChain CLI and Pydantic installed in a Python virtual environment:
|
||||
|
||||
```shell
|
||||
pip install -U langchain-cli
|
||||
pip install -U langchain-cli pydantic==1.10.13
|
||||
```
|
||||
|
||||
To create a new LangChain project and install this as the only package, you can do:
|
||||
@ -46,12 +50,11 @@ langchain app new my-app --package rag-redis
|
||||
```
|
||||
|
||||
If you want to add this to an existing project, you can just run:
|
||||
|
||||
```shell
|
||||
langchain app add rag-redis
|
||||
```
|
||||
|
||||
And add the following code to your `server.py` file:
|
||||
And add the following code snippet to your `app/server.py` file:
|
||||
```python
|
||||
from rag_redis.chain import chain as rag_redis_chain
|
||||
|
||||
|
@ -36,7 +36,7 @@ export_attr = "chain"
|
||||
[tool.templates-hub]
|
||||
use-case = "rag"
|
||||
author = "Redis"
|
||||
integrations = ["OpenAI", "Redis"]
|
||||
integrations = ["OpenAI", "Redis", "HuggingFace"]
|
||||
tags = ["vectordbs"]
|
||||
|
||||
[tool.poe.tasks.start]
|
||||
|
Loading…
Reference in New Issue
Block a user