Integrations
OpenAI
OpenAI is a language model provider. Check out OpenAI API for more information about their models and pricing.
Install RAG Chat SDK
Initialize the project and install the required packages:
Setup Upstash Redis
Create a Redis database using Upstash Console or Upstash CLI and copy the UPSTASH_REDIS_REST_URL
and UPSTASH_REDIS_REST_TOKEN
into your .env
file.
.env
Setup Upstash Vector
Create a Vector index using Upstash Console or Upstash CLI and copy the UPSTASH_VECTOR_REST_URL
and UPSTASH_VECTOR_REST_TOKEN
into your .env
file.
.env
Setup OpenAI
Create an OpenAI account and get an API key from OpenAI Platform -> Dashboard -> API keys. Set your OpenAI API key as an environment variable:
.env
Setup the Project
Initialize RAGChat with the OpenAI model:
index.ts
Add context to the RAG Chat:
index.ts
Chat with the RAG Chat:
index.ts
Run
Run the project:
Was this page helpful?