Skip to content

Commit

Permalink
Add instructions to README for local development
Browse files Browse the repository at this point in the history
  • Loading branch information
unstubbable committed Mar 16, 2024
1 parent a2af6e8 commit 3e4f60a
Showing 1 changed file with 47 additions and 1 deletion.
48 changes: 47 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,57 @@ kinds.
Built using [MFNG](https://github.com/unstubbable/mfng/) — a minimal React
Server Components (RSC) bundler & library — and the
[Vercel AI SDK](https://sdk.vercel.ai/docs), this demo leverages RSCs to
[seamlessly integrate text with UI](https://sdk.vercel.ai/docs/concepts/ai-rsc),
[seamlessly integrate text with UI](https://sdk.vercel.ai/docs/concepts/ai-rsc)
as generated by the LLM.

The app is deployed on AWS Lambda & CloudFront. Due to cost considerations, it
is heavily rate-limited, which may result in occasional error responses.

You can try it out at
[https://ai-demo.mfng.strict.software](https://ai-demo.mfng.strict.software).

---

## Run Locally

### Prerequisites

- Node.js 20+ installed on your local development machine.
- An [OpenAI API key](https://platform.openai.com/account/api-keys).

### Install

To install the dependencies, run:

```
npm install
```

### Environment Variables

Define the following environment variables, e.g., using
[direnv](https://direnv.net):

- `OPENAI_API_KEY`: Your OpenAI API key (**required**)
- `GOOGLE_SEARCH_API_KEY`: Your Custom Search JSON API key (optional)
- `GOOGLE_SEARCH_SEARCH_ENGINE_ID`: Your Custom Search JSON API Engine ID
(optional)

**Note:** When the two Google Custom Search JSON API environment variables are
not defined, the chat will still function properly; however, images will not be
displayed, and error messages will be shown instead.

For more information on the Custom Search JSON API, visit:
[https://developers.google.com/custom-search/v1/introduction](https://developers.google.com/custom-search/v1/introduction)

### Dev Server

To start the development server (which watches for file changes), run:

```
npm run dev
```

### Browser

Open [http://localhost:3000](http://localhost:3000) in your browser.

0 comments on commit 3e4f60a

Please sign in to comment.