Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 27 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,11 @@ Features:
Install the package using your preferred package manager:

```sh
pnpm add @upstash/rag-chat
pnpm add @upstash/rag-chat @upstash/redis

bun add @upstash/rag-chat
bun add @upstash/rag-chat @upstash/redis

npm i @upstash/rag-chat
npm i @upstash/rag-chat @upstash/redis
```

### Quick Start
Expand Down Expand Up @@ -66,8 +66,14 @@ import { RAGChat } from "@upstash/rag-chat";

const ragChat = new RAGChat();

const response = await ragChat.chat("Tell me about machine learning");
console.log(response);
const main = async ()=>{
const response = await ragChat.chat("Tell me about machine learning");
console.log(response);
}

main()


```

### Basic Usage
Expand All @@ -79,18 +85,24 @@ export const ragChat = new RAGChat({
model: openai("gpt-4-turbo"),
});

await ragChat.context.add({
type: "text",
data: "The speed of light is approximately 299,792,458 meters per second.",
});

await ragChat.context.add({
type: "pdf",
fileSource: "./data/physics_basics.pdf",
});
const response = await ragChat.chat("What is the speed of light?");
const main = async ()=>{

await ragChat.context.add({
type: "text",
data: "The speed of light is approximately 299,792,458 meters per second.",
});

await ragChat.context.add({
type: "pdf",
fileSource: "./data/physics_basics.pdf",
});
const response = await ragChat.chat("What is the speed of light?");

console.log(response.output);
}

console.log(response.output);
main()
```

## Docs
Expand Down