Skip to content

Commit

Permalink
update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
leehuwuj committed Nov 13, 2024
1 parent 2e6ad55 commit ba1462a
Show file tree
Hide file tree
Showing 5 changed files with 87 additions and 6 deletions.
8 changes: 4 additions & 4 deletions helpers/typescript.ts
Original file line number Diff line number Diff line change
Expand Up @@ -146,11 +146,11 @@ export const installTSTemplate = async ({
rename: assetRelocator,
});

// Copy attachments for form filling agent
const attachmentPath = path.join(useCasePath, "attachments");
await copy("**", path.join(root), {
// Copy use case files to project root
await copy("*.*", path.join(root), {
parents: true,
cwd: attachmentPath,
cwd: useCasePath,
rename: assetRelocator,
});
} else {
console.log(
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
This is a [LlamaIndex](https://www.llamaindex.ai/) project using [Next.js](https://nextjs.org/) bootstrapped with [`create-llama`](https://github.com/run-llama/LlamaIndexTS/tree/main/packages/create-llama).

## Getting Started

First, install the dependencies:

```
npm install
```

Then check the parameters that have been pre-configured in the `.env` file in this directory.
Make sure you have the `OPENAI_API_KEY` set.

Second, generate the embeddings of the documents in the `./data` directory:

```
npm run generate
```

Third, run the development server:

```
npm run dev
```

Open [http://localhost:3000](http://localhost:3000) with your browser to see the chat UI.

## Use Case: Filling Financial CSV Template

You can start by sending an request on the chat UI to create a report comparing the finances of Apple and Tesla.
Or you can test the `/api/chat` endpoint with the following curl request:

```
curl --location 'localhost:3000/api/chat' \
--header 'Content-Type: application/json' \
--data '{ "messages": [{ "role": "user", "content": "Create a report comparing the finances of Apple and Tesla" }] }'
```

## Learn More

To learn more about LlamaIndex, take a look at the following resources:

- [LlamaIndex Documentation](https://docs.llamaindex.ai) - learn about LlamaIndex.
- [Workflows Introduction](https://docs.llamaindex.ai/en/stable/understanding/workflows/) - learn about LlamaIndex workflows.

You can check out [the LlamaIndex GitHub repository](https://github.com/run-llama/llama_index) - your feedback and contributions are welcome!
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
This is a [LlamaIndex](https://www.llamaindex.ai/) project using [Next.js](https://nextjs.org/) bootstrapped with [`create-llama`](https://github.com/run-llama/LlamaIndexTS/tree/main/packages/create-llama).

## Getting Started

First, install the dependencies:

```
npm install
```

Then check the parameters that have been pre-configured in the `.env` file in this directory.
Make sure you have the `OPENAI_API_KEY` set.

Second, run the development server:

```
npm run dev
```

Open [http://localhost:3000](http://localhost:3000) with your browser to see the chat UI.

## Use Case: Filling Financial CSV Template

1. Upload the Apple and Tesla financial reports from the [data](./data) directory. Just send an empty message.
2. Upload the CSV file [sec_10k_template.csv](./sec_10k_template.csv) and send the message "Fill the missing cells in the CSV file".

The agent will fill the missing cells by retrieving the information from the uploaded financial reports and return a new CSV file with the filled cells.

## Learn More

To learn more about LlamaIndex, take a look at the following resources:

- [LlamaIndex Documentation](https://docs.llamaindex.ai) - learn about LlamaIndex.
- [Workflows Introduction](https://docs.llamaindex.ai/en/stable/understanding/workflows/) - learn about LlamaIndex workflows.

You can check out [the LlamaIndex GitHub repository](https://github.com/run-llama/llama_index) - your feedback and contributions are welcome!
3 changes: 1 addition & 2 deletions templates/components/multiagent/typescript/nextjs/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,7 @@ export async function POST(request: NextRequest) {
const { stream, dataStream } =
await createStreamFromWorkflowContext(context);

// Return using the new Response API
// TODO: StreamingTextResponse has been deprecated
// Return the two streams in one response
return new StreamingTextResponse(stream, {}, dataStream);
} catch (error) {
console.error("[LlamaIndex]", error);
Expand Down

0 comments on commit ba1462a

Please sign in to comment.