- Project Overview
- Screenshots
- Features
- Project Structure
- Configuration Files
- GUI Features
- Setup and Installation
- Running the Application
- Adding and Editing Personalities
- Extending the Application
- Error Handling and Logging
- Testing
- Performance Considerations
- Security Considerations
- Developer Information
The AI Conversation GUI Application is an advanced, interactive graphical user interface that facilitates conversations with multiple AI personalities using state-of-the-art language models. It manages complex conversation flows, provides a rich visual interface for user interactions, and offers various features for customization and analysis of AI-driven conversations.
- Multi-AI personality conversations
- Real-time conversation visualization
- Customizable user interface
- Conversation history management
- Topic generation and tracking
- Moderator summaries
- Email integration for sharing conversations
- Extensible AI configurations
- Advanced error handling and logging
- GUI for editing AI personalities and configurations
The project consists of the following key Python files:
convo.py
: Main entry point of the applicationconvo_gui.py
: Contains the AIConversationGUI class for the graphical interfaceconversation_manager.py
: Manages conversation history and AI interactionspersonalities.py
: Defines AI personalities and their characteristicsai_config.py
: Configuration for AI models and related settingsConversationHistoryWindow.py
: Manages the conversation history displayEditPersonalities.py
: GUI for editing AI personalitiesEditAIConfigs.py
: GUI for editing AI configurationsEditHelperPersonalities.py
: GUI for editing helper personalitiesVisualizer.py
: Handles visualization of conversation dataConversationRAG.py
: Implements the Retrieval-Augmented Generation systemschema.py
: Defines data structures for conversation historygoogle_api.py
: Handles Google API integration for email functionalityApplicationContext.py
: Manages global application context and cleanupai_conversation_cli.py
: Command-line interface for the applicationrequirements.txt
: Lists all required Python packages
The application uses several configuration files to manage settings and data:
Stores API keys for various AI services:
openai_key = "your_openai_api_key_here"
gemini_key = "your_gemini_api_key_here"
anthropic_key = "your_anthropic_api_key_here"
Stores user preferences for the GUI:
{
"font_family": "Arial",
"font_size": 12,
"user_color": "#58a6ff",
"ai_color": "#58a6ff",
"system_color": "#7ee787",
"conversation_font_color": "#c9d1d9",
"conversation_background_color": "#0d1117"
}
Stores the conversation history:
{
"thread_id": {
"date": "YYYY-MM-DD HH:MM:SS",
"topic": "Conversation Topic",
"messages": [
{
"sender": "Participant Name",
"message": "Message content",
"ai_name": "AI Model Name",
"model": "Model Identifier",
"is_partial": false,
"is_divider": false,
"timestamp": "YYYY-MM-DDTHH:MM:SS.mmmmmm"
}
]
}
}
These files are used for Google API authentication for email functionality.
The application offers a rich set of GUI features:
- Multi-pane Interface: Main conversation display, participant selection, and control panel
- Conversation Display: Shows messages from all participants with color-coding
- Participant Selection: Allows users to choose which AI personalities to include in the conversation
- Control Panel: Provides buttons for various functions like changing fonts, colors, and accessing different features
- New Topic Generation: Allows starting a new conversation topic
- Moderator Summaries: Generates summaries of the current conversation
- Conversation History: Displays past conversations with search and filter capabilities
- Email Integration: Allows sending conversation summaries via email
- Personality Editing: GUI for customizing AI personalities and their characteristics
- AI Configuration Editing: Interface for modifying AI model configurations
- Helper Personality Editing: Customization of special helper AIs like the topic generator and moderator
- Real-time Visualization: Dynamic graph showing the relationships between conversation topics and participants
- Token Usage Display: Shows the current token usage for API calls
- Theme Customization: Allows changing fonts, colors, and overall theme of the application
-
Clone the repository:
git clone https://github.com/jkeen871/ai-conversation-gui.git cd ai-conversation-gui
-
Install required packages:
pip install -r requirements.txt
-
Set up API keys in
keys.py
. -
Configure Google API credentials for email functionality.
Run the application using:
python convo.py
-
For AI Personalities:
- Click on the "Edit AI Personalities" button in the control panel.
- In the new window, click "Add New Personality" to create a new AI personality.
- Fill in the details: Name, System Message, AI Name (model), and Color.
- Click "Save Changes" to add the new personality.
-
For Helper Personalities:
- Click on the "Edit Helper Personalities" button in the control panel.
- Follow a similar process as AI personalities to add or edit helper personalities.
-
For AI Configurations:
- Click on the "Edit AI Configs" button to modify AI model settings.
You can also add or edit personalities by directly modifying the personalities.py
file:
- Open
personalities.py
in a text editor. - Locate the
AI_PERSONALITIES
orHELPER_PERSONALITIES
dictionary. - Add a new entry or modify an existing one.
- AI Personality Example:
"Dyann": {
"name": "Dyann",
"system_message": "You are Dyann, a conservative-leaning AI with expertise in interior design and ancient history...",
"ai_name": "anthropic",
"color": "blue",
"character": "𝍄"
},
- Helper Personality Example:
"TopicGenerator": {
"name": "TopicGenerator",
"system_message": "You are the TopicGenerator. Your task is to generate a short, concise topic based on the conversation context provided...",
"ai_name": "anthropic",
"color": "cyan",
},
- AI Configuration Example:
"anthropic": {
"model": "claude-3-opus-20240229",
"generate_func": anthropic_generate,
},
When adding personalities manually, ensure that you follow the existing structure and include all necessary fields. After making changes, restart the application for them to take effect.
To add new features or AI personalities:
- Update
AI_PERSONALITIES
orHELPER_PERSONALITIES
inpersonalities.py
. - Add new AI model configurations in
ai_config.py
if necessary. - Implement new UI components in
convo_gui.py
. - Extend the
ConversationManager
class inconversation_manager.py
for new conversation management features. - Update the various editing classes (
EditPersonalities
,EditAIConfigs
,EditHelperPersonalities
) to allow editing of new configurations through the GUI.
- Comprehensive error handling is implemented throughout the application.
- Detailed logging is set up in
convo.py
and used across all files. - Logs are written to 'log/app.log' for debugging and troubleshooting.
- The GUI displays error messages to the user when appropriate.
- Implement unit tests for individual components (e.g., ConversationManager methods, AIConversationGUI methods).
- Create integration tests to ensure proper interaction between different modules.
- Perform end-to-end testing of the entire conversation flow through the GUI.
- Use PyQt's testing utilities for GUI-specific tests.
- The application uses asynchronous programming to handle concurrent operations efficiently.
- Consider implementing caching mechanisms for frequently accessed data or AI responses.
- Monitor and optimize AI model API usage to manage costs and improve response times.
- Use PyQt's built-in optimization techniques, such as lazy loading for UI components.
- Ensure proper handling and storage of API keys and sensitive configuration data.
- Implement input validation and sanitization to prevent potential security vulnerabilities.
- Consider implementing user authentication if extending the application for multi-user scenarios.
- Use secure methods for storing and retrieving user preferences and conversation history.
- Name: Jerry Keen
- Contact Email: jkeen871@gmail.com
For any questions, suggestions, or contributions, please feel free to contact the developer.