4209457bdc
Add Redis langserve template! Eventually will add semantic caching to this too. But I was struggling to get that to work for some reason with the LCEL implementation here. - **Description:** Introduces the Redis LangServe template. A simple RAG based app built on top of Redis that allows you to chat with company's public financial data (Edgar 10k filings) - **Issue:** None - **Dependencies:** The template contains the poetry project requirements to run this template - **Tag maintainer:** @baskaryan @Spartee - **Twitter handle:** @tchutch94 **Note**: this requires the commit here that deletes the `_aget_relevant_documents()` method from the Redis retriever class that wasn't implemented. That was breaking the langserve app. --------- Co-authored-by: Sam Partee <sam.partee@redis.com> |
||
---|---|---|
.. | ||
anthropic-functions | ||
anthropic-iterative-search | ||
cassandra-entomology-rag | ||
cassandra-synonym-caching | ||
csv-agent | ||
elastic-query-generator | ||
extraction-openai-functions | ||
hyde | ||
llama2-functions | ||
neo4j-cypher | ||
neo4j-cypher-ft | ||
neo4j-generation | ||
neo4j-parent | ||
openai-functions-agent | ||
rag-aws-bedrock | ||
rag-chroma | ||
rag-chroma-private | ||
rag-conversation | ||
rag-elasticsearch | ||
rag-fusion | ||
rag-pinecone | ||
rag-pinecone-multi-query | ||
rag-pinecone-rerank | ||
rag-redis | ||
rag-semi-structured | ||
rag-supabase | ||
rag-weaviate | ||
rewrite-retrieve-read | ||
self-query-supabase | ||
sql-llama2 | ||
sql-llamacpp | ||
sql-ollama | ||
stepback-qa-prompting | ||
summarize-anthropic | ||
xml-agent | ||
.gitignore | ||
CONTRIBUTING.md | ||
INDEX.md | ||
Makefile | ||
poetry.lock | ||
pyproject.toml | ||
README.md |
LangServe Templates
Templates for a fully functioning app that can be hosted by LangServe.
Some other helpful docs:
- [Templates]
Usage
To use, first install the LangChain CLI.
pip install -U "langchain-cli[serve]"
Next, create a new LangChain project:
langchain serve new my-app
This will create a new directory called my-app
with two folders:
app
: This is where LangServe code will livepackages
: This is where your chains or agents will live
To pull in an existing template as a package, you first need to go into your new project:
cd my-app
And you can the add a template as a project
langchain serve add $PROJECT_NAME
This will pull in the specified template into packages/$PROJECT_NAME
You then need to install this package so you can use it in the langserve app:
pip install -e packages/$PROJECT_NAME
We install it with -e
so that if you modify the template at all (which you likely will) the changes are updated.
In order to have LangServe use this project, you then need to modify app/server.py
.
Specifically, you should add something like:
from fastapi import FastAPI
from langserve import add_routes
# This depends on the structure of the package you install
from my_project import chain
app = FastAPI()
add_routes(app, chain)
You can then spin up production-ready endpoints, along with a playground, by running:
langchain start
Adding a template
See here