doc improvement.

This commit is contained in:
Haiping Chen 2023-08-14 12:12:22 -05:00
parent 893acaa493
commit 62f8800652
17 changed files with 72 additions and 54 deletions

View file

@ -1,19 +1,9 @@
# Agent
# Agent Introduction
An agent helps you process user sentences (unstructure data) into structure data that you can use to return an appropriate response.
Agent is a collection that contains prompt words and function Json Schema definitions, few-shot examples and knowledge base data. You can create multiple different Agents to perform specific operations in specific domains. BotSharp has built-in maintenance for Agents, including creating, updating and deleting, importing and exporting.
## User Account
As a Bot construction framework, the most basic step is to integrate the user authentication function, so that the back-end API can recognize which user the current request comes from. In this way, a more complete business system can be further constructed. BotSharp can be combined with the user authentication function of ASP.NET MVC.
### Create a user account
Use the [Account Creation](https://www.postman.com/orange-flare-634868/workspace/botsharp/request/1346299-1b868c08-c6ac-48a5-94ab-93f6f080c085) API in BotSharp to create the first platform user.
![Alt text](assets/account-creation.png)
### Get access token
After the platform user is created, the user token can be obtained through the [Get Token](https://www.postman.com/orange-flare-634868/workspace/botsharp/request/1346299-5d70fec4-dfa0-4b74-a4fd-8cd21009d44f) API, and this token is required in all subsequent APIs.
![Alt text](assets/account-token.png)
## My Agent
After creating the platform account, you can start to enter the steps of creating the Agent.

3
docs/agent/state.md Normal file
View file

@ -0,0 +1,3 @@
# Conversation State
BotSharp has a built-in dialogue state management function, which automatically saves the input parameters of the function to the dialogue state by default, and is valid throughout the life cycle of the dialogue. If the parameter name is repeated, it will be overwritten.

View file

Before

Width:  |  Height:  |  Size: 94 KiB

After

Width:  |  Height:  |  Size: 94 KiB

View file

Before

Width:  |  Height:  |  Size: 117 KiB

After

Width:  |  Height:  |  Size: 117 KiB

View file

@ -0,0 +1,14 @@
# Authentication
## User Account
As a Bot construction framework, the most basic step is to integrate the user authentication function, so that the back-end API can recognize which user the current request comes from. In this way, a more complete business system can be further constructed. BotSharp can be combined with the user authentication function of ASP.NET MVC.
### Create a user account
Use the [Account Creation](https://www.postman.com/orange-flare-634868/workspace/botsharp/request/1346299-1b868c08-c6ac-48a5-94ab-93f6f080c085) API in BotSharp to create the first platform user.
![Alt text](assets/account-creation.png)
## Get access token
After the platform user is created, the user token can be obtained through the [Get Token](https://www.postman.com/orange-flare-634868/workspace/botsharp/request/1346299-5d70fec4-dfa0-4b74-a4fd-8cd21009d44f) API, and this token is required in all subsequent APIs.
![Alt text](assets/account-token.png)

View file

@ -0,0 +1 @@
# Hooks

View file

@ -0,0 +1 @@
# Plug-in

3
docs/channels/intro.md Normal file
View file

@ -0,0 +1,3 @@
# Channel Introduction
When you already trained a chatbot on Botsharp, you may want it to play a really role in life. So we intergrate some popular channels in Botsharp including Twilio, facebook messenger, Telegram, WeChat and some other RPAs. These channels can make your robot "real" in life. For example, on facebook when a user visit your page and sends you a message, they can talk to your agent. You can also set a virtral assistant based on Twilio to chat with your clients for ordering, consulting, problem solving and many other business processes.

View file

@ -1,4 +1,4 @@
Facebook Messenger
Messenger
==================
The BotSharp Facebook integration allows you to easily create a Facebook Messenger bot with natural language understanding, based on the BotSharp technology.

1
docs/channels/wechat.md Normal file
View file

@ -0,0 +1 @@
# WeChat

View file

@ -24,17 +24,6 @@ BotSharp is strictly in accordance with the components principle and decouples e
.. image:: static/logos/BotSharp.png
:height: 64px
Some Features
-------------
* Built-in multi-Agents management, easy to build Bot as a Service platform.
* Integrate with multiple LLMs like ChatGPT and LLaMA.
* Using plug-in design, it is easy to expand functions.
* Working with multiple Vector Stores for senmatic search.
* Supporting different UI providers like `Chatbot UI`_ and `HuggingChat UI`_.
* Integrated with popular social platforms like Facebook Messenger, Slack and Telegram.
* Providing REST APIs to work with your own UI.
Indices and tables
==================
The main documentation for the site is organized into the following sections:
@ -59,16 +48,19 @@ The main documentation for the site is organized into the following sections:
:maxdepth: 3
:caption: Agent & Conversation
agent/account
agent/intro
agent/conversation
agent/state
.. _integration-docs:
.. toctree::
:maxdepth: 3
:caption: Channels Integration
:caption: Interactive Channels
integrations/facebook-messenger
channels/intro
channels/messenger
channels/wechat
.. _knowledge-base:
@ -79,6 +71,15 @@ The main documentation for the site is organized into the following sections:
knowledge-base/text-embedding
knowledge-base/vector-database
knowledge-base/similarity-search
knowledge-base/build-qa-bot
.. _prompting:
.. toctree::
:maxdepth: 3
:caption: Prompt Engineering
prompt/intro
.. _architecture-docs:
@ -86,10 +87,11 @@ The main documentation for the site is organized into the following sections:
:maxdepth: 3
:caption: Architecture:
architecture/data_storage
architecture/authentication
architecture/plugin
architecture/hooks
architecture/data-persistence
If you feel that this project is helpful to you, please Star us on the project, we will be very grateful.
.. _Chatbot UI: https://github.com/mckaywrigley/chatbot-ui
.. _HuggingChat UI: https://github.com/huggingface/chat-ui
.. _discord: https://discord.gg/qRVm82fKTS

View file

@ -0,0 +1,14 @@
# Build Q&A Bot
## Feed knowledge
Use the feed knowledge interface to feed knowledge into the database. Before that, you need to create an Agent to manage the Chatbot, and the Agent's `id` is needed in subsequent operations.
`http://localhost:5500/knowledge/{agentId}`, You can add `startPageNum` and `endPageNum` to select useful parts of the document.
![Alt text](assets/feed_knowledge_pdf.png)
## Retrieve knowledge
After you have finished inputting knowledge, you can start asking related questions with your AI Assistant.
![Alt text](assets/feed_knowledge_answer.png)

View file

@ -2,16 +2,3 @@
After we have learned the concepts of `Text Embedding` and `Vector Database`, we can start to use BotSharp to actually build an LLM-based knowledge base question system.
Below we will walk through how to use an existing PDF document to make a Q&A chatbot.
## Feed knowledge
Use the feed knowledge interface to feed knowledge into the database. Before that, you need to create an Agent to manage the Chatbot, and the Agent's `id` is needed in subsequent operations.
`http://localhost:5500/knowledge/{agentId}`, You can add `startPageNum` and `endPageNum` to select useful parts of the document.
![Alt text](assets/feed_knowledge_pdf.png)
## Retrieve knowledge
After you have finished inputting knowledge, you can start asking related questions with your AI Assistant.
![Alt text](assets/feed_knowledge_answer.png)

1
docs/prompt/intro.md Normal file
View file

@ -0,0 +1 @@
# Prompt Engineering

View file

@ -1,4 +1,4 @@
# Quick Start
# Installation
BotSharp strictly follows the modular design principle and adopts a structure in which views and logic are separated. It also provides a complete Web API interface to integrate with your own system. At the architectural level, Hook and EvenT are designed for different purposes, which can expand Chatbot's dialogue capabilities without changing the kernel.

View file

@ -1,5 +1,4 @@
# Overview
*Haiping Chen --06/18/2023*
BotSharp is an open source machine learning framework for AI Bot platform builder. This project involves natural language understanding and audio processing technologies, and aims to promote the development and application of intelligent robot assistants in information systems. Out of the box machine learning algorithms allow ordinary programmers to develop artificial intelligence applications faster and easier.
@ -24,11 +23,13 @@ Your code would have to handle all these different types of requests ro carry ou
However, BotSharp lets you easily achieve a conversational user experience by handling the natural language understanding (NLU) for you.When you use BotSharp, you can create agents that can understand the meaning of natural language and the nuances and trainslate that to structured meaning your software can understand.
## Agent
An agent helps you process user sentences (unstructure data) into structure data that you can use to return an appropriate response.
Features
-------------
When users say something, your agent matches the user utterance to an exactly matched intent or closely matched intent. Besides, the agent will return extra information about named entities which you need from the utterance. This can be name, location date or a host of other data categories (entities). You can define both the intent and the entities in your training data sets. You can also define what else to extact in your training phares as well.Then you can send a response to user to continue the conversation or to just end the conversation. It is very simple to create your own agent in BotSharp. The only thing you need is to assign you agent a name and a brief discription.
## Channels
When you already trained a chatbot on Botsharp, you may want it to play a really role in life. So we intergrate some popular channels in Botsharp including Twilio, facebook messenger, Telegram, WeChat and some other RPAs. These channels can make your robot "real" in life. For example, on facebook when a user visit your page and sends you a message, they can talk to your agent. You can also set a virtral assistant based on Twilio to chat with your clients for ordering, consulting, problem solving and many other business processes.
* Built-in multi-Agents management, easy to build Bot as a Service platform.
* Integrate with multiple LLMs like ChatGPT and LLaMA.
* Using plug-in design, it is easy to expand functions.
* Working with multiple Vector Stores for senmatic search.
* Supporting different UI providers like [Chatbot UI](https://github.com/mckaywrigley/chatbot-ui) and [HuggingChat UI](https://github.com/huggingface/chat-ui).
* Integrated with popular social platforms like Facebook Messenger, Slack and Telegram.
* Providing REST APIs to work with your own UI.