chat plugin for mkdocs
Instalation
python3 -m pip install docs-chat-bot
Usage
Add chat plugin to your mkdocs.yml file.
example:
plugins:
- chat
docs_chat_endpoint: "http://localhost:7999/chat"
Before using the chatbot, there are three essential tasks to complete:
- Indexing the documents
- Running a document chatbot server
This guide will walk you through each step to ensure a seamless experience with the chatbot.
Indexing the documents
To enable the chatbot to access and retrieve information from your documents, they must be indexed first. Indexing the documents will create a searchable data structure that allows the chatbot to quickly locate relevant information when responding to user queries.
The indexing_docs command is used to index a collection of documents using the OpenAI Embedding Interface.
usage:
indexing_docs --dir [markdown document dir] --api-key [openai api key]
This command indexes the documents in the specified directory using the OpenAI Embedding Interface, with the following options:
--dir: Specifies the directory containing the markdown documents to be indexed.--api-key: Sets the API key used to authenticate with the OpenAI API.
Attention
Please be aware that this tool does not provide automatic document segmentation functionality. To ensure optimal usage with the ChatGPT API, it is crucial to follow the guidelines for document segmentation provided below.
Document Segmentation Guidelines
-
Manual segmentation: If a Markdown file is too large, you must manually split it into smaller segments. Ensure that each segment has a gap of 100 spaces.
-
Segment length: Each document segment should not exceed 2,000 words. Exceeding this limit may result in segments that are too large to fit within the constraints of the ChatGPT API.
How to Segment Documents
-
Open the large Markdown file in a text editor of your choice.
-
Identify a suitable point in the document to split it into smaller segments. This could be a natural break, such as a section or chapter boundary.
-
Separate the segments with 100 spaces, ensuring that each segment does not exceed the 3,000-word limit.
Running a document chatbot server
Once your documents are indexed, you will need to set up and run a document chatbot server. The server is responsible for processing user input, searching the indexed documents, and returning appropriate responses based on the information found within the documents.
docs_chat_bot_server --indexed-docs [indexed document] --api-key [openai API key]
This command launches the chatbot server with the following options:
--indexed-docs: Specifies the file containing indexed documents to be used by the chatbot server for retrieving information.--api-key: Sets the API key used to authenticate with external openai chatgpt services.
Metadata
Release files for docs-chat-bot 0.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| docs-chat-bot-0.0.1.tar.gz | 9.5 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| docs_chat_bot-0.0.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 26.4 kB
Release files / docs-chat-bot-0.0.1.tar.gz
| Download URL | docs-chat-bot-0.0.1.tar.gz |
|---|---|
| Size | 9.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d8bdf3339f623c393fc174f4f50a6c568ce05ad284bf2c77eb315ca1acaa4a79
|
|
BLAKE2b-256 checksum How to use checksums |
4088154e6b01ebebfcd28d73bd55c75c805158bdcc214261305ec0cce9452e79
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.21.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.5
|
Release files / docs_chat_bot-0.0.1-py3-none-any.whl
| Download URL | docs_chat_bot-0.0.1-py3-none-any.whl |
|---|---|
| Size | 16.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
42c98251846010b75442101c0cff4b59458ca9eddca974cef0a4e05f6daf39a9
|
|
BLAKE2b-256 checksum How to use checksums |
1f4a10e682797584e0462fe791bc0316ae64d5f6e378523ff43e9ad6279ba271
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.21.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.5
|
Security for docs-chat-bot 0.0.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.