This commit is contained in:
Rodrigo Rodriguez 2024-09-12 16:14:48 -03:00
parent 1b5eddf6ec
commit 31a1704db4
2 changed files with 109 additions and 19 deletions

View file

@ -7,6 +7,29 @@ sidebar_position: 50
![generalbots-2018](https://user-images.githubusercontent.com/65977273/94922431-949c3900-0490-11eb-800a-6b478d689f2a.png) ![generalbots-2018](https://user-images.githubusercontent.com/65977273/94922431-949c3900-0490-11eb-800a-6b478d689f2a.png)
General Bots BASIC using HEAR and TALK keywords provides a easy to write bot language accessible to everyone and used as incomer for people willing to make their own bot. General Bots BASIC using HEAR and TALK keywords provides a easy to write bot language accessible to everyone and used as incomer for people willing to make their own bot.
It's crucial to emphasize just how easy and powerful the General Bots system is:
1. Rapid Development: With just a few lines of BASIC-like code, you can
create complex, AI-powered applications.
2. Automatic REST API: General Bots automatically generates REST API
endpoints for your dialogs, saving you significant development time.
3. Production-Ready: Simply by adding a BASIC text file, you get a General
Bots application running in production. No complex deployment processes
required.
4. Versatility: Whether you're building chatbots, process automation, or
data collection systems, General Bots can handle it all with the same
simple syntax.
5. Integration of LLMs: Seamlessly incorporate the power of Large Language
Models into your applications without dealing with complex AI frameworks.
General Bots truly revolutionizes the way we build AI-powered applications
and REST APIs. Its simplicity belies its power, making it accessible to
developers of all skill levels while providing the capabilities needed for
enterprise-grade applications.
## Architecture ## Architecture
@ -329,6 +352,75 @@ LOOP
EXIT EXIT
``` ```
## TURN AN LLM INTO A REST API SERVER
General Bots offers an incredibly simple way to transform a Large Language
Model (LLM) into a fully functional REST API server. With just a few lines
of our proprietary BASIC-like syntax, you can create sophisticated
AI-powered applications.
For example, here's how easy it is to create a chatbot for a store:
```basic
PARAM operator AS number LIKE 12312312
DESCRIPTION "Operator code."
DESCRIPTION It is a WebService of GB.
products = FIND "products.csv"
BEGIN SYSTEM PROMPT
You must act as a chatbot that will assist a store attendant by
following these rules: Whenever the attendant places an order, it must
include the table and the customer's name. Example: A 400ml Pineapple
Caipirinha for Rafael at table 10. Orders are based on the products and
sides from this product menu: ${JSON.stringify(products)}.
For each order placed, return a JSON containing the product name, the
table, and a list of sides with their respective ids.
END SYSTEM PROMPT
```
That's it! With just this simple BASIC code, you've created a fully
functional LLM-powered chatbot that can handle complex order processing.
The system automatically generates the necessary REST API endpoints:
http://localhost:1111/llm-server/dialogs/start?operator=123
http://localhost:1111/llm-server/dk/talk?pid=4893749837&text=add%20soda
## USING DIALOGS AS REST API SERVER
Creating a REST API server for any business process is equally
straightforward. Here's an example of an enrollment process:
```basic
PARAM name AS string LIKE "João Silva"
DESCRIPTION "Required full name of the individual."
PARAM birthday AS date LIKE "23/09/2001"
DESCRIPTION "Required birth date of the individual in DD/MM/YYYY format."
PARAM email AS string LIKE "joao.silva@example.com"
DESCRIPTION "Required email address for contact purposes."
PARAM personalid AS integer LIKE "12345678900"
DESCRIPTION "Required Personal ID number of the individual (only numbers)."
PARAM address AS string LIKE "Rua das Flores, 123, São Paulo, SP"
DESCRIPTION "Required full address of the individual."
DESCRIPTION
"This is the enrollment process, called when the user wants to enroll.
Once all information is collected, confirm the details and inform them
that their enrollment request has been successfully submitted. Provide
a polite and professional tone throughout the interaction."
SAVE "enrollments.csv", id, name, birthday, email, cpf, rg, address
```
Incredibly, this is all you need to create a full-fledged enrollment system
with data validation, user interaction, and data storage. The system
automatically generates a REST API endpoint:
http://api.pragmatismo.cloud/llm-server/dialogs/enrollment?birthday...
### Using POST data ### Using POST data
You can use POST passing a variable as the second param in the POST call. The example You can use POST passing a variable as the second param in the POST call. The example

View file

@ -22,35 +22,36 @@ here is a list of admin commands related to deploying .gb\* files.
| Name | Description | | Name | Description |
| --------------------------- | ---------------------------------------------------------------------------------------------------------------------- | | --------------------------- | ---------------------------------------------------------------------------------------------------------------------- |
| .gbapp List | List of associated .gbapp packages to this .gbot. |
| Admin Notify E-mail | E-mail used to notify administrators. | | Admin Notify E-mail | E-mail used to notify administrators. |
| Answer Mode | How LLM is used. Can be "direct", "document", "document-ref", "sql", "chart" or "tool". | | Answer Mode | How LLM is used. Can be "direct", "document", "document-ref", "sql", "chart" or "tool". |
| Avatar Logo | Bot logo URL. | | Avatar Logo | Bot logo URL. |
| Bot Admin Number | Administration mobile number which will receive Debug screenshots and other notifications. |
| Can Publish | Comma separeted list of mobile numbers that can publish directly. | | Can Publish | Comma separeted list of mobile numbers that can publish directly. |
| Debug Web Automation | TRUE if Bot Admin Number will receive an screenshot to each web automation step. |
| Default Content Language | Language (eg.: en or pt) that content files in .gbkb, .gbdialog and so on are written. |
| Default User Language | Language (eg.: en or pt) that user will be presented by the Bot. |
| Description | Description of the Bot. | | Description | Description of the Bot. |
| Enable Audio Hearing | TRUE if the Bot can hear. | | Enable Audio Hearing | TRUE if the Bot can hear. |
| Enable Audio Talking | TRUE if the Bot can talk. | | Enable Audio Talking | TRUE if the Bot can talk. |
| Enable Spelling Checker | TRUE if everything input by user should be spell checked. | | Enable Spelling Checker | TRUE if everything input by user should be spell checked. |
| Enable Worldwide Translator | TRUE if the Bot should be polyglot. | | Enable Worldwide Translator | TRUE if the Bot should be polyglot. |
| Default User Language | Language (eg.: en or pt) that user will be presented by the Bot. | | Feedback Improve.Message | Message to user when the Bot was unable to find something. |
| Default Content Language | Language (eg.: en or pt) that content files in .gbkb, .gbdialog and so on are written. | | Group Spell | Enable spell checker for groups. |
| HelloGoodX | TRUE if Bot should give hello. |
| Keep Text | Comma separeted list of words that should be keep intact between Bot understanding process. |
| Language Detector | TRUE if Bot should get the language automatically. | | Language Detector | TRUE if Bot should get the language automatically. |
| NLP Score | Number between 0 and 1 that will be used to classify text to use NLP neural network. | | NLP Score | Number between 0 and 1 that will be used to classify text to use NLP neural network. |
| Search Score | Number between 0 and 1 that will be used to consider Full Text Search as content retrieval method. | | Search Score | Number between 0 and 1 that will be used to consider Full Text Search as content retrieval method. |
| SSR | Generate an HTML for the default.gbui useful for search engines. |
| Start Dialog | Name of .docx (without the Extension) that will be used as Dialog entry point. |
| Synchronize Database | TRUE if TABLE keyword should _MODIFY_ database. Be careful in Production storage this value should be FALSE (default). |
| Transfer To | Comma separeted list of mobile numbers that Bot will use to tranfer chats from WhatsApp. | | Transfer To | Comma separeted list of mobile numbers that Bot will use to tranfer chats from WhatsApp. |
| WhatsApp Admins | Comma separeted list of mobile numbers that will be admin. | | WhatsApp Admins | Comma separeted list of mobile numbers that will be admin. |
| Feedback Improve.Message | Message to user when the Bot was unable to find something. | | WhatsApp Group ID | Group ID (accessible only in internal log) used to connect the Bot to a WhatsApp group. |
| Keep Text | Comma separeted list of words that should be keep intact between Bot understanding process. |
| Start Dialog | Name of .docx (without the Extension) that will be used as Dialog entry point. |
| HelloGoodX | TRUE if Bot should give hello. |
| XRM Key | String key of HubSpot (currently) API. |
| WhatsApp Group Name | WhatsApp group name that this Bot belongs to. | | WhatsApp Group Name | WhatsApp group name that this Bot belongs to. |
| WhatsApp Group Shortcuts | Space separeted list of triggers in text that will active Bot in groups. | | WhatsApp Group Shortcuts | Space separeted list of triggers in text that will active Bot in groups. |
| Bot Admin Number | Administration mobile number which will receive Debug screenshots and other notifications. | | XRM Key | String key of HubSpot (currently) API. |
| WhatsApp Group ID | Group ID (accessible only in internal log) used to connect the Bot to a WhatsApp group. |
| Debug Web Automation | TRUE if Bot Admin Number will receive an screenshot to each web automation step. |
| .gbapp List | List of associated .gbapp packages to this .gbot. |
| Group Spell | Enable spell checker for groups. |
| Synchronize Database | TRUE if TABLE keyword should _MODIFY_ database. Be careful in Production storage this value should be FALSE (default). |
Note that this variables are available in every .gbdialog code, automatically. Note that this variables are available in every .gbdialog code, automatically.
@ -182,7 +183,7 @@ Each title and description has been crafted to clarify the purpose and functiona
## Enviroment Variables Reference ## Enviroment Variables Reference
| Name | Sample Value | Description | | Name | Sample Value | Description |
| ---------------------- | ------------------------------------------------ | ------------------------------------------------------------------------ | | ---------------------- | ------------------------------------------------ | ------------------------------------------------------------------------ | ------------------------------------------------------------------------------------- |
| ADDITIONAL_DEPLOY_PATH | D:\data\gbai | Deploy folder to look for packages (Just one folder). | | ADDITIONAL_DEPLOY_PATH | D:\data\gbai | Deploy folder to look for packages (Just one folder). |
| ADMIN_PASS | E732+!#xJ3a\_\*! | Administration password for the conversational interface. | | ADMIN_PASS | E732+!#xJ3a\_\*! | Administration password for the conversational interface. |
| CLOUD_SUBSCRIPTIONID | 622e5037-f7f1-49f6-a9c4-28babbb0fs | Cloud subscription ID used to deploy new bots. | | CLOUD_SUBSCRIPTIONID | 622e5037-f7f1-49f6-a9c4-28babbb0fs | Cloud subscription ID used to deploy new bots. |
@ -202,7 +203,7 @@ Each title and description has been crafted to clarify the purpose and functiona
| TEST_MESSAGE | /publish | If the bot server should auto send a message for test. | | TEST_MESSAGE | /publish | If the bot server should auto send a message for test. |
| TEST_SHELL | rm work/.. | If the user needs to continuously remove an archive. | | TEST_SHELL | rm work/.. | If the user needs to continuously remove an archive. |
| GBDIALOG_GBDATABOT | Shared.gbai/Shared.gbdata | If defined, BotServer will use this .gbdata instead of default location. | | GBDIALOG_GBDATABOT | Shared.gbai/Shared.gbdata | If defined, BotServer will use this .gbdata instead of default location. |
ADMIN_OPEN_PUBLISH| | If defined, BotServer will open the publish dialog on startup not requiring password. | | ADMIN_OPEN_PUBLISH | | true | If defined, BotServer will open the publish dialog on startup not requiring password. |
## How to ## How to
@ -265,15 +266,12 @@ https://graph.facebook.com/v18.0/99999792462862/whatsapp_business_profile
9. /setupSecurity to get access to Bot Drive (Clean: https://www.domstamand.com/removing-user-consent-from-an-azure-ad-application/); 9. /setupSecurity to get access to Bot Drive (Clean: https://www.domstamand.com/removing-user-consent-from-an-azure-ad-application/);
10. /publish to publish packages on root bot. 10. /publish to publish packages on root bot.
## Opening 443 Port in Linux ## Opening 443 Port in Linux
``` ```
setcap 'cap_net_bind_service=+ep' $(readlink -f $(which node)) setcap 'cap_net_bind_service=+ep' $(readlink -f $(which node))
``` ```
## Common Errors on Azure ## Common Errors on Azure
- The subscription is not registered to use namespace 'Microsoft.Web'. See https://aka.ms/rps-not-found for how to register subscriptions. - The subscription is not registered to use namespace 'Microsoft.Web'. See https://aka.ms/rps-not-found for how to register subscriptions.