From 717e625f47257bdbd96437acb7242bcd28c233ba Mon Sep 17 00:00:00 2001 From: Aditya Karnam Date: Sun, 14 Jan 2024 13:37:47 -0600 Subject: [PATCH 1/2] feat: add server api readme docs --- README.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/README.md b/README.md index 09d7df5a..07f0ad50 100644 --- a/README.md +++ b/README.md @@ -15,6 +15,7 @@ Crawl a site to generate knowledge files to create your own custom GPT from one - [Running in a container with Docker](#running-in-a-container-with-docker) - [Running as a CLI](#running-as-a-cli) - [Development](#development) + - [Running as an API](#running-as-an-api) - [Upload your data to OpenAI](#upload-your-data-to-openai) - [Create a custom GPT](#create-a-custom-gpt) - [Create a custom assistant](#create-a-custom-assistant) @@ -103,6 +104,18 @@ npm start To obtain the `output.json` with a containerized execution, go into the `containerapp` directory and modify the `config.ts` as shown above. The `output.json`file should be generated in the data folder. Note: the `outputFileName` property in the `config.ts` file in the `containerapp` directory is configured to work with the container. +#### Running as an API + +To run the app as a API server you will need to do an `npm install` to install the dependencies. The server is written in Express JS. + +To run the server. + +`npm run start:server` to start the server. The server runs by default on port 3000. + +You can use the endpoint `/crawl` with the post request body of config json to run the crawler. The api docs are served on the endpoint `/api-docs` and are served using swagger. + +To modify the environment you can copy over the `.env.example` to `.env` and set your values like port, etc. to override the variables for the server. + ### Upload your data to OpenAI The crawl will generate a file called `output.json` at the root of this project. Upload that [to OpenAI](https://platform.openai.com/docs/assistants/overview) to create your custom assistant or custom GPT. From 0f4e58b400eab312e7b595d7a2472bae93055415 Mon Sep 17 00:00:00 2001 From: Aditya Karnam Date: Sun, 14 Jan 2024 14:10:29 -0600 Subject: [PATCH 2/2] fix: linting --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 07f0ad50..679f0d2d 100644 --- a/README.md +++ b/README.md @@ -106,7 +106,7 @@ To obtain the `output.json` with a containerized execution, go into the `contain #### Running as an API -To run the app as a API server you will need to do an `npm install` to install the dependencies. The server is written in Express JS. +To run the app as a API server you will need to do an `npm install` to install the dependencies. The server is written in Express JS. To run the server.