Skip to content
Merged
Show file tree
Hide file tree
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
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@ node_modules
.idea
.vscode
.env
venv
venv
sources
11 changes: 11 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,17 @@ Finally, start a development server:
npm run dev
```

### 4. Testing the changes

We use a set of benchmark questions to test your changes:

- How do you add a custom domain in the console?
- Show me how I can set up database collections and documents.
- What's the difference between Server and Client SDKs?
- How do I use the users API to create a new user with Dart?

You can execute the [npm run test](./scripts/test-prompts.js) script to write snapshots of the answers to these questions to the tests folder.

## Submit a Pull Request 🚀

The branch naming convention is as follows
Expand Down
4 changes: 3 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ RUN pnpm --prod install

COPY . .

RUN pnpm run fetch-sources

ENV _APP_ASSISTANT_OPENAI_API_KEY=''

EXPOSE 3003
CMD [ "node", "main.js" ]
CMD [ "pnpm", "start" ]
20 changes: 17 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,30 @@ To install, run the following command.
pnpm i
```

Next, fetch the Appwrite-specific sources used by the assistant.

```bash
pnpm run fetch-sources
```

This will download the sources from the Appwrite documentation and store them in the `./sources` directory.

## Usage

To run the server, execute the `main.js` file with node, or run the `dev` command to hot-restart the server on file changes.
To run the server, execute the `dev` command. By default, the server will be available at `http://localhost:3000`

```bash
node main.js
# Or
pnpm run dev
```

The server exposes a POST endpoint at `/`. The endpoint expects a raw text body containing the query for the assistant. The answer to the query will be streamed back to the client as raw text.

Use cURL to test the server, for example:

```bash
curl -X POST -d "How do I create a user?" http://localhost:3000
```

## Contributing

All code contributions, including those of people having commit access, must go through a pull request and be approved by a core developer before being merged. This is to ensure a proper review of all the code.
Expand Down
1 change: 0 additions & 1 deletion docs/4eeb7d58-4583-11ee-9922-f2ea36f81204.json

This file was deleted.

1 change: 0 additions & 1 deletion docs/4eeb9216-4583-11ee-9922-f2ea36f81204.json

This file was deleted.

1 change: 0 additions & 1 deletion docs/4eeb9b80-4583-11ee-9922-f2ea36f81204.json

This file was deleted.

1 change: 0 additions & 1 deletion docs/4eeba62a-4583-11ee-9922-f2ea36f81204.json

This file was deleted.

Loading