Skip to content

Commit

Permalink
Merge pull request #473 from mydroidandi/development
Browse files Browse the repository at this point in the history
Development
  • Loading branch information
estebanways authored Mar 5, 2024
2 parents 0e85b00 + 10e7460 commit 8f6f692
Show file tree
Hide file tree
Showing 10 changed files with 79 additions and 11 deletions.
3 changes: 0 additions & 3 deletions .github/workflows/python-package-conda.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,7 @@ jobs:
echo $CONDA/bin >> $GITHUB_PATH
- name: Install dependencies
run: |
# Conda doesn't currently offer a built-in way to specifically skip a
# single package during environment creation, like:
conda env create --file commbase_env.yaml --name commbase_env
#conda env update --file commbase_env.yaml --name commbase_env
- name: Lint with flake8
run: |
Expand Down
18 changes: 18 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,33 @@
<div align="center">

[![Python Package using Conda](https://github.com/mydroidandi/commbase/actions/workflows/python-package-conda.yml/badge.svg)](https://github.com/mydroidandi/commbase/actions/workflows/python-package-conda.yml)
[![Python Version](https://img.shields.io/badge/Python-3.10%20%7C%203.11%20%7C%203.12-blue)](https://img.shields.io/badge/python-3.10%20%7C%203.11%20%7C%203.12-blue)
[![flake8 Lint](https://github.com/mydroidandi/commbase/actions/workflows/python-flake8-lint.yml/badge.svg)](https://github.com/mydroidandi/commbase/actions/workflows/python-flake8-lint.yml)
[![json-lint](https://github.com/mydroidandi/commbase/actions/workflows/jq-json-lint.yml/badge.svg)](https://github.com/mydroidandi/commbase/actions/workflows/jq-json-lint.yml)
[![Shell Linter](https://github.com/mydroidandi/commbase/actions/workflows/shell-lint.yml/badge.svg)](https://github.com/mydroidandi/commbase/actions/workflows/shell-lint.yml)

</div>

<div align="center">

# Commbase <img align="center" alt="Commbase" width="10%" src="./assets/docs/images/commbase.png" />

</div>

<div align="center">

<img alt="Commbase" src="./screenshots/commbase.png?raw=true" width="550" height="291" />

</div>

<br />

<div align="center">

Commbase is a module and library bundler, and a flexible ✨ development framework ✨ designed to empower computers and other devices with advanced conversational AI capabilities. It incorporates third-party LLMs to enable features such as "distributed AIs" or "multi-agent systems" (MAS). Commbase extends its reach to applications and diverse devices, including droids, smart appliances, and various types of vehicles. It runs on a single machine or a set of two machines in a client-server architecture.

</div>

## Usage

[`INSTALL`](./INSTALL) Commbase and then run the next command in a terminal to start the program:
Expand Down
21 changes: 20 additions & 1 deletion assets/docs/User's Guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ The window 1, "Commbase", contains 7 panes, where every pane runs a component:
- Pane 2. It is the client component.
- Pane 3. It is the server component.
- Pane 4. It is the speech recognizer component.
- Pane 5. It is the animation component.
- Pane 5. It is the use mode component.
- Pane 6. It is the audio mixer component.
- Pane 7. It is the user terminal component. It is almost always focused, except when is used by Commbase for launching skill scripts.

Expand Down Expand Up @@ -681,6 +681,25 @@ The default version of the file **commbase.conf** contains the next values:
- Example values:
- `en_us` (Default): This setting designates the default locale as English (United States). Users with this locale will encounter the application in English, experiencing the predetermined language and formatting preferences specified by this setting.

- **CURRENT_MODE**:
- Description: The current use mode your app is running on. Modes are defined in the control patterns file. The default location for this file is **bundles/libcommbase/resources/control_patterns/en_us/openai_whisper_model_base/control_patterns.json**. You can change from any mode to another by changing the value of this variable. The action will update the mode component status on screen.
- Example values:
- `COMPUTER` (Default): The computer mode. It is the only mode packaged with Commbase.
- `ROBOT`: The robot mode. If in your case, you are free to program this mode to meet your requirements.
- `CAR`: The car mode. If in your use case, you are free to program this mode to meet your requirements.
- `BOAT`: The boat mode. If in your use case, you are free to program this mode to meet your requirements.
- `PLANE`: The plane mode. If in your use case, you are free to program this mode to meet your requirements.
- `STARSHIP`: The starship mode. If in your use case, you are free to program this mode to meet your requirements.
- `IRON MAN`: The iron man mode. If in your use case, you are free to program this mode to meet your requirements.
- `REFRIGERATOR`: The refrigerator mode. If in your use case, you are free to program this mode to meet your requirements.

- **CURRENT_SUB_MODE**:
- Description: The current use mode your app is running on. Modes are defined in the control patterns file. The default location for this file is **bundles/libcommbase/resources/control_patterns/en_us/openai_whisper_model_base/control_patterns.json**. You can trigger from any submode to another by changing the value of this variable. Every submode relies on its mode to work.
- Possible values:
- `AUTOMATIC` (Default): The automatic submode. It is the only mode packaged with Commbase.
- `AUTOMATED` (Default): The automated submode. If in your use case, you are free to program this mode to meet your requirements.
- `AUTONOMOUS` (Default): The autonomous submode. If in your use case, you are free to program this mode to meet your requirements.

- **COMMBASE_DATA_EXCHANGE_SERVER_HOST_ADDRESS**:
- Description: The host address for the Commbase Data Exchange Server.
- Example value:
Expand Down
25 changes: 23 additions & 2 deletions bundles/libcommbase/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,31 +9,52 @@ libcommbase is a collection of libraries to centralize common functions that can

## controller

libcommbase comes with 26 reliable and mutually exclusive control messages that can be recorded and sent forward together with the parsed messages and be used by skill applications to parameterize any skill option or be bypassed for message management/handling in any application subsequently. These control messages can also be changed or customized in its respective patterns file, and ultimately, increase or decrease in number preferably during your app designing phase. These out-of-the-box controls are:
libcommbase comes with a number of possible reliable and mutually exclusive control messages that can be recorded and sent forward to get processed by skill applications. These control messages can also be changed or customized in its respective patterns file, and ultimately, increase or decrease in number preferably during your app designing phase. These out-of-the-box controls are:

### Cancel previous actions

* stop_previous_command
* reproduce_previuos_discourse

### Repetitions

* rerun_previous_command
* reproduce_previuos_discourse

### Start Reminder Countdowns

* start_five_mins_question_reminder_countdown
* start_ten_mins_question_reminder_countdown
* start_twenty_mins_question_reminder_countdown
* start_thirty_mins_question_reminder_countdown
* remind_a_queued_question_put_on_hold

### Decision-Making

* accept_changes
* deny_changes
* confirm_a_confirmation_request

### Select Options

* select_option_number_one
* select_option_number_two
* select_option_number_three
* select_option_number_four

### Use Modes

* request_the_current_mode
* enter_the_computer_mode
* enter_the_robot_mode
* enter_the_car_mode
* enter_the_boat_mode
* enter_the_plane_mode
* enter_the_starship_mode
* enter_the_iron_man_mode
* enter_the_refrigerator_mode

### Use Submodes

* enter_the_automatic_submode
* enter_the_automated_submode
* enter_the_autonomous_submode
Expand Down
4 changes: 2 additions & 2 deletions bundles/libcommbase/libcommbase/routines/controller.sh
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
# through the commbase-data-exchange client.
controller() {
# Imports
source "$COMMBASE_APP_DIR/config/commbase.conf"
source "$COMMBASE_APP_DIR"/config/commbase.conf

# Imports from libcommbase
update_control_in_messages_json=$COMMBASE_APP_DIR/bundles/libcommbase/libcommbase/routines/update_control_in_messages_json.sh
Expand All @@ -51,7 +51,7 @@ controller() {
current_request=$(jq -r '.messages[1].current_request' <<< "$messages_json")

# Extract the JSON object control patterns from file and process them
patterns_file=$(<"$COMMBASE_APP_DIR""$CONTROL_PATTERNS_FILE")
patterns_file=$(<"$COMMBASE_APP_DIR"/"$CONTROL_PATTERNS_FILE")
#cat $COMMBASE_APP_DIR$CONTROL_PATTERNS_FILE | jq 'to_entries[] | .key, .value[]'

matching_property=""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,9 @@
"enter_the_boat_mode": ["Okay enter the boat mode.", "Ok enter the boat mode."],
"enter_the_plane_mode": ["Okay enter the plane mode.", "Ok enter the plane mode."],
"enter_the_starship_mode": ["Okay enter the starship mode.", "Ok enter the starship mode."],
"enter_the_iron_man_mode": ["Okay enter the iron man mode.", "Ok enter the iron man mode."],
"enter_the_refrigerator_mode": ["Okay enter the refrigerator mode.", "Ok enter the refrigerator mode."],
"enter_the_automatic_submode": ["Okay enter the automatic mode.", "Ok enter the automatic mode."],
"enter_the_automated_submode": ["Okay enter the automated mode.", "Ok enter the automated mode."],
"enter_the_autonomouns_submode": ["Okay enter the autonomous mode.", "Ok enter the automomous mode."]
"enter_the_autonomous_submode": ["Okay enter the autonomous mode.", "Ok enter the autonomous mode."]
}
2 changes: 2 additions & 0 deletions config/commbase.conf
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ PYTHON_ENV_VERSION="python"
STT_PROCESS_CPU_LIMIT_PERCENTAGE="90"
CONDA_ENV_NAME_IF_EXISTS="commbase_env"
COMMBASE_LOCALE="en_us"
CURRENT_MODE="COMPUTER"
CURRENT_SUB_MODE="AUTOMATIC"
COMMBASE_DATA_EXCHANGE_SERVER_HOST_ADDRESS="127.0.0.1"
COMMBASE_DATA_EXCHANGE_SERVER_PORT="5000"
COMMBASE_DATA_EXCHANGE_SERVER_CONNECTION_FILE_PATH="$COMMBASE_APP_DIR/bundles/commbase-data-exchange/server/server_http_websocket.py"
Expand Down
8 changes: 8 additions & 0 deletions data/.chat_log.txt
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,11 @@
🧑 END USER:
🧑 END USER:
🧑 END USER:
🧑 END USER:
🧑 END USER:
🧑 END USER:
🧑 END USER:
🧑 END USER:
🧑 END USER:
🧑 END USER:
🧑 END USER:
4 changes: 3 additions & 1 deletion scripts/utilities/reset_commbase.conf/commbase.conf.default
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ PYTHON_ENV_VERSION="python"
STT_PROCESS_CPU_LIMIT_PERCENTAGE="90"
CONDA_ENV_NAME_IF_EXISTS="commbase_env"
COMMBASE_LOCALE="en_us"
CURRENT_MODE="COMPUTER"
CURRENT_SUB_MODE="AUTOMATIC"
COMMBASE_DATA_EXCHANGE_SERVER_HOST_ADDRESS="127.0.0.1"
COMMBASE_DATA_EXCHANGE_SERVER_PORT="5000"
COMMBASE_DATA_EXCHANGE_SERVER_CONNECTION_FILE_PATH="$COMMBASE_APP_DIR/bundles/commbase-data-exchange/server/server_http_websocket.py"
Expand Down Expand Up @@ -58,7 +60,7 @@ ASCII_ART_FILE_PATH="/assets/ascii/avatar.asc"
ASSISTANT_MICROPHONE_INSTRUCTION_FILE="/bundles/libcommbase/resources/discourses/mute_the_microphone_to_pause_the_recording_instruction"
MESSAGING_FILE="/data/.messages.json"
MESSAGING_HISTORY_FILE="/history/.messaging_history"
CONTROL_PATTERNS_FILE="/bundles/libcommbase/resources/control_patterns/en_us/openai_whisper_model_base/control_patterns.json"
CONTROL_PATTERNS_FILE="bundles/libcommbase/resources/control_patterns/en_us/openai_whisper_model_base/control_patterns.json"
ANSWER_UNKNOWN_COMMANDS_USING_AI_CHATBOT_ON="False"
AI_CHATBOT_STRING="$COMMBASE_APP_DIR/bundles/commbase-llm-google-gemini-p/commbase_llm_google_gemini_p.py"
UNKNOWN_COMMAND_AI_CHATBOT_WORDS_LIMIT="35"
Expand Down
2 changes: 1 addition & 1 deletion src/app.sh
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ app() {
# send the enter key, and sleep.
(tmux select-pane -t 5 && tmux send-keys " conda activate $CONDA_ENV_NAME_IF_EXISTS" C-m && sleep $time);
# Run text_animation and then press enter
(tmux select-pane -t 5 && tmux send-keys " clear; bash $text_animation 'Commbase' 0.5" C-m && sleep $time);
(tmux select-pane -t 5 && tmux send-keys " clear; bash $text_animation '$CURRENT_MODE ($CURRENT_SUB_MODE)' 0.3" C-m && sleep $time);

# Pane 6
# On window 0, select pane 6, activate the conda environment if it exists,
Expand Down

0 comments on commit 8f6f692

Please sign in to comment.