-
Notifications
You must be signed in to change notification settings - Fork 375
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
314a2b8
commit 6387bc6
Showing
4 changed files
with
84 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
# Vercel Examples | ||
|
||
These examples demonstrate how to integrate LlamaIndexTS with Vercel's AI SDK. The examples show how to use LlamaIndex for search and retrieval in both local vector store and LlamaCloud environments. | ||
|
||
## Setup | ||
|
||
To run these examples, first install the required dependencies from the parent folder `examples`: | ||
|
||
```bash | ||
npm i | ||
``` | ||
|
||
## Running the Examples | ||
|
||
Make sure to run the examples from the parent folder called `examples`. The following examples are available: | ||
|
||
### Vector Store Example | ||
|
||
Run the local vector store example with: | ||
|
||
```bash | ||
npx tsx vercel/vector-store.ts | ||
``` | ||
|
||
This example demonstrates: | ||
|
||
- Creating a vector store index from one document | ||
- Using Vercel's AI SDK with LlamaIndex for streaming responses | ||
|
||
### LlamaCloud Example | ||
|
||
To run the LlamaCloud example: | ||
|
||
```bash | ||
npx tsx vercel/llamacloud.ts | ||
``` | ||
|
||
This example requires a LlamaCloud API key set in your environment and an embedding model set in the `EMBEDDING_MODEL` environment variable: | ||
|
||
```bash | ||
export LLAMA_CLOUD_API_KEY=your_api_key_here | ||
export EMBEDDING_MODEL="text-embedding-3-small" | ||
``` | ||
|
||
The example demonstrates: | ||
|
||
- Creating a LlamaCloud index from one document | ||
- Streaming responses using Vercel's AI SDK | ||
|
||
For more detailed information about the Vercel integration, check out [the documentation](https://ts.llamaindex.ai/docs/llamaindex/integration/vercel). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters