Compare commits
10 commits
b53aeb38c7
...
760dc2bfd7
Author | SHA1 | Date | |
---|---|---|---|
![]() |
760dc2bfd7 | ||
![]() |
ce0ed49700 | ||
![]() |
0cfc297068 | ||
![]() |
befc237dd4 | ||
![]() |
f22e24349f | ||
![]() |
31a1704db4 | ||
![]() |
1b5eddf6ec | ||
![]() |
ce2aa1e89c | ||
![]() |
07efbabfa3 | ||
![]() |
7616ab9718 |
5 changed files with 306 additions and 103 deletions
33
site/.forgejo/workflows/node.yaml
Normal file
33
site/.forgejo/workflows/node.yaml
Normal file
|
@ -0,0 +1,33 @@
|
|||
name: GBCI
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ "main" ]
|
||||
pull_request:
|
||||
branches: [ "main" ]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: gbo
|
||||
|
||||
steps:
|
||||
- name: Disable SSL verification (temporary)
|
||||
run: git config --global http.sslVerify false
|
||||
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Setup Node.js
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: '20'
|
||||
cache: 'npm'
|
||||
|
||||
- name: Install dependencies and build
|
||||
run: |
|
||||
pnpm i
|
||||
pnpm run build
|
||||
|
||||
- name: Deploy to production
|
||||
run: |
|
||||
sudo rm -rf /opt/gbo/websites/docs.pragmatismo.com.br/*
|
||||
sudo cp -r ./out/. /opt/gbo/websites/docs.pragmatismo.com.br/
|
|
@ -7,6 +7,29 @@ sidebar_position: 50
|
|||

|
||||
|
||||
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
|
||||
|
@ -62,6 +85,7 @@ To organize the instructions functionally, I'll group them into five categories:
|
|||
| ----------------------------------------------- | ------------------------------------------------------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| HEAR _variable_ | Hears something from the person into a _variable_ for later use. | <pre>HEAR name <br/>TALK "Your name is " + name.<br/></pre> |
|
||||
| TALK _message_ | Talk the specified _message_ to the person. | <pre>TALK "Hello world."</pre> |
|
||||
| CHART PROMPT _data_, _prompt_ | Generates dynamic charts using natural language | <pre>file = CHART PROMPT data, "product by month in bar chart <br/> SEND FILE TO mobile, file</pre> |
|
||||
| WAIT _seconds_ | Wait a number of seconds before continuing the conversation. | <pre>WAIT 10 <br/> TALK "Waited for 10 seconds."</pre> |
|
||||
| confirm _variable_ (Comming soon) | Waits for confirmation like 'yes', 'y', 'yeah' and returns true or false | <pre>HEAR confirm <br/>TALK "Please confirm if you want to proceed." <br/> if confirm THEN TALK "Confirmed." ELSE TALK "Not confirmed."</pre> |
|
||||
| HEAR _variable_ AS EMAIL | Hears and validates an email address from the user. | <pre>HEAR email AS EMAIL <br/> TALK "Email received: " + email.</pre> |
|
||||
|
@ -76,6 +100,7 @@ To organize the instructions functionally, I'll group them into five categories:
|
|||
| HEAR _variable_ AS "Abacate", "Maçã", "Morango" | Displays the specified menu and waits for user selection. | <pre>HEAR fruit AS "Abacate", "Maçã", "Morango" <br/> TALK "You selected: " + fruit.</pre> |
|
||||
| HEAR _variable_ AS LANGUAGE | Hears and validates a language code from the user. | <pre>HEAR language AS LANGUAGE <br/> TALK "Language selected: " + language.</pre> |
|
||||
| HEAR _variable_ AS LOGIN (internal) | Waits for Active Directory login integration before proceeding. | <pre>HEAR user AS LOGIN <br/> TALK "User logged in: " + user.</pre> |
|
||||
| HEAR _variable_ AS QRCODE | Hears and validates a QR code from a captured image. | <pre>TALK "Send me an image with a QR Code."<br/>HEAR qrcode AS QRCODE <br/> TALK "QR Code received: " + qrcode.</pre> |
|
||||
|
||||
## Data Handling
|
||||
|
||||
|
@ -88,6 +113,7 @@ To organize the instructions functionally, I'll group them into five categories:
|
|||
| data = SELECT a, SUM(b) AS b FROM data GROUP BY a | Use SQL to manipulate a data variable returned from FIND or an array | <pre>data = FIND "sales_data.xlsx", "A1:B10" <br/> result = SELECT product, SUM(amount) AS total FROM data GROUP BY product <br/> TALK "Query result: " + result.</pre> |
|
||||
| file = data AS IMAGE | Converts a two-dimensional array into an image file. | <pre>file = data AS IMAGE <br/> SAVE file AS "sales_chart.png" <br/> TALK "Chart saved as image."</pre> |
|
||||
| file = data AS PDF | Converts a two-dimensional array into a PDF file. | <pre>file = data AS PDF <br/> SAVE file AS "sales_report.pdf" <br/> TALK "Report saved as PDF."</pre> |
|
||||
| file = CONVERT "mydesign.ai" | Converts a Adobe Illustrator to a HTML page. |
|
||||
| NEW OBJECT | Creates a new object to be used with REST calls. | <pre>data = NEW OBJECT <br/> data.color = "blue" <br/> TALK "New object created."</pre> |
|
||||
| NEW ARRAY | Creates a new array. | <pre>data = NEW ARRAY <br/> data[0] = "red" <br/> TALK "New array created."</pre> |
|
||||
| QRCODE | Creates a QR code from specified text. | <pre>file = QRCODE "https://example.com" <br/> SAVE file AS "qrcode.png" <br/> TALK "QR Code generated."</pre> |
|
||||
|
@ -328,6 +354,87 @@ LOOP
|
|||
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:
|
||||
|
||||
```
|
||||
pid = http://localhost:1111/llm-server/dialogs/start?operator=123&userSystemId=999
|
||||
|
||||
```
|
||||
|
||||
This call will return a process identifier or PID, a number like 24795078551392. This should be passed within call chain. So, it is
|
||||
possible now to TALK to the bot, like an UI App input or microphone.
|
||||
And the return will be the JSON, because BEGIN SYSTEM PROMPT in start
|
||||
has told LLM to respond with a valid JSON.
|
||||
TALK "PDF report generated and saved!"
|
||||
|
||||
```
|
||||
http://localhost:1111/llm-server/dk/talk?pid=4893749837&text=add%20soda
|
||||
|
||||
```
|
||||
|
||||
So this call will act like talking to LLM, but in fact, it can be used
|
||||
to anything that General Bots can do in a robotic conversation between systems mediated by LLM.
|
||||
|
||||
## 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 that is called by LLM as a tool.
|
||||
So LLM can answer with data of external model train data.
|
||||
|
||||
```
|
||||
http://api.pragmatismo.cloud/llm-server/dialogs/enrollment?birthday...
|
||||
|
||||
```
|
||||
|
||||
### Using POST data
|
||||
|
||||
You can use POST passing a variable as the second param in the POST call. The example
|
||||
|
|
|
@ -94,33 +94,33 @@ apt install code
|
|||
|
||||
```
|
||||
|
||||
#### Node JS 20
|
||||
#### Node JS 22
|
||||
```
|
||||
|
||||
curl -fsSL https://deb.nodesource.com/setup_20.x | -E bash -
|
||||
apt-get install -y nodejs
|
||||
node -v
|
||||
apt install npm
|
||||
npm -v
|
||||
curl -fsSL https://deb.nodesource.com/setup_22.x -o nodesource_setup.sh && sudo -E bash nodesource_setup.sh && sudo apt-get install -y nodejs && node -v
|
||||
|
||||
```
|
||||
|
||||
#### Additional Infrastructure
|
||||
|
||||
|
||||
|
||||
```
|
||||
|
||||
apt-get update
|
||||
|
||||
apt-get install build-essential cmake git pkg-config libjpeg-dev libtiff-dev libpng-dev libavcodec-dev libavformat-dev libswscale-dev libv4l-dev libatlas-base-dev gfortran python3-dev
|
||||
|
||||
export OPENCV4NODEJS_DISABLE_AUTOBUILD=1
|
||||
export OPENCV_LIB_DIR=/usr/lib/x86_64-linux-gnu
|
||||
|
||||
apt-get install cpulimit
|
||||
sudo apt-get install expect
|
||||
apt-get install expect
|
||||
apt-get install libxtst-dev
|
||||
apt-get install libpng-dev
|
||||
apt-get install python g++ build-essential
|
||||
npm install -g node-gyp
|
||||
```
|
||||
|
||||
Opening 443 Port in Linux
|
||||
|
||||
```
|
||||
setcap 'cap_net_bind_service=+ep' $(readlink -f $(which node))
|
||||
```
|
||||
|
||||
|
||||
Add export GTK_IM_MODULE="xim" to .profile to fix Key Bindings in VSCode on Ubuntu.
|
||||
|
||||
|
@ -140,21 +140,8 @@ npm install -g cost-of-modules
|
|||
```
|
||||
|
||||
|
||||
## Fork concept
|
||||
|
||||
Is the implementation of new software based on existing software. The branch takes advantage of the data already used in other software to generate a new one.
|
||||
This in some way contributes to a better understanding of how it works.
|
||||
|
||||
## How To...
|
||||
|
||||
### Create a new keyword
|
||||
|
||||
- 10min. Find the package on npmjs.com;
|
||||
- 2min. Perform keywords list update;
|
||||
- (Optional) 10min. Create a new facade of keywords (Create service file, add reference to package/index.ts, and make a call);
|
||||
- 20min. Keyword code call and infrastructure to support it.
|
||||
|
||||
|
||||
## Commit code
|
||||
|
||||
# Semantic Versioning for gbapp Development
|
||||
|
@ -206,6 +193,14 @@ Remember, the goal of SemVer is to help manage dependencies and provide clear co
|
|||
For the complete specification and any updates, always refer to semver.org.
|
||||
|
||||
|
||||
### Create a new keyword
|
||||
|
||||
- 10min. Find the package on npmjs.com;
|
||||
- 2min. Perform keywords list update;
|
||||
- (Optional) 10min. Create a new facade of keywords (Create service file, add reference to package/index.ts, and make a call);
|
||||
- 20min. Keyword code call and infrastructure to support it.
|
||||
|
||||
|
||||
## Tooling
|
||||
|
||||
### JavaScript
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
--
|
||||
sidebar_position: 70
|
||||
|
||||
---
|
||||
|
||||
# .gbot Reference
|
||||
|
@ -9,53 +10,58 @@ sidebar_position: 70
|
|||
## Commands
|
||||
|
||||
General Bot can be controlled by the same chat window people talk to, so
|
||||
here is a list of admin commands related to deploying .gb* files.
|
||||
here is a list of admin commands related to deploying .gb\* files.
|
||||
|
||||
| Command | Description |
|
||||
|-----------------|-----------------------------------------------------------------------------------------------------------------|
|
||||
| /edit | Sends a link to the Bot Storage so package folders like .gbdialog, .gbkb, .gbot and others can be edited. |
|
||||
| /setupSecurity [tokenName] | Setup connection between General Bots and the Cloud, so the bot drive can be accessed by BotServer during publishing and direct access like the FIND keyword. Or using tokenName, setups a connection defined in Config.xlsx.|
|
||||
| /publish [extension] | Deploy the package to the bot storage. When ommited, the command will publish the package named (botId).gbkb by default. |
|
||||
| Command | Description |
|
||||
| -------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| /edit | Sends a link to the Bot Storage so package folders like .gbdialog, .gbkb, .gbot and others can be edited. |
|
||||
| /setupSecurity [tokenName] | Setup connection between General Bots and the Cloud, so the bot drive can be accessed by BotServer during publishing and direct access like the FIND keyword. Or using tokenName, setups a connection defined in Config.xlsx. |
|
||||
| /publish [extension] | Deploy the package to the bot storage. When ommited, the command will publish the package named (botId).gbkb by default. |
|
||||
|
||||
# Config.xlsx (.gbot) Configuration
|
||||
|
||||
| Name | Description|
|
||||
| --------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| Admin Notify E-mail | E-mail used to notify administrators. |
|
||||
| Answer Mode | How LLM is used. Can be "direct", "document", "document-ref", "sql", "tool". |
|
||||
| Avatar Logo | Bot logo URL. |
|
||||
| Can Publish | Comma separeted list of mobile numbers that can publish directly. |
|
||||
| Description | Description of the Bot. |
|
||||
| Enable Audio Hearing | TRUE if the Bot can hear. |
|
||||
| Enable Audio Talking | TRUE if the Bot can talk. |
|
||||
| Enable Spelling Checker | TRUE if everything input by user should be spell checked. |
|
||||
| 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. |
|
||||
| Default Content Language | Language (eg.: en or pt) that content files in .gbkb, .gbdialog and so on are written. |
|
||||
| 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. |
|
||||
| Search Score | Number between 0 and 1 that will be used to consider Full Text Search as content retrieval method. |
|
||||
| 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. |
|
||||
| Feedback Improve.Message | Message to user when the Bot was unable to find something. |
|
||||
| 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 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.|
|
||||
| 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). |
|
||||
|
||||
| Name | Description |
|
||||
| --------------------------- | ---------------------------------------------------------------------------------------------------------------------- |
|
||||
| .gbapp List | List of associated .gbapp packages to this .gbot. |
|
||||
| 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". |
|
||||
| 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. |
|
||||
| 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. |
|
||||
| Enable Audio Hearing | TRUE if the Bot can hear. |
|
||||
| Enable Audio Talking | TRUE if the Bot can talk. |
|
||||
| Enable Spelling Checker | TRUE if everything input by user should be spell checked. |
|
||||
| Enable Worldwide Translator | TRUE if the Bot should be polyglot. |
|
||||
| Feedback Improve.Message | Message to user when the Bot was unable to find something. |
|
||||
| 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. |
|
||||
| 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. |
|
||||
| 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. |
|
||||
| WhatsApp Admins | Comma separeted list of mobile numbers that will be admin. |
|
||||
| WhatsApp Group ID | Group ID (accessible only in internal log) used to connect the Bot to a WhatsApp group. |
|
||||
| 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. |
|
||||
| Website | URL of website to use as bot knowledge base. Note: Answer Mode should be 'document' while using crawler. |
|
||||
| Website Depth | Maximum website hyperlinks depth when crawling page contents. |
|
||||
| Website Max Documents | Maximum website document count to be added to LLM embeddings. |
|
||||
| XRM Key | String key of HubSpot (currently) API. |
|
||||
|
||||
Note that this variables are available in every .gbdialog code, automatically.
|
||||
|
||||
## Config in Detail
|
||||
|
||||
### Admin Notify E-mail
|
||||
|
||||
The "Admin Notify E-mail" setting specifies the email addresses that will receive notifications regarding the bot’s activities and administrative updates. This feature ensures that administrators are promptly informed about any critical events or issues related to the bot's operation, allowing them to take necessary actions swiftly.
|
||||
|
||||
### Answer Mode
|
||||
|
@ -63,122 +69,174 @@ The "Admin Notify E-mail" setting specifies the email addresses that will receiv
|
|||
In a bot factory configuration, the integration of a Language Learning Model (LLM) is pivotal in enhancing the functionality and efficiency of the bots. The LLM can be employed in various modes depending on the requirements of the bot system. These modes include "direct," "document," "document-ref," "sql," and "tool," each offering a unique method of interaction and data handling. For instance, in the "direct" mode, the LLM is used to generate responses or actions based on real-time user input, providing immediate and contextually relevant replies. This approach is particularly useful for creating conversational agents that can handle a wide range of user queries effectively.
|
||||
In the "document" mode, the LLM processes and generates responses based on pre-existing documents or content. This mode is ideal for scenarios where the bot needs to reference detailed information or provide insights derived from specific documents. The LLM analyzes the content of the documents to deliver accurate and contextually appropriate information, thereby enhancing the bot's ability to offer valuable and precise responses. This approach is particularly beneficial for applications that require in-depth knowledge or detailed guidance based on existing resources.
|
||||
The "document-ref" mode builds on the document-based approach by allowing the LLM to reference and extract information from multiple documents to generate comprehensive responses. This mode is advantageous when the bot needs to synthesize information from various sources to provide well-rounded answers or perform complex tasks. In contrast, the "sql" mode leverages structured query language to interact with databases, enabling the LLM to retrieve and manipulate data based on specific queries. Lastly, the "tool" mode integrates the LLM with external tools or services, allowing the bot to extend its functionality by interacting with other applications or systems. Each mode offers a distinct advantage, allowing the bot factory to tailor its approach based on the specific needs and objectives of the bot system.
|
||||
The "chart" mode, on the other hand, is used to generate charts and graphs based on data, providing a visual representation.
|
||||
|
||||
### Avatar Logo
|
||||
|
||||
The "Avatar Logo" is the URL of the bot's logo that represents it visually. This logo is used in user interfaces and communications to create a recognizable identity for the bot, enhancing its brand presence and user engagement.
|
||||
|
||||
### Can Publish
|
||||
|
||||
The "Can Publish" setting is a comma-separated list of mobile numbers that have the authority to publish content directly. This feature ensures that only authorized individuals can contribute or update content, maintaining control over the bot's published material.
|
||||
|
||||
### Description
|
||||
|
||||
The "Description" provides a brief overview of the bot, including its purpose, functionalities, and key features. This description helps users understand what the bot does and what to expect from its interactions.
|
||||
|
||||
### Enable Audio Hearing
|
||||
|
||||
The "Enable Audio Hearing" option indicates whether the bot can process and understand audio inputs. When set to TRUE, the bot is capable of receiving and interpreting spoken language, enhancing its interaction capabilities.
|
||||
|
||||
### Enable Audio Talking
|
||||
|
||||
The "Enable Audio Talking" setting specifies if the bot can generate and deliver spoken responses. Enabling this feature allows the bot to communicate with users through audio, making interactions more dynamic and engaging.
|
||||
|
||||
### Enable Spelling Checker
|
||||
|
||||
The "Enable Spelling Checker" option determines whether the bot should automatically check and correct spelling errors in user inputs. When set to TRUE, this feature helps maintain the quality and accuracy of interactions by addressing spelling mistakes.
|
||||
|
||||
### Enable Worldwide Translator
|
||||
|
||||
The "Enable Worldwide Translator" setting allows the bot to support multiple languages and perform translation tasks. When enabled, the bot can interact with users in various languages, catering to a global audience.
|
||||
|
||||
### Default User Language
|
||||
|
||||
The "Default User Language" specifies the language that users will encounter by default when interacting with the bot. This setting ensures that the bot communicates in the preferred language of the user, enhancing their experience.
|
||||
|
||||
### Default Content Language
|
||||
|
||||
The "Default Content Language" defines the language in which content files, such as .gbkb and .gbdialog, are written. This setting ensures consistency in content creation and processing within the bot's system.
|
||||
|
||||
### Language Detector
|
||||
|
||||
The "Language Detector" feature enables the bot to automatically identify the language of user inputs. When activated, the bot can adapt its responses based on the detected language, improving communication accuracy.
|
||||
|
||||
### NLP Score
|
||||
|
||||
The "NLP Score" is a numerical value between 0 and 1 used to assess the relevance and quality of text for Natural Language Processing (NLP) neural networks. This score helps in classifying and processing text more effectively.
|
||||
|
||||
### Search Score
|
||||
|
||||
The "Search Score" is a value between 0 and 1 that influences the consideration of Full Text Search as a content retrieval method. A higher score indicates a greater emphasis on search-based content retrieval.
|
||||
|
||||
### Transfer To
|
||||
|
||||
The "Transfer To" setting is a comma-separated list of mobile numbers to which the bot will transfer chats from WhatsApp. This feature facilitates the rerouting of conversations to designated contacts or support agents.
|
||||
|
||||
### WhatsApp Admins
|
||||
|
||||
The "WhatsApp Admins" field is a comma-separated list of mobile numbers designated as administrators for the bot. These individuals have elevated access and control over the bot’s settings and operations.
|
||||
|
||||
### Feedback Improve.Message
|
||||
|
||||
The "Feedback Improve.Message" is a predefined message that the bot will send to users when it fails to find the requested information. This message encourages users to provide feedback or try different queries.
|
||||
|
||||
### Keep Text
|
||||
|
||||
The "Keep Text" setting is a comma-separated list of words or phrases that should remain unchanged during the bot’s understanding process. This feature ensures that specific terms are preserved and accurately recognized.
|
||||
|
||||
### Start Dialog
|
||||
|
||||
The "Start Dialog" specifies the name of the .docx file (without the extension) that serves as the entry point for the bot’s dialog. This document outlines the initial interactions and flow of the conversation.
|
||||
|
||||
### HelloGoodX
|
||||
|
||||
The "HelloGoodX" option determines whether the bot should greet users with a welcome message. When set to TRUE, the bot will initiate interactions with a friendly hello.
|
||||
|
||||
### XRM Key
|
||||
|
||||
The "XRM Key" is a string key used to authenticate and access the HubSpot API. This key is essential for integrating the bot with HubSpot services and functionalities.
|
||||
|
||||
### WhatsApp Group Name
|
||||
|
||||
The "WhatsApp Group Name" is the name of the WhatsApp group to which the bot belongs. This setting helps in identifying and organizing the bot’s presence within specific groups.
|
||||
|
||||
### WhatsApp Group Shortcuts
|
||||
|
||||
The "WhatsApp Group Shortcuts" are space-separated triggers in text that activate the bot within WhatsApp groups. These shortcuts enable users to engage with the bot using predefined commands or keywords.
|
||||
|
||||
### Bot Admin Number
|
||||
|
||||
The "Bot Admin Number" is the mobile number that receives debug screenshots and other notifications related to the bot’s operation. This contact is crucial for monitoring and troubleshooting the bot.
|
||||
|
||||
### WhatsApp Group ID
|
||||
|
||||
The "WhatsApp Group ID" is a unique identifier used to connect the bot to a specific WhatsApp group. This ID is accessible only in internal logs and is essential for group integration.
|
||||
|
||||
### Debug Web Automation
|
||||
|
||||
The "Debug Web Automation" setting indicates whether the Bot Admin Number should receive screenshots of each web automation step. Enabling this feature provides detailed visibility into web automation processes.
|
||||
|
||||
### .gbapp List
|
||||
|
||||
The ".gbapp List" is a collection of associated .gbapp packages linked to the .gbot. This list helps in managing and organizing the bot’s application packages.
|
||||
|
||||
### Group Spell
|
||||
|
||||
The "Group Spell" option enables the spell checker for group interactions. When activated, the bot will check and correct spelling errors in group chat messages.
|
||||
|
||||
### Synchronize Database
|
||||
|
||||
The "Synchronize Database" setting determines whether the TABLE keyword should modify the database. Setting this to TRUE allows changes to the database schema, while FALSE should be used in production environments to prevent unintended modifications.
|
||||
|
||||
### Theme Color
|
||||
|
||||
You can change the theme color of the bot by selecting a color from the palette of General Bots available theme colors:
|
||||
|
||||
| Color |
|
||||
| ----------- |
|
||||
| grey |
|
||||
| light |
|
||||
| red |
|
||||
| blue |
|
||||
| green |
|
||||
| yellow |
|
||||
| purple |
|
||||
| orange |
|
||||
| brown |
|
||||
| pink |
|
||||
| cyan |
|
||||
| lime |
|
||||
| indigo |
|
||||
| teal |
|
||||
| violet |
|
||||
| black-white |
|
||||
|
||||
---
|
||||
|
||||
Each title and description has been crafted to clarify the purpose and functionality of the respective configuration setting.
|
||||
|
||||
|
||||
## Enviroment Variables Reference
|
||||
|
||||
| Name | Sample Value | Description |
|
||||
|------------------------|--------------------------------------------------|-------------|
|
||||
| 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.
|
||||
| CLOUD_SUBSCRIPTIONID | 622e5037-f7f1-49f6-a9c4-28babbb0fs | Cloud subscription ID used to deploy new bots.
|
||||
| CLOUD_LOCATION | westus | Cloud location used to deploy new bots.
|
||||
| CLOUD_GROUP | newassistant | Cloud group used to deploy new bots.
|
||||
| CLOUD_USERNAME | someone@domain | Cloud username used to deploy new bots.
|
||||
| CLOUD_PASSWORD | (use a password generator) | Cloud password used to deploy new bots.
|
||||
| MARKETPLACE_ID | 9c90ff1c3-101b-4f0d-85cd-4bada2226fe3 | Martplace identifier associated to the boot bot.
|
||||
| MARKETPLACE_SECRET | nzrNUUG6214%raqzYWQ8(+% | Martplace password associated to the boot bot.
|
||||
| STORAGE_DIALECT | mssql | The bot database dialect configuration value. Can be MSSQL or SQLITE.
|
||||
| STORAGE_SERVER | newassistant-storage-server.database.windows.net | The bot database server name configuration value.
|
||||
| STORAGE_NAME | newassistant-storage | The bot database name configuration value.
|
||||
| STORAGE_USERNAME | sahaaksfqiehke | The bot database security username configuration value.
|
||||
| STORAGE_PASSWORD | (use a password generator) | The bot database security password configuration value.
|
||||
| STORAGE_SYNC | true | If the bot server should sync database before running.
|
||||
| PRIVACY_STORE_MESSAGES | true | If the bot server should store message logs in the database.
|
||||
| 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.
|
||||
| GBDIALOG_GBDATABOT | Shared.gbai/Shared.gbdata | If defined, BotServer will use this .gbdata instead of default location.
|
||||
| Name | Sample Value | Description |
|
||||
| ---------------------- | ------------------------------------------------ | ------------------------------------------------------------------------ | ------------------------------------------------------------------------------------- |
|
||||
| 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. |
|
||||
| CLOUD_SUBSCRIPTIONID | 622e5037-f7f1-49f6-a9c4-28babbb0fs | Cloud subscription ID used to deploy new bots. |
|
||||
| CLOUD_LOCATION | westus | Cloud location used to deploy new bots. |
|
||||
| CLOUD_GROUP | newassistant | Cloud group used to deploy new bots. |
|
||||
| CLOUD_USERNAME | someone@domain | Cloud username used to deploy new bots. |
|
||||
| CLOUD_PASSWORD | (use a password generator) | Cloud password used to deploy new bots. |
|
||||
| MARKETPLACE_ID | 9c90ff1c3-101b-4f0d-85cd-4bada2226fe3 | Martplace identifier associated to the boot bot. |
|
||||
| MARKETPLACE_SECRET | nzrNUUG6214%raqzYWQ8(+% | Martplace password associated to the boot bot. |
|
||||
| STORAGE_DIALECT | mssql | The bot database dialect configuration value. Can be MSSQL or SQLITE. |
|
||||
| STORAGE_SERVER | newassistant-storage-server.database.windows.net | The bot database server name configuration value. |
|
||||
| STORAGE_NAME | newassistant-storage | The bot database name configuration value. |
|
||||
| STORAGE_USERNAME | sahaaksfqiehke | The bot database security username configuration value. |
|
||||
| STORAGE_PASSWORD | (use a password generator) | The bot database security password configuration value. |
|
||||
| STORAGE_SYNC | true | If the bot server should sync database before running. |
|
||||
| PRIVACY_STORE_MESSAGES | true | If the bot server should store message logs in the database. |
|
||||
| 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. |
|
||||
| GBDIALOG_GBDATABOT | Shared.gbai/Shared.gbdata | If defined, BotServer will use this .gbdata instead of default location. |
|
||||
| ADMIN_OPEN_PUBLISH | | true | If defined, BotServer will open the publish dialog on startup not requiring password. |
|
||||
|
||||
## How to
|
||||
|
||||
### Move to production (Azure)
|
||||
|
||||
* Update bot endpoint;
|
||||
*
|
||||
- Update bot endpoint;
|
||||
-
|
||||
|
||||
### WhatsApp Procedures
|
||||
|
||||
|
@ -190,12 +248,14 @@ Each title and description has been crafted to clarify the purpose and functiona
|
|||
4. Get the token from User and update the WhatsAppServiceKey;
|
||||
|
||||
#### Register PIN.
|
||||
|
||||
```
|
||||
https://graph.facebook.com/v18.0/999996037087713/
|
||||
{"pin" : "999999"}
|
||||
```
|
||||
|
||||
##### Register Account.
|
||||
|
||||
```
|
||||
https://graph.facebook.com/v18.0/999997245497156/register
|
||||
{
|
||||
|
@ -204,6 +264,7 @@ https://graph.facebook.com/v18.0/999997245497156/register
|
|||
```
|
||||
|
||||
##### Define message in profile.
|
||||
|
||||
```
|
||||
https://graph.facebook.com/v18.0/99999792462862/whatsapp_business_profile
|
||||
{
|
||||
|
@ -216,31 +277,37 @@ https://graph.facebook.com/v18.0/99999792462862/whatsapp_business_profile
|
|||
|
||||
1. Create Entra User fill .env CLOUD_USERNAME and CLOUD_PASSWORD;
|
||||
2. Get SubscriptionId and fill SUBSCRIPTION_ID;
|
||||
3. Define BOT_ID, CLOUD_LOCATION, CLOUD_GROUP
|
||||
4. Create AppId and Secret in Azure and fill MARKEPLACE_* keys;
|
||||
5. eploy General Bots with the .env ready;
|
||||
3. Define BOT_ID, CLOUD_LOCATION, CLOUD_GROUP
|
||||
4. Create AppId and Secret in Azure and fill MARKEPLACE\_\* keys;
|
||||
5. eploy General Bots with the .env ready;
|
||||
6. An updated version of .env is generated;
|
||||
7. In Application | Permissions:
|
||||
◦ Microsoft Graph
|
||||
▪ Sites.Read.All
|
||||
▪ Sites.ReadWrite.All
|
||||
▪ User.Read
|
||||
▪ Application.Read.All
|
||||
▪ Application.ReadWrite.All
|
||||
◦ Microsoft Graph
|
||||
▪ Sites.Read.All
|
||||
▪ Sites.ReadWrite.All
|
||||
▪ User.Read
|
||||
▪ Application.Read.All
|
||||
▪ Application.ReadWrite.All
|
||||
8. In Authentication | Add Platform | Web | Redirect URL: https://server/botId/token;
|
||||
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.
|
||||
|
||||
## Opening 443 Port in Linux
|
||||
|
||||
```
|
||||
setcap 'cap_net_bind_service=+ep' $(readlink -f $(which node))
|
||||
```
|
||||
|
||||
## 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.
|
||||
-- Enter Azure | Subscription | Resource providers | Find Microsoft.Web and check it.
|
||||
-- Enter Azure | Subscription | Resource providers | Find Microsoft.Web and check it.
|
||||
|
||||
### Setup Linux RDP to access Azure
|
||||
|
||||
|
||||
```
|
||||
# MS Remote Desktop Connection (RDP Client)
|
||||
|
||||
# MS Remote Desktop Connection (RDP Client)
|
||||
|
||||
apt-add-repository ppa:remmina-ppa-team/remmina-next
|
||||
apt update
|
||||
apt install remmina remmina-plugin-rdp remmina-plugin-secret
|
||||
|
|
|
@ -61,7 +61,8 @@ Follow these steps to get your General Bots server up and running:
|
|||
|
||||
### Accessing Your Bot
|
||||
|
||||
Once the server is running, you can access your bot at `http://localhost:4242/`. This local server allows you to interact with your bot and test its functionality in real-time.
|
||||
Once the server is running, you can access your bot at `http://localhost:4242/`. This local server allows you to interact with your bot and test its functionality in real-time. If you want to publish
|
||||
without password, define [ADMIN_OPEN_PUBLISH](./docs/chapter-07-gbot-reference#enviroment-variables-reference) as true in BotServer .env file.
|
||||
|
||||
To publish bot packages and initiate a conversation with the bot, use the command:
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue