Compare commits

...

4 Commits

Author SHA1 Message Date
sweep-ai[bot] cd25003654 Merge main into sweep/add-replicate-api-token-requirement 2023-11-14 23:05:50 +00:00
sweep-ai[bot] 62aa6e6ca8 Merge main into sweep/add-replicate-api-token-requirement 2023-11-14 20:08:13 +00:00
sweep-ai[bot] 41ed3012db feat: Updated packages/create-llama/README.md 2023-11-14 19:55:14 +00:00
sweep-ai[bot] 7a9ca3db8e feat: Updated packages/create-llama/templates/type 2023-11-14 19:54:36 +00:00
2 changed files with 7 additions and 0 deletions
+3
View File
@@ -10,6 +10,8 @@ The easiest way to get started with [LlamaIndex](https://www.llamaindex.ai/) is
## Get Started
Before you start, please note that to use `LlamaDeuce`, you must set the `REPLICATE_API_TOKEN` environment variable. This is required to authenticate with the Replicate API.
You can run `create-llama` in interactive or non-interactive mode.
### Interactive
@@ -44,6 +46,7 @@ Ok to proceed? (y) y
✔ Would you like to use ESLint? … No / Yes
Creating a new LlamaIndex app in /home/my-app.
```
✔ Please provide your Replicate API key (leave blank to skip): …
### Non-interactive
@@ -1,4 +1,5 @@
import { ChatMessage, OpenAI } from "llamaindex";
import process from 'process';
import { NextRequest, NextResponse } from "next/server";
import { createChatEngine } from "./engine";
@@ -28,6 +29,9 @@ export async function POST(request: NextRequest) {
const response = await chatEngine.chat(lastMessage.content, messages);
const result: ChatMessage = {
if (!process.env.REPLICATE_API_TOKEN) {
throw new Error('The REPLICATE_API_TOKEN environment variable is required to use LlamaDeuce. Please set this in your environment.');
}
role: "assistant",
content: response.response,
};