Skip to content

Deep thinking mode#1

Open
VelmoAI wants to merge 2 commits intorefactor/async-api-callsfrom
deep-thinking-mode
Open

Deep thinking mode#1
VelmoAI wants to merge 2 commits intorefactor/async-api-callsfrom
deep-thinking-mode

Conversation

@VelmoAI
Copy link
Copy Markdown
Owner

@VelmoAI VelmoAI commented Jul 3, 2025

No description provided.

This commit introduces a new 'Deep Thinking Panel' to the Gemini Desktop Agent.

Features:
- A new QTextEdit panel (`deep_thinking_panel`) is added to the UI, displayed alongside the main chat and context panels.
- The panel shows raw responses or detailed information from the Gemini API for both successful results and errors. This provides insight into the AI's processing.
- A toggle button ('Toggle Deep Thinking Panel') is added to the left panel, allowing users to show or hide this new panel as needed.
- Splitter sizes have been adjusted to accommodate the new panel.
- `handle_gemini_finished` and `handle_gemini_error` methods were updated to populate the deep thinking panel.
This commit introduces a multi-step deep thinking process for the Gemini Desktop Agent, allowing users to see the AI's reasoning process.

Features:
- Added a 'Enable Multi-Step Thinking' checkbox to the UI. When checked, Gemini will first generate initial thoughts and then a refined answer.
- `GeminiRunnable` now includes a `thinking_step` parameter.
- `process_gemini_query` is updated to:
    - Check the multi-step thinking checkbox.
    - Modify the initial prompt to ask for step-by-step thoughts if multi-step is enabled.
    - Manage `thinking_step`, `max_thinking_steps`, and `accumulated_thoughts` in `current_iteration_data`.
- `handle_gemini_finished` is updated to:
    - Display intermediate thoughts in the `deep_thinking_panel` for each step.
    - Construct new prompts for refinement steps (e.g., "Previous thoughts: ... Now refine...").
    - Trigger subsequent calls to `process_gemini_query` for each thinking step.
    - Ensure plugin calls are handled within the context of the current thinking step.
    - Display only the final refined answer in the main chat area when multi-step is enabled.
- `handle_gemini_error` now logs errors with thinking step information in the `deep_thinking_panel` and provides a user-facing error in the main chat.
- The `deep_thinking_panel` now clearly delineates between different thinking steps and displays full response objects for each stage.
- WorkerSignals and relevant slots updated to pass `thinking_step`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant