From 3da6680ddb8bbf6ab90739384e99bbb5e2d66e80 Mon Sep 17 00:00:00 2001 From: Olivier Halupczok <33556172+olivierhalupczok@users.noreply.github.com> Date: Tue, 2 Jan 2024 16:21:34 +0100 Subject: [PATCH] chore: add readme (#6) Signed-off-by: Olivier Halupczok --- README.md | 100 ++++++++++++++++++++++++++++++------------------------ 1 file changed, 56 insertions(+), 44 deletions(-) diff --git a/README.md b/README.md index 8372941..87bef83 100644 --- a/README.md +++ b/README.md @@ -1,73 +1,85 @@ -

- Nest Logo -

- -[circleci-image]: https://img.shields.io/circleci/build/github/nestjs/nest/master?token=abc123def456 -[circleci-url]: https://circleci.com/gh/nestjs/nest - -

A progressive Node.js framework for building efficient and scalable server-side applications.

-

-NPM Version -Package License -NPM Downloads -CircleCI -Coverage -Discord -Backers on Open Collective -Sponsors on Open Collective - - Support us - -

- - -## Description - -[Nest](https://github.com/nestjs/nest) framework TypeScript starter repository. +# GenAI project template - Typescript + +Project template to make starting project easier. Project uses OpenAI API to create assistants. To demonstrate the usage of the API, project contains the agent answering the questions concerning pokemons. Project is aimed to be used as a starting point for chatbots development. + +Project is built with `nestJS` and `typescript`. + +--- + +## Pre-requisities + +- Node.js v20.0.6 or higher +- npm + +--- ## Installation +Run the following command to install the dependencies: + ```bash -$ yarn install +$ npm install ``` ## Running the app +In order to run the app, you need to run the following command: + ```bash # development -$ yarn run start +$ npm run start # watch mode -$ yarn run start:dev +$ npm run start:dev -# production mode -$ yarn run start:prod +# build +$ npm run build ``` ## Test +Tests are written with `jest` and `supertest`. To run the tests, you need to run the following command: + ```bash # unit tests -$ yarn run test +$ npm run test -# e2e tests -$ yarn run test:e2e +# watch +$ npm run test:watch # test coverage -$ yarn run test:cov +$ npm run test:cov + +# e2e tests +$ npm run test:e2e + +# debug +$ npm run test:debug ``` -## Support +### Formatting + +Following command will run the prettier: -Nest is an MIT-licensed open source project. It can grow thanks to the sponsors and support by the amazing backers. If you'd like to join them, please [read more here](https://docs.nestjs.com/support). -## Stay in touch +```bash +# format - prettier +$ npm run format +``` + +## Secrets + +Project takes advantage of the `envfile` dependency to manage secrets. Assuming so, you need to copy `.env.dist` to `.env` file in the root directory of the project and fill it with the relevant secrets. + +```bash +$ cp .env.dist .env +``` + +--- -- Author - [Kamil Myƛliwiec](https://kamilmysliwiec.com) -- Website - [https://nestjs.com](https://nestjs.com/) -- Twitter - [@nestframework](https://twitter.com/nestframework) +## Architecture -## License +Project is oriented on the OpenAI assistants API. Therefore, it is built with the following architecture: -Nest is [MIT licensed](LICENSE). + - `src/assistant` - contains the logic responsible for creation of the assistant and its usage. Every time you run the program it will check whether an assistant exists. If not, it will create one. If yes, it will use the existing one. It has also the basis for the chatbot development. It also contains the runtime handling. +- `src/chat` - contains the logic responsible for the implementation of the chatbot. It is oriented specifically on the project's use case. It contains agents oriented for the project's need. It uses the `assistant` module to handle user requests and to implement agents defined in this directory. \ No newline at end of file