Skip to content

Commit

Permalink
Merge pull request #500 from mydroidandi/fb/estebanways
Browse files Browse the repository at this point in the history
Fb/estebanways
  • Loading branch information
estebanways authored Jul 19, 2024
2 parents 4780bb7 + d3b4359 commit 06fa7c0
Show file tree
Hide file tree
Showing 45 changed files with 2,746 additions and 614 deletions.
26 changes: 18 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -122,13 +122,13 @@ An app designed to facilitate seamless interaction with the powerful OpenAI's GP

Interacts with the Commbase platform by generating AI-driven responses using the Ollama API with the Phi3 mini model from Microsoft. This is a midweight implementation with session or short-term memory for language generation. [More Info](/bundles/commbase-genai-slm-ollama-phi3-mini-memory/)

<a href="./bundles/commbase-genai-slm-ollama-phi3-mini-memory-remote-rag-picone/">
<img align="center" alt="commbase-genai-slm-ollama-phi3-mini-memory-remote-rag-picone" width="5%" src="./bundles/commbase-genai-slm-ollama-phi3-mini-memory-remote-rag-picone/commbase-genai-slm-ollama-phi3-mini-memory-remote-rag-picone.jpg"/>
<a href="./bundles/commbase-genai-slm-ollama-phi3-mini-memory-remote-rag-pinecone/">
<img align="center" alt="commbase-genai-slm-ollama-phi3-mini-memory-remote-rag-pinecone" width="5%" src="./bundles/commbase-genai-slm-ollama-phi3-mini-memory-remote-rag-pinecone/commbase-genai-slm-ollama-phi3-mini-memory-remote-rag-pinecone.jpg"/>
</a>

**commbase-genai-slm-ollama-phi3-mini-memory-remote-rag-picone**
**commbase-genai-slm-ollama-phi3-mini-memory-remote-rag-pinecone**

Interacts with the Commbase platform by generating AI-driven responses using the Ollama API with the Phi3 mini model from Microsoft. This is a heavyweight implementation with memory for language generation, featuring remote RAG and Picone for persistent memory. [More Info](/bundles/commbase-genai-slm-ollama-phi3-mini-memory-remote-rag-picone/)
Interacts with the Commbase platform by generating AI-driven responses using the Ollama API with the Phi3 mini model from Microsoft. This is a heavyweight implementation with memory for language generation, featuring remote RAG and Pinecone for persistent memory. [More Info](/bundles/commbase-genai-slm-ollama-phi3-mini-memory-remote-rag-pinecone/)

<a href="./bundles/commbase-genai-slm-ollama-phi3-mini-nomemory/">
<img align="center" alt="commbase-genai-slm-ollama-phi3-mini-nomemory" width="5%" src="./bundles/commbase-genai-slm-ollama-phi3-mini-nomemory/commbase-genai-slm-ollama-phi3-mini-nomemory.jpg"/>
Expand Down Expand Up @@ -170,6 +170,14 @@ This is an OpenAI's Whisper-based proactive ASR (Automatic Speech Recognition) e

This is an OpenAI's Whisper-based reactive ASR (Automatic Speech Recognition) engine designed to convert spoken language into written text without requiring an internet connection, making it a reliable and secure solution for any application that needs speech-to-text functionality. [More Info](/bundles/commbase-stt-whisper-reactive-p/)

<a href="./bundles/commbase-text-translator-phi3-mini/">
<img align="center" alt="commbase-text-translator-phi3-mini" width="5%" src="./bundles/commbase-text-translator-phi3-mini/commbase-text-translator-phi3-mini.jpg"/>
</a>

**commbase-text-translator-phi3-mini**

Translates text from one language to another using the Ollama API with a specific Phi3 mini language model from Microsoft. [More Info](/bundles/commbase-text-translator-phi3-mini)

<a href="./bundles/commbase-tts-gTTS/">
<img align="center" alt="commbase-tts-gTTS" width="5%" src="./bundles/commbase-tts-gTTS/commbase-tts-gTTS.png"/>
</a>
Expand All @@ -179,7 +187,7 @@ This is an OpenAI's Whisper-based reactive ASR (Automatic Speech Recognition) en
A Commbase-ready TTS executable using gTTS (Google Text-to-Speech), a Python library and CLI tool to interface with Google Translate text-to-speech API. [More Info](/bundles/commbase-tts-gTTS/)

<a href="./bundles/commbase-tts-pyttsx3/">
<img align="center" alt="commbase-tts-pyttsx3" width="5%" src="./bundles/commbase-tts-pyttsx3/commbase-tts-pyttsx3.jpg"/>
<img align="center" alt="commbase-tts-gTTS" width="5%" src="./bundles/commbase-tts-pyttsx3/commbase-tts-pyttsx3.jpg"/>
</a>

**commbase-tts-pyttsx3**
Expand Down Expand Up @@ -255,7 +263,7 @@ This project is coded and organized like this:
│ │ └── examples
│ ├── commbase-genai-slm-ollama-phi3-mini-memory
│ │ └── examples
│ ├── commbase-genai-slm-ollama-phi3-mini-memory-remote-rag-picone
│ ├── commbase-genai-slm-ollama-phi3-mini-memory-remote-rag-pinecone
│ │ ├── examples
│ │ └── resources
│ │ └── src
Expand All @@ -270,6 +278,8 @@ This project is coded and organized like this:
│ ├── commbase-stt-whisper-reactive-p
│ │ ├── client_data
│ │ └── examples
│ ├── commbase-text-translator-phi3-mini
│ │ └── examples
│ ├── commbase-tts-gTTS
│ │ └── examples
│ ├── commbase-tts-pyttsx3
Expand Down Expand Up @@ -364,7 +374,7 @@ This project is coded and organized like this:
├── conversation_logs
├── knowledge_base
├── memory_store
│ ├── commbase-genai-slm-ollama-phi3-mini-memory-remote-rag-picone
│ ├── commbase-genai-slm-ollama-phi3-mini-memory-remote-rag-pinecone
│ │ ├── build
│ │ └── src
│ └── ...
Expand All @@ -377,7 +387,7 @@ Core technologies directly involved in the application's functionality.

### Required in The Default Installation

[OpenAI Whisper](https://openai.com/research/whisper) | [Ollama](https://ollama.com) | [Microsoft Phi3](https://huggingface.co/microsoft/Phi-3-mini-4k-instruct) | [Picone](https://www.pinecone.io/) | [PyAudio](https://people.csail.mit.edu/hubert/pyaudio/) | [Awk](https://www.gnu.org/software/gawk/) | [Git](https://git-scm.com) | [Jq](https://stedolan.github.io/jq/) | [SSH](https://www.openssh.com) | [Flask](https://flask.palletsprojects.com)| [NumPy](https://numpy.org) | [Pandas](https://pandas.pydata.org) | [Pyttsx3](https://pypi.org/project/pyttsx3/) | [FFmpeg](https://ffmpeg.org) | [GNU/Linux](https://www.gnu.org/gnu/linux-and-gnu.html) | [Systemd](https://systemd.io/) | [Bash](https://www.gnu.org/software/bash/) | [Bc](https://www.gnu.org/software/bc/) | [Python](https://python.org) | [Oh My Tmux](https://github.com/gpakosz/.tmux) | [Tmux](https://github.com/tmux/tmux)
[OpenAI Whisper](https://openai.com/research/whisper) | [Ollama](https://ollama.com) | [Microsoft Phi3](https://huggingface.co/microsoft/Phi-3-mini-4k-instruct) | [Pinecone](https://www.pinecone.io/) | [PyAudio](https://people.csail.mit.edu/hubert/pyaudio/) | [Awk](https://www.gnu.org/software/gawk/) | [Git](https://git-scm.com) | [Jq](https://stedolan.github.io/jq/) | [SSH](https://www.openssh.com) | [Flask](https://flask.palletsprojects.com)| [NumPy](https://numpy.org) | [Pandas](https://pandas.pydata.org) | [Pyttsx3](https://pypi.org/project/pyttsx3/) | [FFmpeg](https://ffmpeg.org) | [GNU/Linux](https://www.gnu.org/gnu/linux-and-gnu.html) | [Systemd](https://systemd.io/) | [Bash](https://www.gnu.org/software/bash/) | [Bc](https://www.gnu.org/software/bc/) | [Python](https://python.org) | [Oh My Tmux](https://github.com/gpakosz/.tmux) | [Tmux](https://github.com/tmux/tmux)

### Optional

Expand Down
25 changes: 18 additions & 7 deletions assets/docs/User's Guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -793,6 +793,11 @@ The default version of the file **commbase.conf** contains the next values:
- Example value:
- `english` (Default): When chosen, sets the default LLM language to English.

- **SLM_MS_PHI3_MINI_SENTIMENT_ANALYSIS_MODEL**:
- Description: Describes the model used for sentiment analysis by the **transformers** library from Hugging Face in the commbase-genai-slm-ollama-phi3-mini bundles.
- Possible values:
- `distilbert/distilbert-base-uncased-finetuned-sst-2-english` (Default): When this Text Classification model is selected, it is used to analyze the sentiment of the assistant's response. This model is a fine-tuned checkpoint of DistilBERT-base-uncased, specifically fine-tuned on the SST-2 dataset. It achieves an accuracy of 91.3% on the development set. For comparison, the BERT-base-uncased model achieves an accuracy of 92.7% on the same set.

- **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/i18n/control_patterns/$STT_ENGINE_MODEL_DIRECTORY/$STT_ENGINE_MODEL_SUBDIRECTORY/$COMMBASE_LANG.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:
Expand Down Expand Up @@ -956,6 +961,12 @@ The default version of the file **commbase.conf** contains the next values:
- Possible values: True or False.
- Example value: `False` (Default): Set to false, the STT engine does not display the speech processing time in the STT engine pane after every processing is complete.

- **CHATROOM_PARAGRAPHS_FORMAT**:
- Description: Specifies whether the chat participant paragraphs are displayed in the chatroom.
- Possible values:
- **`one_participant_per_paragraph` (Default):** Each separate paragraph or sentence in the response is logged individually with new participant name tags in the chatroom for enhanced clarity.
- **`single_paragraphs_string`:** The entire response is logged as a single paragraph string with a single participant name tag in the chatroom, regardless of the quantity of paragraphs or sentences, to save space.

- **CHAT_LOG_FILE**:
- Possible values:
- `/data/.chat_log.txt` (Default): The chat log file likely stores a record of interactions or conversations.
Expand Down Expand Up @@ -1295,20 +1306,20 @@ CHAT_MEMORY_FILE="data/.chat_memory.txt"
- Example value:
- `3600` (Default): Set to 3600 seconds (equivalent to 1 hour and 0 minutes), indicates that the system checks for pending tasks approximately every 60 minutes.

- **COMMBASE_HARDWARE_NOTIFICATIONS_ON**:
- Description: Indicates whether Commbase hardware notifications are enabled or disabled. If set to "True", hardware notifications are enabled; otherwise, they are disabled.
- Possible values: "True" or "False". Set to "True" only if you are making Commbase hardware, such as: hardware interfaces, a speech to text engine component, or any other hardware device based on Commbase (droids, smart appliances, vehicles, etc.) Check out the existent Commbase hardware variables.
- Example value:
- `False` (Default): Hardware notifications are disabled.

- **ASSISTANT_RESPONSE_SENTIMENT_ANALYSIS_ON**:
- Description: A flag that determines whether the sentiment analysis feature for assistant responses is enabled or not. When set to `True`, the sentiment analysis is active, allowing the system to evaluate and act upon the emotional tone of the assistant's responses. Using Motors: If sentiment is positive, activate motors to simulate a hugging action. For example, robotic arms could move to embrace the user. Using Screens: Display a smiling face on a screen. For example, showing an animated smiley face on a digital display.
- Description: A flag that determines whether the sentiment analysis feature for assistant responses is enabled or not. When set to `True`, the sentiment analysis is active, allowing the system to evaluate and act upon the emotional tone of the assistant's responses. Using Motors: If sentiment is positive, activate motors to simulate a hugging action. For example, robotic arms could move to embrace the user. Using Screens: Display a smiling face on a screen. For example, showing an animated smiley face on a digital display. Relies on the value of the variable `COMMBASE_HARDWARE_NOTIFICATIONS_ON`.
- Possible values:
- `True`: Enables sentiment analysis for assistant responses.
- `False`: Disables sentiment analysis for assistant responses.
- Example value:
- `True` (Default): Set to `True`, indicating that the system will perform sentiment analysis on the assistant's responses, facilitating actions based on the detected sentiment.

- **COMMBASE_HARDWARE_NOTIFICATIONS_ON**:
- Description: Indicates whether Commbase hardware notifications are enabled or disabled. If set to "True", hardware notifications are enabled; otherwise, they are disabled.
- Possible values: "True" or "False". Set to "True" only if you are making Commbase hardware, such as: hardware interfaces, a speech to text engine component, or any other hardware device based on Commbase (droids, smart appliances, vehicles, etc.) Check out the existent Commbase hardware variables.
- Example value:
- `False` (Default): Hardware notifications are disabled.

- **COMMBASE_HARDWARE_DEVICE_0**:
- Description: The path of the hardware device used for communication, for example, an Arduino or any other microcontroller. Check out the other existent Commbase hardware variables.
- Possible values: A valid path to a hardware device.
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"messages": [{"language": "en_us"}, {"control": ""}, {"current_request": "--select-stt-engine"}, {"previous_request": "--select-stt-engine"}, {"current_response": ""}, {"runtime": ""}, {"source_code_display": ""}, {"source_code": ""}]}
{"messages": [{"language": "en_us"}, {"control": ""}, {"current_request": "rec"}, {"previous_request": "rec"}, {"current_response": ""}, {"runtime": ""}, {"source_code_display": ""}, {"source_code": ""}]}

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
[![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)

# commbase-genai-slm-ollama-phi3-mini-memory-remote-rag-pinecone

<img alt="commbase-genai-slm-ollama-phi3-mini-memory-remote-rag-pinecone" src="commbase-genai-slm-ollama-phi3-mini-memory-remote-rag-pinecone.jpg?raw=true" width="512" height="640" />

Interacts with the Commbase platform by generating AI-driven responses using the Ollama API with the Phi3 mini model from Microsoft. This is a heavyweight implementation with memory for language generation, featuring remote RAG and Pinecone for persistent memory.

## Examples

Detailed information about examples can be found in the corresponding [`examples`](./examples) directory.

## Contributors

Thanks to the following people who have contributed to this project:

* [@estebanways](https://github.com/estebanways)

## Contact

If you want to contact us you can reach us at <stv.herrera@gmail.com>.

## License

This project uses the following license: [`License`](./COPYING).
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
#!/usr/bin/env python
################################################################################
# commbase-genai-slm-ollama-phi3-mini-memory-remote-rag-picone #
# commbase-genai-slm-ollama-phi3-mini-memory-remote-rag-pinecone #
# #
# A sophisticated AI assistant's Small Language Model (Phi3), enhanced by #
# Retrieval-Augmented Generation (RAG) for improved response accuracy, and #
# supported by a Picone semantic vector database. #
# supported by a Pinecone semantic vector database. #
# #
# Change History #
# 06/25/2024 Esteban Herrera Original code. #
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
#!/usr/bin/env python
################################################################################
# commbase-genai-slm-ollama-phi3-mini-memory-remote-rag-picone #
# commbase-genai-slm-ollama-phi3-mini-memory-remote-rag-pinecone #
# #
# A sophisticated AI assistant's Small Language Model (Phi3), enhanced by #
# Retrieval-Augmented Generation (RAG) for improved response accuracy, and #
# supported by a Picone semantic vector database. #
# supported by a Pinecone semantic vector database. #
# #
# Change History #
# 06/25/2024 Esteban Herrera Original code. #
Expand Down Expand Up @@ -32,7 +32,7 @@
# along with this program; if not, write to the Free Software #
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA #

# create_and_configure_a_new_Pinecone_index.py
# create_and_configure_a_new_pinecone_index.py
# Creates and configures a new Pinecone index named 'new-pinecone-index'

# Imports
Expand Down
Loading

0 comments on commit 06fa7c0

Please sign in to comment.