AI Talking is a powerful AI conversation system that supports single chat, discussion, debate, and other modes, with both desktop and web application deployment options.
The project consists of three main parts:
-
AI_Talking - New desktop application with MVC architecture, modular code, supporting single chat, discussion, debate, and batch processing modes
- Developed with PyQt5 framework for GUI
- Supports OpenAI, DeepSeek, and Ollama APIs
- Modular design with clear code structure
- Supports multi-turn conversations and history management
-
AI_Talking_Web - Web application with separated front-end and back-end, supporting online use
- Front-end developed with TypeScript
- Back-end using FastAPI framework
- Supports real-time AI conversations and discussions
- Provides complete API documentation
-
Chat2Chat - Old desktop application with single-file architecture, complete functionality, suitable for quick deployment and use
- Lightweight design, easy to use
- Supports basic AI conversation functions
- Suitable for simple scenarios
- π¬ Single Chat Mode: One-on-one chat with AI, supporting multiple AI models and APIs
- π Discussion Mode: Two AIs conduct in-depth discussions on specified topics
- βοΈ Debate Mode: Two AIs engage in structured debates on specified topics
- π History Management: View, edit, copy, delete, and manage chat history, supporting batch operations
- π§ API Configuration: Unified management of multiple API keys and system prompts
- π Batch Processing: Support batch processing of multiple discussion topics to improve efficiency
- π About Us: View application version and development team information
- π Internationalization Support: Support multiple language interfaces, freely switchable
- π Modern Architecture: Desktop application adopts MVC architecture, web application adopts front-end and back-end separation
- π Multi-API Support: Supports OpenAI, DeepSeek, and Ollama APIs
- π¨ Friendly Interface: Intuitive and easy-to-use graphical user interface, supporting multiple themes
- π± Cross-Platform: Supports Windows, macOS, and Linux
- π Secure and Reliable: Perfect error handling and resource management
- π High Performance: Optimized API calls and resource management
- π§ͺ Comprehensive Testing: Includes unit tests, integration tests, and UI tests
cd AI_Talking
pip install -r ../requirements.txtcd AI_Talking
python src/main.pyWindows users can directly run the run_app.bat script to start the application.
cd AI_Talking_Web
python start_server.pycd AI_Talking_Web
python backend/main.pycd AI_Talking_Web
npm install
npm run devcd AI_Talking_Web
npm run buildcd Chat2Chat
python chat_gui.py- After starting the application, click the "API Settings" tab
- Configure the required API keys and system prompts
- Click the "Save Settings" button
- Access the web application
- Click the "Settings" tab
- Configure the required API keys and system prompts
- Click the "Save Settings" button
You can also directly edit the .env file to configure API keys. The project root directory provides a .envδ½Ώη¨θ―΄ζ.md file that details the usage of each configuration item.
# Ollama API Settings
OLLAMA_BASE_URL=http://localhost:11434
# OpenAI API Settings
OPENAI_API_KEY=your_openai_api_key
# DeepSeek API Settings
DEEPSEEK_API_KEY=your_deepseek_api_key
# Chat System Prompt Settings
CHAT_SYSTEM_PROMPT=
# Discussion System Prompt Settings
DISCUSSION_SYSTEM_PROMPT=
DISCUSSION_AI1_SYSTEM_PROMPT=
DISCUSSION_AI2_SYSTEM_PROMPT=
# Debate System Prompt Settings
DEBATE_SYSTEM_PROMPT=
DEBATE_AI1_PROMPT=
DEBATE_AI2_PROMPT=
# Expert AI3 System Prompt
EXPERT_AI3_SYSTEM_PROMPT=
# Judge AI3 System Prompt
JUDGE_AI3_SYSTEM_PROMPT=
- Select the "Chat" tab
- Choose AI model and API type
- Enter your question or message
- Click the "Send" button
- Wait for AI response
- Select the "Discussion" tab
- Enter discussion topic
- Choose two AI models and API types
- Set discussion rounds and temperature parameters
- Click the "Start Discussion" button
- View discussion process and results
- Select the "Debate" tab
- Enter debate topic
- Choose two AI models and API types (pro and con sides)
- Set debate rounds and temperature parameters
- Click the "Start Debate" button
- View debate process and results
- Select the "Batch Processing" tab
- Enter multiple discussion topics, one per line
- Choose AI model and API type
- Set discussion parameters
- Click the "Start Processing" button
- View processing results
- Select the "History" tab
- Browse history list
- Click a record to view details
- You can delete selected records or clear all records
- Select the "API Settings" tab
- Enter API keys and system prompts
- Click the "Save Settings" button
- Select the "About Us" tab
- View application version and development team information
| Technology | Purpose |
|---|---|
| Python | Main programming language |
| PyQt5 | GUI framework for building desktop interfaces |
| FastAPI | Backend API service |
| requests | HTTP request handling |
| python-dotenv | Environment variable management |
| markdown | Markdown rendering |
| pytest | Testing framework |
| Black | Code formatting |
| Technology | Purpose |
|---|---|
| TypeScript | Frontend development language |
| FastAPI | Backend framework |
| Axios | HTTP request library |
| Marked | Markdown rendering |
| live-server | Development server |
| Swagger UI | API documentation generation |
The web application provides complete API documentation, which can be accessed in the following ways:
- Swagger UI:
http://localhost:8000/docs - ReDoc:
http://localhost:8000/redoc
- π Auto-retry: Automatically retry failed API calls to improve reliability
- β‘ Rate limiting: Dynamically adjust request frequency based on error rate
- π₯ Batch requests: Combine multiple API requests to reduce network overhead
- π§Ή Resource cleanup: Timely cleanup of unused resources
- π§΅ Thread pool: Use thread pool to manage threads, avoiding too many threads
- π¦ Context manager: Safe resource management
- π Secure storage: Encrypted storage of API keys
- β Input validation: Strict validation of all inputs
- π‘οΈ CORS configuration: Reasonable cross-domain access configuration
- π¦ Request throttling: Prevent API abuse
- π Data encryption: Encrypted storage of sensitive data
- π Access control: Strict access control
- π Secure logging: No sensitive information in logs
- π Leveled logging: Supports DEBUG, INFO, WARNING, ERROR, CRITICAL five levels
- π Detailed format: Includes time, level, module name, message content
- πΎ File storage: Logs saved to files for easy analysis and debugging
- π¦ Log rotation: Automatically manages log file size to prevent excessive disk space usage
- π Error statistics: Statistics of error types and quantities
β οΈ Error alerts: Automatic alerts when error rate exceeds threshold- π Error analysis: Detailed error information for easy problem locating
- Python: Use Black for code formatting, follow PEP8 specifications
- TypeScript: Use TypeScript compiler for type checking, follow TypeScript best practices
- Use pre-commit hooks to automatically check code style
- Unit tests: Test the functionality of individual modules, located in the
testsdirectory - Integration tests: Test interactions between modules to ensure overall system functionality
- UI tests: Test user interface interactions and responses
cd AI_Talking
python -m PyInstaller --onefile --windowed --icon=../resources/icon.ico src/main.pycd AI_Talking_Web
npm run buildThe project adopts a layered architecture design. For detailed architecture information, please refer to the ARCHITECTURE.md file.
| Version | Description |
|---|---|
| v1.0 | Initial version, supporting basic AI discussion functionality |
| v2.0 | Refactored to MVC architecture, added debate and single chat modes |
| v3.0 | Added web application, supporting front-end and back-end separation |
| v4.0 | Optimized performance, added error monitoring and resource management |
| v5.0 | Improved test cases, added batch processing functionality, optimized user interface |
- π Multi-language Support: Support multiple language interfaces
- βοΈ Cloud Synchronization: Cloud synchronization of chat history, supporting multi-device access
- π Plugin System: Support plugin extensions to enhance functionality
- π± Mobile Optimization: Better mobile experience
- ποΈ Voice Conversation: Support real-time voice conversation
- π¨ Theme Customization: Support custom themes and styles
- π Data Analysis: Dialogue data analysis and visualization
- π― AI Fine-tuning: Support model fine-tuning to improve dialogue quality
Welcome to submit Issues and Pull Requests! Contribution guidelines are as follows:
- Fork this repository
- Create a feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
This project is licensed under the MIT License. For details, please see the LICENSE file.
- Development Team: NONEAD Corporation
- Contact Email: support@nonead.com
- Project Address: https://github.com/NoneadChina/AI_Talking
Thanks to all developers and users who have contributed to this project!