Introduction
The goal of Project Omnibus is to provide a simple, open-source Python toolkit that can help build and experiment with powerful, custom-crafted OpenAI Assistants based on ChatGPT-4. This toolkit can be modified and extended to enable GPT-4 to escape the cloud and interact with the real world through ubiquitous MQTT messaging. Build your own personal advisory sidekick.
OpenAI Assistants can write and run code, reference their own documents and call functions when responding to a prompt. This opens the door to a plethora of opportunities for leveraging the advanced reasoning capabilities of the leading large-language-model AI.
MQTT stands for "MQ Telemetry Transport" (https://mqtt.org/). It is a standardized, lightweight publish/subscribe messaging protocol designed for machine to machine telemetry in low bandwidth environments.
Application Scenarios
https://upperbay.com/v1/blogs/beachblogs/electric-summertime-blues
https://upperbay.com/v1/blogs/beachblogs/integrating-ai-into-industrial-operations
Project Description
Python code, built on the OpenAI Beta Assistant API, to aid the integration of OpenAI LLMs (e.g. ChatGPT-4) into applications using MQTT messaging. Documentation for the API is available here.
MQTT is a light-weight, easy-to-use, publish-subscribe messaging bus widely used in internet of things (IoT) communications. It is multi-platform (e.g. Windows, Linux) and is supported by all major software languages. The site is https://mosquitto.org/ and downloads are available at https://mosquitto.org/download/.
Access to the GPT-4 Assistant API requires an OpenAI account and an OpenAI key from openai.com. Set the OPENAI_API_KEY environment variable using the Windows Powershell "setx" command.
Repository
https://github.com/upperbayhawk/C2_AIAgents.git
Overview
Code Summary
The code is 100% Python 3.12 developed on Windows 11 with Microsoft VSCode.
The code consists of a folder with a set of console apps that perform different functions associated with a specific GPT-4 Assistant that resides in the OpenAI cloud.
The GPT-4 Assistant is created by makeagent.py. Use https://platform.openai.com/assistants to verify creation. GPT-4 Assistant behavior is defined in this file.
The runserver.py is the primary local proxy agent that communicates directly with the cloud Assistant. It sends messages to the Assistant and waits for responses. Other functions include:
Agent libraries include:
Other agents are optional. They are:
These console apps have a simple structure that extends the OpenAI Assistant API in a straight forward if not elegant way. The purpose of this code is to help experiment and explore the capabilities of GPT-4 while providing a means to integrate GPT-4 with other applications, regardless of where the applications are running.
Each console app is multi-threaded. They create threads to handle keyboard and MQTT message dispatching based on topic. The topic tree is defined in config.py to avoid conflict between agents. Incoming MQTT messages are pushed into topic queues and the topic worker threads get and service the messages received. Other worker threads are spawned as needed. Most of the code is plumbing and can be changed to do whatever.
Usage
Have Fun With Agents...
Dave Hardin