Skip to content

Commit

Permalink
Merge pull request #739 from 0xrahul6/docs/trains
Browse files Browse the repository at this point in the history
Enhancement: Updated Train other docs
  • Loading branch information
dartpain authored Oct 31, 2023
2 parents 8ee0fbe + fac8c9e commit e5aff13
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 18 deletions.
8 changes: 4 additions & 4 deletions docs/pages/Guides/Customising-prompts.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# Customizing the Main Prompt

To customize the main prompt for DocsGPT, follow these steps:
Customizing the main prompt for DocsGPT gives you the ability to tailor the AI's responses to your specific requirements. By modifying the prompt text, you can achieve more accurate and relevant answers. Here's how you can do it:

1. Navigate to `/application/prompts/combine_prompt.txt`.
**Step 1:** Navigate to `/application/prompts/combine_prompt.txt`.

2. Edit the `combine_prompt.txt` file to modify the prompt text. You can experiment with different phrasings and structures to see how the model responds.
**Step 2:** Open the combine_prompt.txt file and modify the prompt text to suit your needs. You can experiment with different phrasings and structures to observe how the model responds. The main prompt serves as guidance to the AI model on how to generate responses.

## Example Prompt Modification

Expand All @@ -19,7 +19,7 @@ When using code examples, use the following format:
{summaries}
```


Feel free to customize the prompt to align it with your specific use case or the kind of responses you want from the AI. For example, you can focus on specific document types, industries, or topics to get more targeted results.

## Conclusion

Expand Down
32 changes: 18 additions & 14 deletions docs/pages/Guides/How-to-train-on-other-documentation.md
Original file line number Diff line number Diff line change
@@ -1,43 +1,47 @@
## How to train on other documentation
This AI can use any documentation, but first it needs to be prepared for similarity search.

This AI can utilize any documentation, but it requires preparation for similarity search. Follow these steps to get your documentation ready:

**Step 1: Prepare Your Documentation**
![video-example-of-how-to-do-it](https://d3dg1063dc54p9.cloudfront.net/videos/how-to-vectorise.gif)

Start by going to `/scripts/` folder.

If you open this file, you will see that it uses RST files from the folder to create a `index.faiss` and `index.pkl`.

It currently uses OPEN_AI to create the vector store, so make sure your documentation is not too big. Pandas cost me around $3-$4.
It currently uses OPENAI to create the vector store, so make sure your documentation is not too large. Using Pandas cost me around $3-$4.

You can usually find documentation on Github in `docs/` folder for most open-source projects.
You can typically find documentation on GitHub in the `docs/` folder for most open-source projects.

### 1. Find documentation in .rst/.md and create a folder with it in your scripts directory
### 1. Find documentation in .rst/.md format and create a folder with it in your scripts directory.
- Name it `inputs/`.
- Put all your .rst/.md files in there.
- The search is recursive, so you don't need to flatten them.

If there are no .rst/.md files just convert whatever you find to .txt file and feed it. (don't forget to change the extension in script)
If there are no .rst/.md files, convert whatever you find to a .txt file and feed it. (Don't forget to change the extension in the script).

### 2. Create .env file in `scripts/` folder
And write your OpenAI API key inside
`OPENAI_API_KEY=<your-api-key>`.
### Step 2: Configure Your OpenAI API Key
1. Create a .env file in the scripts/ folder.
- Add your OpenAI API key inside: OPENAI_API_KEY=<your-api-key>.

### 3. Run scripts/ingest.py
### Step 3: Run the Ingestion Script

`python ingest.py ingest`

It will tell you how much it will cost.
It will provide you with the estimated cost.

### 4. Move `index.faiss` and `index.pkl` generated in `scripts/output` to `application/` folder.
### Step 4: Move `index.faiss` and `index.pkl` generated in `scripts/output` to `application/` folder.


### 5. Run web app
Once you run it will use new context that is relevant to your documentation.
Make sure you select default in the dropdown in the UI.
### Step 5: Run the Web App
Once you run it, it will use new context relevant to your documentation.Make sure you select default in the dropdown in the UI.

## Customization
You can learn more about options while running ingest.py by running:
- Make sure you select 'default' from the dropdown in the UI.

## Customization
You can learn more about options while running ingest.py by executing:
`python ingest.py --help`
| Options | |
|:--------------------------------:|:------------------------------------------------------------------------------------------------------------------------------:|
Expand Down

2 comments on commit e5aff13

@vercel
Copy link

@vercel vercel bot commented on e5aff13 Oct 31, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

docs-gpt – ./frontend

docs-gpt-git-main-arc53.vercel.app
docs-gpt-arc53.vercel.app
docs-gpt-brown.vercel.app

@vercel
Copy link

@vercel vercel bot commented on e5aff13 Oct 31, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

nextra-docsgpt – ./docs

nextra-docsgpt.vercel.app
docs.docsgpt.co.uk
nextra-docsgpt-arc53.vercel.app
nextra-docsgpt-git-main-arc53.vercel.app

Please sign in to comment.