古诗词ppt讲解助手
| Files | Last commit | Last update |
|---|---|---|
| 1 year ago | ||
| 1 year ago | ||
| 1 year ago | ||
| 1 year ago | ||
| 6 months ago | ||
| 1 year ago | ||
| 1 year ago |
PPTAssistant: Dongpo Jushi AI Assistant
Project Introduction
PPTAssistant is a desktop application developed based on PyQt5 and OpenAI API, simulating conversations with Su Dongpo. Users can input questions to receive answers in the style of Dongpo Jushi, while also supporting font size adjustment and custom role settings.
Project Screenshots
Features
- Role Play: Engage in conversation as Su Dongpo, adhering to the expression style of Song Dynasty literati.
- Conversation History: Real-time display of dialogue content, supporting scrolling through history.
- Font Size Adjustment: Users can easily switch font sizes to enhance reading experience.
- Custom Role Settings: Users can modify the AI's role settings via the settings dialog.
- Hotkey Support: Supports
Ctrl+Enterhotkey for sending messages, improving input efficiency. - Borderless Window: Supports borderless window display, allowing window dragging and moving.
Usage Instructions
-
Install Dependencies
- Ensure Python 3.8 or higher is installed.
- Install PyQt5 and OpenAI SDK:
pip install PyQt5 openai
-
Run the Program
- Save the code as
main.py, then run the following command to start the application:python main.py
- Save the code as
-
User Guide
- After entering a question, click "Send" or press the
Ctrl+Enterhotkey. - Click the "⚙️ Settings" button to modify the AI's role settings.
- Click the "Aa Font" button to adjust the font size.
- Click the "⨉ Close" button to exit the application.
- After entering a question, click "Send" or press the
Project Structure
- PPTAssistant Class
- Main window class, responsible for UI layout and event handling.
- AISettingsDialog Class
- Role settings dialog, used to modify the AI's role settings.
- Core Function Modules
- Contains core functions such as font size adjustment and role setting updates.
Important Notes
- API Key: Replace the
api_keyin the code with your own OpenAI API key. - Resource Path: Ensure the
resourcefolder contains thecharacter.pngimage file. - Network Issues: If unable to connect to the OpenAI API, check the network connection or the validity of the API key.
Example
Dialogue Example
User: Mr. Dongpo, what is your view on modern technology?
Dongpo Jushi: Although I was born in the Song Dynasty, observing today's technology, it is truly astonishing. However, I also know that all things in the world have their limitations. While technology can change life, one must not forget ancient wisdom.
Font Size Adjustment
Users can cycle through font sizes (18px -> 22px -> 26px -> 18px) by clicking the "Aa Font" button to adapt to different reading needs.
Thank you for your support!