Outworld AI is a Python-based conversational assistant that integrates Ollama for text generation, Kokoro for text-to-speech (TTS), and an emotion classifier using Hugging Face's transformers. It also manages conversation context history with an SQLite database.
- Text generation using Ollama.
- Emotion classification using transformers (
distilbert-base-uncased-emotion). - Text-to-speech (TTS) with Kokoro for converting responses into audio.
- Conversation history management with SQLite.
- Configurable bot personality and behavior via a JSON configuration file.
Make sure you have the following installed:
- Python 3.8+
pip(Python package manager)
git clone https://github.com/AgapeThelema/Outworld-AI.git
cd Outworld-AIpip install -r requirements.txtFor development (to run the automated tests) install the additional tooling:
pip install -r requirements-dev.txtimport nltk
nltk.download('punkt')Create a bot_config.json file in the project directory with the following structure:
{
"bot_name": "Outworld",
"bot_prompt": "You are a friendly AI assistant.",
"bot_personality": "Helpful and curious.",
"bot_situation": "Casual conversation."
}Here’s a basic example to run the bot:
from outworld_ai import OutworldGenerator
# Initialize the Outworld Generator
generator = OutworldGenerator(
model='llama3.2',
lang_code='a',
voice='af_heart',
speed=1,
config_path='bot_config.json',
db_path='context_history.db'
)
# Run the bot
response = generator.run(user_id="12345", user_prompt="Hello, what’s the weather today?")
print("Emotion detected:", response["emotion"]["label"])
print("Generated audio data:", response["audio_data"])
print("Text segments:", response["text_segments"])The project now ships with a simple command line interface:
python -m outworld_ai "Hello there!"This CLI uses the same configuration and database files as the Python example above.
Install the development requirements and execute:
pytestA Dockerfile is provided to make containerised deployments easier:
docker build -t outworld-ai .
docker run --rm outworld-aiThe container prints the CLI help by default. Override the command to run a prompt:
docker run --rm outworld-ai python -m outworld_ai "Hello there!"The project now ships with a simple command line interface:
python -m outworld_ai "Hello there!"This CLI uses the same configuration and database files as the Python example above.
Install the development requirements and execute:
pytestA Dockerfile is provided to make containerised deployments easier:
docker build -t outworld-ai .
docker run --rm outworld-aiThe container prints the CLI help by default. Override the command to run a prompt:
docker run --rm outworld-ai python -m outworld_ai "Hello there!"The conversation history is stored in an SQLite database (context_history.db), with the following schema:
CREATE TABLE context_history (
id INTEGER PRIMARY KEY AUTOINCREMENT,
user_id TEXT NOT NULL,
role TEXT NOT NULL,
content TEXT NOT NULL,
timestamp DATETIME DEFAULT CURRENT_TIMESTAMP
);- Ollama for text generation.
- Kokoro for text-to-speech conversion.
- Hugging Face for emotion classification.
This project is licensed under the MIT License. See LICENSE for details.
