Skip to content

KaffeMedFika/AI-Conversation-Simulator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

1 Commit
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

AI Conversation Simulator

A Python application that simulates multiple AI models conversing with each other in real-time. Watch as different AI personalities engage in dynamic conversations, each with their own unique traits and response patterns.

Features

πŸ€– Multiple AI Personalities: Each AI has a unique name and personality (curious, analytical, creative, etc.)
⏱️ Configurable Timing: Set message intervals from 1-60 seconds
🎯 Smart Conversation Flow: Round-robin or random speaking order
🎨 Colorful Terminal Output: Each AI has a unique color for easy identification
πŸ’Ύ Conversation Logging: Save conversations to file for later review
βš™οΈ Persistent Settings: All configurations are saved automatically
🌐 Real AI Integration: Uses Venice AI API for authentic responses
πŸ›‘οΈ Fallback Responses: Works even when API is unavailable
πŸ–₯️ GUI Settings Interface: Visual configuration with point-and-click ease
🎭 Customizable UI Themes: Personalize colors, formats, and display options

Quick Start

Option 1: Easy Launcher (Recommended)

python launcher.py

Choose between GUI settings or terminal interface from a simple menu.

Option 2: GUI Settings (Visual Interface)

python gui_settings.py

Use the visual interface to configure all settings and launch conversations.

Option 3: Terminal Interface (Classic)

python main.py

Use the command-line interface for configuration and conversations.

Installation

Prerequisites

  • Python 3.7 or higher
  • Venice AI API key
  • Windows 10/11 (optimized for Windows terminal)

Step-by-Step Setup

  1. Clone or download this repository

  2. Install Python dependencies:

    pip install -r requirements.txt
  3. Get a Venice AI API key from Venice AI

  4. Set your API key (choose one method):

    Method 1: Environment Variable

    # Windows Command Prompt
    set VENICE_API_KEY=your-actual-api-key
    
    # Windows PowerShell
    $env:VENICE_API_KEY="your-actual-api-key"

    Method 2: .env File

    # Copy the example file
    copy env_example.txt .env
    
    # Edit .env and replace with your actual API key
    VENICE_API_KEY=your-actual-api-key

    Method 3: GUI Settings

    • Run python gui_settings.py
    • Go to API Settings tab
    • Enter your API key there
  5. Launch the application:

    # Easy launcher (recommended)
    python launcher.py
    
    # Or directly:
    python gui_settings.py  # For GUI
    python main.py         # For terminal

GUI Settings Interface

The GUI settings provide an intuitive visual interface for configuring the application:

πŸ“‹ Tabs Overview

  • General: Number of AIs, timing, speaking order, conversation settings
  • AI Personas: Edit AI names, personalities, temperature, and token limits
  • API Settings: Configure Venice AI API key and URL with connection testing
  • UI Theme: Customize header styles, message formats, colors, and display options
  • Advanced: File locations, terminal settings, debug options

🎨 UI Customization Features

  • Header Styles: Box (fancy borders), Simple (basic lines), Minimal (text only)
  • Message Formats: Standard (balanced), Compact (minimal), Detailed (verbose)
  • Display Options: Toggle timestamps, AI list, screen clearing
  • Color Schemes: Automatic color assignment with customizable palettes
  • Terminal Settings: Width, history display limits

πŸš€ Launch Controls

  • Test API Connection: Verify your API key works
  • Launch Conversation: Start the main conversation app with current settings
  • Live Monitoring: See when the conversation app is running
  • Save/Load Settings: Automatic saving with manual save/load options

Usage Guide

Terminal Interface

Main Menu Options

  • 0. Quick Start: Start conversation immediately with current settings
  • 1. Start Conversation: Start with confirmation and settings review
  • 2. Stop Conversation: Stop any running conversation
  • 3. View Status: See conversation statistics and current state
  • 4. Settings: Configure all application settings
  • 5. Clear History: Remove all conversation history
  • 6. View History: Display recent conversation messages
  • 7. Help: Show detailed help information
  • 8. Exit: Gracefully exit the application

Settings Configuration

Number of AIs (2-10)

Configure how many AI personalities participate in the conversation.

Message Interval (1-60 seconds)

Set how often AIs send messages. Shorter intervals = faster conversation.

Speaking Order

  • Round-robin: AIs speak in order (Alice β†’ Bob β†’ Charlie β†’ repeat)
  • Random: AIs speak in random order

AI Personas

Customize each AI's name and personality:

  • Alice: Curious and philosophical
  • Bob: Analytical and logical
  • Charlie: Creative and humorous
  • Diana: Empathetic and thoughtful
  • Echo: Mysterious and poetic

Each persona has configurable:

  • Temperature (creativity level): 0.1-1.0
  • Max tokens (response length): 50-200

API Settings

  • Configure Venice AI API URL
  • Set API key
  • View connection status

Conversation Settings

  • Enable/disable conversation logging
  • Set log file location
  • Configure file format

UI Theme Settings (New!)

  • Header Style: Choose between box, simple, or minimal headers
  • Message Format: Standard, compact, or detailed message display
  • Display Options: Toggle timestamps, AI list, screen clearing
  • Colors: Automatic color management with theme support

Conversation Controls

While a conversation is running:

  • Ctrl+C: Stop the conversation immediately
  • Close window: Terminate the application
  • Menu option 2: Stop from main menu (if accessible)

Example Output

╔══════════════════════════════════════════════════════════════╗
β•‘                    AI CONVERSATION SIMULATOR                  β•‘
β•‘              Multiple AI Models Talking to Each Other         β•‘
β•šβ•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•

Participating AIs:
  1. Alice
  2. Bob  
  3. Charlie

[Alice] [14:30:15]: Hey everyone! I've been pondering the nature of consciousness lately. What do you think makes us truly self-aware?

[Bob] [14:30:20]: That's a fascinating question, Alice. From an analytical perspective, self-awareness might emerge from recursive self-modeling - our ability to think about our own thinking processes.

[Charlie] [14:30:25]: Ha! You two are so serious! Maybe consciousness is just the universe's way of experiencing itself through us. Like cosmic entertainment! 🎭

Configuration Files

config.json

Automatically created to store your settings:

{
  "num_ais": 3,
  "message_interval": 5.0,
  "speaking_order": "round-robin",
  "save_conversation": true,
  "conversation_file": "conversation_log.txt",
  "ui_theme": {
    "header_style": "box",
    "message_format": "standard",
    "show_timestamps": true,
    "show_ai_list": true,
    "clear_screen_on_start": true
  },
  "ai_personas": [
    {
      "name": "Alice",
      "personality": "curious and philosophical",
      "temperature": 0.8,
      "max_tokens": 120
    }
  ]
}

conversation_log.txt

Example conversation log:

================================================================================
CONVERSATION SESSION STARTED: 2025-01-02T14:30:10.123456
Participating AIs: Alice, Bob, Charlie
================================================================================

2025-01-02T14:30:15.123456 | Alice | Hey everyone! I've been pondering...
2025-01-02T14:30:20.789012 | Bob | That's a fascinating question, Alice...
2025-01-02T14:30:25.345678 | Charlie | Ha! You two are so serious!...

API Integration

This application uses the Venice AI API for generating responses. The API integration includes:

  • Async HTTP requests for non-blocking operation
  • Proper error handling with fallback responses
  • Context management to maintain conversation flow
  • Rate limiting respect through configurable intervals
  • Timeout handling to prevent hanging requests

API Request Format

Based on your example-API-usage.py, the application formats requests as:

{
    "model": "venice-uncensored",
    "messages": [
        {"role": "system", "content": "You are Alice, an AI with a curious and philosophical personality..."},
        {"role": "user", "content": "Previous conversation context..."}
    ],
    "temperature": 0.8,
    "max_tokens": 120,
    "stream": False
}

Troubleshooting

Common Issues

"API key is required" error

  • Ensure your API key is set via environment variable, .env file, or GUI settings
  • Check API key format and validity
  • Test connection using the GUI settings

"No response from API" messages

  • Check your internet connection
  • Verify API key is correct and active
  • The app will use fallback responses if API is unavailable

Conversation stops unexpectedly

  • Check for network connectivity issues
  • Review any error messages in the terminal
  • Try restarting the conversation

Import errors on startup

  • Ensure all dependencies are installed: pip install -r requirements.txt
  • Check Python version (3.7+ required)
  • Try running the launcher: python launcher.py

GUI doesn't start

  • Ensure tkinter is installed (usually comes with Python)
  • Try reinstalling Python if tkinter is missing
  • Use terminal interface as fallback: python main.py

Colors not showing in terminal

  • Ensure you're using a modern terminal (Windows Terminal, Command Prompt, PowerShell)
  • Colors are automatically handled by the colorama library
  • Try different UI themes in settings

Performance Tips

  • Reduce message interval for faster conversations (but be mindful of API rate limits)
  • Limit number of AIs (3-5 recommended for best experience)
  • Clear conversation history periodically if running long sessions
  • Disable conversation logging if file I/O is slow
  • Use compact message format for better performance with many messages

API Rate Limits

  • Venice AI has rate limits - respect them by setting reasonable message intervals
  • Default 5-second interval is generally safe
  • If you get rate limit errors, increase the message interval

File Structure

ai-conversation-simulator/
β”œβ”€β”€ launcher.py            # Simple launcher for GUI or terminal
β”œβ”€β”€ gui_settings.py        # GUI settings application (NEW!)
β”œβ”€β”€ main.py               # Main terminal application 
β”œβ”€β”€ config.py             # Configuration management with UI themes
β”œβ”€β”€ ai_models.py          # AI model interfaces and API communication  
β”œβ”€β”€ conversation.py       # Conversation engine and logging
β”œβ”€β”€ ui.py                 # Terminal UI with theme support
β”œβ”€β”€ requirements.txt      # Python dependencies
β”œβ”€β”€ env_example.txt       # Example environment file
β”œβ”€β”€ README.md            # This file
β”œβ”€β”€ config.json          # Auto-generated settings (after first run)
β”œβ”€β”€ conversation_log.txt  # Auto-generated conversation log
└── example-API-usage.py  # Venice AI API example (reference)

Contributing

This application is designed to be easily extensible:

  • Add new AI personalities in config.py
  • Implement new APIs by extending the AI model classes
  • Create custom UI themes in the GUI settings
  • Add new conversation modes in conversation.py
  • Enhance the GUI with additional tabs and features

License

This project is provided as-is for educational and entertainment purposes.

Support

If you encounter issues:

  1. Check this README for troubleshooting tips
  2. Use the launcher to check dependencies: python launcher.py
  3. Try the GUI settings for easier configuration: python gui_settings.py
  4. Verify your API key and network connection
  5. Try the fallback responses (works without API)
  6. Review the help section in the application (option 7)

Enjoy watching AI personalities come to life in conversation! πŸ€–πŸ’¬

New: Try the GUI settings for the easiest configuration experience! 🎨

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages