Skip to content

Commit

Permalink
Merge branch 'main' into docs-fix
Browse files Browse the repository at this point in the history
  • Loading branch information
dartpain authored Oct 9, 2023
2 parents 261c674 + cb0e4b6 commit a809e72
Show file tree
Hide file tree
Showing 23 changed files with 164 additions and 101 deletions.
30 changes: 15 additions & 15 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,41 +1,42 @@
# Welcome to DocsGPT Contributing Guidelines

Thank you for choosing this project to contribute to. We are all very grateful!
Thank you for choosing to contribute to DocsGPT! We are all very grateful!

### [🎉 Join the Hacktoberfest with DocsGPT and Earn a Free T-shirt! 🎉](https://github.com/arc53/DocsGPT/blob/main/HACKTOBERFEST.md)

# We accept different types of contributions

📣 **Discussions** - where you can start a new topic or answer some questions
📣 **Discussions** - Engage in conversations, start new topics, or help answer questions.

🐞 **Issues** - This is how we track tasks, sometimes it is bugs that need fixing, and sometimes it is new features
🐞 **Issues** - This is where we keep track of tasks. It could be bugs,fixes or suggestions for new features.

🛠️ **Pull requests** - This is how you can suggest changes to our repository, to work on existing issues or add new features
🛠️ **Pull requests** - Suggest changes to our repository, either by working on existing issues or adding new features.

📚 **Wiki** - where we have our documentation
📚 **Wiki** - This is where our documentation resides.


## 🐞 Issues and Pull requests

We value contributions to our issues in the form of discussion or suggestions. We recommend that you check out existing issues and our [roadmap](https://github.com/orgs/arc53/projects/2).
We value contributions in the form of discussions or suggestions. We recommend taking a look at existing issues and our [roadmap](https://github.com/orgs/arc53/projects/2).

If you want to contribute by writing code, there are a few things that you should know before doing it:
If you're interested in contributing code, here are some important things to know:

We have a frontend in React (Vite) and backend in Python.
We have a frontend built with React (Vite) and a backend in Python.

### If you are looking to contribute to frontend (⚛️React, Vite):

- The current frontend is being migrated from `/application` to `/frontend` with a new design, so please contribute to the new one.
- The current frontend is being migrated from [`/application`](https://github.com/arc53/DocsGPT/tree/main/application) to [`/frontend`](https://github.com/arc53/DocsGPT/tree/main/frontend) with a new design, so please contribute to the new one.
- Check out this [milestone](https://github.com/arc53/DocsGPT/milestone/1) and its issues.
- The Figma design can be found [here](https://www.figma.com/file/OXLtrl1EAy885to6S69554/DocsGPT?node-id=0%3A1&t=hjWVuxRg9yi5YkJ9-1).

Please try to follow the guidelines.

### If you are looking to contribute to Backend (🐍 Python):
- Check out our issues and contribute to `/application` or `/scripts` (ignore old `ingest_rst.py` `ingest_rst_sphinx.py` files; they will be deprecated soon).
- All new code should be covered with unit tests ([pytest](https://github.com/pytest-dev/pytest)). Please find tests under [`/tests`](https://github.com/arc53/DocsGPT/tree/main/tests) folder.
- Before submitting your PR, ensure it is queryable after ingesting some test data.

- Review our issues and contribute to [`/application`](https://github.com/arc53/DocsGPT/tree/main/application) or [`/scripts`](https://github.com/arc53/DocsGPT/tree/main/scripts) (please disregard old [`ingest_rst.py`](https://github.com/arc53/DocsGPT/blob/main/scripts/old/ingest_rst.py) [`ingest_rst_sphinx.py`](https://github.com/arc53/DocsGPT/blob/main/scripts/old/ingest_rst_sphinx.py) files; they will be deprecated soon).
- All new code should be covered with unit tests ([pytest](https://github.com/pytest-dev/pytest)). Please find tests under [`/tests`](https://github.com/arc53/DocsGPT/tree/main/tests) folder.
- Before submitting your Pull Request, ensure it can be queried after ingesting some test data.

### Testing

To run unit tests from the root of the repository, execute:
Expand All @@ -44,9 +45,8 @@ python -m pytest
```

### Workflow:
Create a fork, make changes on your forked repository, and submit changes as a pull request.
Fork the repository, make your changes on your forked version, and then submit those changes as a pull request.

## Questions/collaboration
Please join our [Discord](https://discord.gg/n5BX8dh8rU). Don't hesitate; we are very friendly and welcoming to new contributors.

Feel free to join our [Discord](https://discord.gg/n5BX8dh8rU). We're very friendly and welcoming to new contributors, so don't hesitate to reach out.
# Thank you so much for considering contributing to DocsGPT!🙏
6 changes: 3 additions & 3 deletions HACKTOBERFEST.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@ Familiarize yourself with the current contributions and our [Roadmap](https://gi
Deciding to contribute with code? Here are some insights based on the area of your interest:

- Frontend (⚛️React, Vite):
- Most of the code is located in `/frontend` folder. You can also check out our React extension in /extensions/react-widget.
- Most of the code is located in [`/frontend`](https://github.com/arc53/DocsGPT/tree/main/frontend) folder. You can also check out our React extension in [`/extensions/react-widget`](https://github.com/arc53/DocsGPT/tree/main/extensions/react-widget).
- For design references, here's the [Figma](https://www.figma.com/file/OXLtrl1EAy885to6S69554/DocsGPT?node-id=0%3A1&t=hjWVuxRg9yi5YkJ9-1).
- Ensure you adhere to the established guidelines.

- Backend (🐍Python):
- Focus on `/application` or `/scripts`. However, avoid the files ingest_rst.py and ingest_rst_sphinx.py, as they will soon be deprecated.
- Focus on [`/application`](https://github.com/arc53/DocsGPT/tree/main/application) or [`/scripts`](https://github.com/arc53/DocsGPT/tree/main/scripts). However, avoid the files [`ingest_rst.py`](https://github.com/arc53/DocsGPT/blob/main/scripts/old/ingest_rst.py) and [`ingest_rst_sphinx.py`](https://github.com/arc53/DocsGPT/blob/main/scripts/old/ingest_rst_sphinx.py), as they will soon be deprecated.
- Newly added code should come with relevant unit tests (pytest).
- Refer to the `/tests` folder for test suites.
- Refer to the [`/tests`](https://github.com/arc53/DocsGPT/tree/main/tests) folder for test suites.

Check out our [Contributing Guidelines](https://github.com/arc53/DocsGPT/blob/main/CONTRIBUTING.md)

Expand Down
20 changes: 10 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
</p>

<p align="left">
<strong>DocsGPT</strong> is a cutting-edge open-source solution that streamlines the process of finding information in project documentation. With its integration of the powerful <strong>GPT</strong> models, developers can easily ask questions about a project and receive accurate answers.
<strong><a href="https://docsgpt.arc53.com/">DocsGPT</a></strong> is a cutting-edge open-source solution that streamlines the process of finding information in project documentation. With its integration of the powerful <strong>GPT</strong> models, developers can easily ask questions about a project and receive accurate answers.

Say goodbye to time-consuming manual searches, and let <strong>DocsGPT</strong> help you quickly find the information you need. Try it out and see how it revolutionizes your project documentation experience. Contribute to its development and be a part of the future of AI-powered assistance.
Say goodbye to time-consuming manual searches, and let <strong><a href="https://docsgpt.arc53.com/">DocsGPT</a></strong> help you quickly find the information you need. Try it out and see how it revolutionizes your project documentation experience. Contribute to its development and be a part of the future of AI-powered assistance.
</p>

<div align="center">
Expand All @@ -24,7 +24,7 @@ Say goodbye to time-consuming manual searches, and let <strong>DocsGPT</strong>
### Production Support / Help for companies:

We're eager to provide personalized assistance when deploying your DocsGPT to a live environment.
- [Get Support 👋](https://airtable.com/appdeaL0F1qV8Bl2C/shrrJF1Ll7btCJRbP)
- [Get Support 👋](https://cal.com/arc53/docsgpt-demo-b2b)
- [Send Email ✉️](mailto:[email protected]?subject=DocsGPT%20support%2Fsolutions)

### [🎉 Join the Hacktoberfest with DocsGPT and Earn a Free T-shirt! 🎉](https://github.com/arc53/DocsGPT/blob/main/HACKTOBERFEST.md)
Expand Down Expand Up @@ -89,23 +89,23 @@ It will install all the dependencies and allow you to download the local model o
Otherwise, refer to this Guide:

1. Download and open this repository with `git clone https://github.com/arc53/DocsGPT.git`
2. Create a `.env` file in your root directory and set the env variable `OPENAI_API_KEY` with your OpenAI API key and `VITE_API_STREAMING` to true or false, depending on if you want streaming answers or not.
2. Create a `.env` file in your root directory and set the env variable `OPENAI_API_KEY` with your [OpenAI API key](https://platform.openai.com/account/api-keys) and `VITE_API_STREAMING` to true or false, depending on if you want streaming answers or not.
It should look like this inside:

```
API_KEY=Yourkey
VITE_API_STREAMING=true
```
See optional environment variables in the `/.env-template` and `/application/.env_sample` files.
3. Run `./run-with-docker-compose.sh`.
See optional environment variables in the [/.env-template](https://github.com/arc53/DocsGPT/blob/main/.env-template) and [/application/.env_sample](https://github.com/arc53/DocsGPT/blob/main/application/.env_sample) files.
3. Run [./run-with-docker-compose.sh](https://github.com/arc53/DocsGPT/blob/main/run-with-docker-compose.sh).
4. Navigate to http://localhost:5173/.

To stop, just run `Ctrl + C`.

## Development environments

### Spin up mongo and redis
For development, only two containers are used from `docker-compose.yaml` (by deleting all services except for Redis and Mongo).
For development, only two containers are used from [docker-compose.yaml](https://github.com/arc53/DocsGPT/blob/main/docker-compose.yaml) (by deleting all services except for Redis and Mongo).
See file [docker-compose-dev.yaml](./docker-compose-dev.yaml).

Run
Expand All @@ -119,7 +119,7 @@ docker compose -f docker-compose-dev.yaml up -d
Make sure you have Python 3.10 or 3.11 installed.

1. Export required environment variables or prepare a `.env` file in the `/application` folder:
- Copy `.env_sample` and create `.env` with your OpenAI API token for the `API_KEY` and `EMBEDDINGS_KEY` fields.
- Copy [.env_sample](https://github.com/arc53/DocsGPT/blob/main/application/.env_sample) and create `.env` with your OpenAI API token for the `API_KEY` and `EMBEDDINGS_KEY` fields.

(check out [`application/core/settings.py`](application/core/settings.py) if you want to see more config options.)

Expand Down Expand Up @@ -148,7 +148,7 @@ pip install -r application/requirements.txt

Make sure you have Node version 16 or higher.

1. Navigate to the `/frontend` folder.
1. Navigate to the [/frontend](https://github.com/arc53/DocsGPT/tree/main/frontend) folder.
2. Install dependencies by running `npm install`.
3. Run the app using `npm run dev`.

Expand All @@ -166,6 +166,6 @@ We as members, contributors, and leaders, pledge to make participation in our co
</a>

## License
The source code license is MIT, as described in the LICENSE file.
The source code license is [MIT](https://opensource.org/license/mit/), as described in the [LICENSE](LICENSE) file.

Built with [🦜️🔗 LangChain](https://github.com/hwchase17/langchain)
8 changes: 4 additions & 4 deletions docs/pages/Deploying/Hosting-the-app.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ After that, it is time to pick your Instance Image. We recommend using "Linux/Un

As for instance plan, it'll vary depending on your unique demands, but a "1 GB, 1vCPU, 40GB SSD and 2TB transfer" setup should cover most scenarios.

Lastly, Identify your instance by giving it a unique name and then hit "Create instance".
Lastly, identify your instance by giving it a unique name and then hit "Create instance".

PS: Once you create your instance, it'll likely take a few minutes for the setup to be completed.

Expand All @@ -42,7 +42,7 @@ A terminal window will pop up, and the first step will be to clone the DocsGPT g

#### Download the package information

Once it has finished cloning the repository, it is time to download the package information from all sources. To do so simply enter the following command:
Once it has finished cloning the repository, it is time to download the package information from all sources. To do so, simply enter the following command:

`sudo apt update`

Expand All @@ -64,7 +64,7 @@ Enter the following command to access the folder in which DocsGPT docker-compose

#### Prepare the environment

Inside the DocsGPT folder create a `.env` file and copy the contents of `.env_sample` into it.
Inside the DocsGPT folder, create a `.env` file and copy the contents of `.env_sample` into it.

`nano .env`

Expand Down Expand Up @@ -95,7 +95,7 @@ You're almost there! Now that all the necessary bits and pieces have been instal

Launching it for the first time will take a few minutes to download all the necessary dependencies and build.

Once this is done you can go ahead and close the terminal window.
Once this is done, you can go ahead and close the terminal window.

#### Enabling ports

Expand Down
6 changes: 3 additions & 3 deletions docs/pages/Deploying/Quickstart.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
## Launching Web App
Note: Make sure you have Docker installed

On Mac OS or Linux just write:
On macOS or Linux, just write:

`./setup.sh`

Expand All @@ -10,11 +10,11 @@ It will install all the dependencies and give you an option to download the loca
Otherwise, refer to this Guide:

1. Open and download this repository with `git clone https://github.com/arc53/DocsGPT.git`.
2. Create a `.env` file in your root directory and set your `API_KEY` with your [OpenAI api key](https://platform.openai.com/account/api-keys).
2. Create a `.env` file in your root directory and set your `API_KEY` with your [OpenAI API key](https://platform.openai.com/account/api-keys).
3. Run `docker-compose build && docker-compose up`.
4. Navigate to `http://localhost:5173/`.

To stop just run `Ctrl + C`.
To stop, just run `Ctrl + C`.

### Chrome Extension

Expand Down
12 changes: 6 additions & 6 deletions docs/pages/Developing/API-docs.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ fetch("http://127.0.0.1:5000/api/answer", {
.then(console.log.bind(console))
```

In response you will get a json document like this one:
In response, you will get a JSON document like this one:

```json
{
Expand All @@ -30,7 +30,7 @@ In response you will get a json document like this one:

### /api/docs_check
It will make sure documentation is loaded on a server (just run it every time user is switching between libraries (documentations)).
It's a POST request that sends a JSON in body with 1 value. Here is a JavaScript fetch example:
It's a POST request that sends a JSON in a body with 1 value. Here is a JavaScript fetch example:

```js
// answer (POST http://127.0.0.1:5000/api/docs_check)
Expand All @@ -45,7 +45,7 @@ fetch("http://127.0.0.1:5000/api/docs_check", {
.then(console.log.bind(console))
```

In response you will get a json document like this one:
In response, you will get a JSON document like this one:
```json
{
"status": "exists"
Expand All @@ -54,17 +54,17 @@ In response you will get a json document like this one:


### /api/combine
Provides json that tells UI which vectors are available and where they are located with a simple get request.
Provides JSON that tells UI which vectors are available and where they are located with a simple get request.

Response will include:
`date`, `description`, `docLink`, `fullName`, `language`, `location` (local or docshub), `model`, `name`, `version`.

Example of json in Docshub and local:
Example of JSON in Docshub and local:
<img width="295" alt="image" src="https://user-images.githubusercontent.com/15183589/224714085-f09f51a4-7a9a-4efb-bd39-798029bb4273.png">


### /api/upload
Uploads file that needs to be trained, response is json with task id, which can be used to check on tasks progress
Uploads file that needs to be trained, response is JSON with task ID, which can be used to check on task's progress
HTML example:

```html
Expand Down
4 changes: 2 additions & 2 deletions docs/pages/Extensions/Chatwoot-extension.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ chatwoot_token=<from part 2>

5. Start with `flask run` command.

If you want for bot to stop responding to questions for a specific user or session just add label `human-requested` in your conversation.
If you want for bot to stop responding to questions for a specific user or session, just add a label `human-requested` in your conversation.


### Optional (extra validation)
Expand All @@ -26,4 +26,4 @@ account_id=(optional) 1
assignee_id=(optional) 1
```

Those are chatwoot values and will allow you to check if you are responding to correct widget and responding to questions assigned to specific user.
Those are chatwoot values and will allow you to check if you are responding to correct widget and responding to questions assigned to specific user.
10 changes: 5 additions & 5 deletions docs/pages/Extensions/react-widget.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
Got to your project and install a new dependency: `npm install docsgpt`.

### Usage
Go to your project and in the file where you want to use the widget import it:
Go to your project and in the file where you want to use the widget, import it:
```js
import { DocsGPTWidget } from "docsgpt";
import "docsgpt/dist/style.css";
Expand All @@ -14,12 +14,12 @@ import "docsgpt/dist/style.css";
Then you can use it like this: `<DocsGPTWidget />`

DocsGPTWidget takes 3 props:
- `apiHost`url of your DocsGPT API.
- `selectDocs` — documentation that you want to use for your widget (eg. `default` or `local/docs1.zip`).
- `apiKey` — usually its empty.
- `apiHost`URL of your DocsGPT API.
- `selectDocs` — documentation that you want to use for your widget (e.g. `default` or `local/docs1.zip`).
- `apiKey` — usually it's empty.

### How to use DocsGPTWidget with [Nextra](https://nextra.site/) (Next.js + MDX)
Install you widget as described above and then go to your `pages/` folder and create a new file `_app.js` with the following content:
Install your widget as described above and then go to your `pages/` folder and create a new file `_app.js` with the following content:
```js
import { DocsGPTWidget } from "docsgpt";
import "docsgpt/dist/style.css";
Expand Down
2 changes: 1 addition & 1 deletion docs/pages/Guides/Customising-prompts.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## To customize a main prompt navigate to `/application/prompt/combine_prompt.txt`
## To customize a main prompt, navigate to `/application/prompt/combine_prompt.txt`

You can try editing it to see how the model responses.

Loading

0 comments on commit a809e72

Please sign in to comment.