Skip to content

Conversation

@andrewphilipsmith
Copy link
Contributor

No description provided.

@andrewphilipsmith andrewphilipsmith marked this pull request as ready for review May 16, 2025 14:46
@andrewphilipsmith andrewphilipsmith requested a review from Copilot May 16, 2025 14:46
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR enhances the Gemini integration to capture and return the model’s intermediate “thoughts” alongside its final answer, refactors client management for model-specific API keys, and updates media upload/settings helpers.

  • Introduce _process_answer_and_thoughts, process_thoughts, and record thinking_text in all query paths
  • Add _get_client to cache google.genai.Client instances per model and derive ThinkingConfig
  • Refactor media-upload scripts to synchronous APIs and add _create_settings

Reviewed Changes

Copilot reviewed 12 out of 12 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
src/prompto/apis/gemini/gemini_utils.py Extract thoughts, consolidate response parsing
src/prompto/apis/gemini/gemini.py Use new client API, record thinking_text
src/prompto/apis/gemini/gemini_media.py Refactor upload/delete/list to sync, rename
src/prompto/upload_media.py Add _create_settings, remove async runner
tests/apis/gemini/… Expand tests for reasoning, update mocks
pyproject.toml Reorder/sync dependencies
Comments suppressed due to low confidence (1)

src/prompto/apis/gemini/gemini_media.py:108

  • Variable name genmini_api looks like a typo. Rename to gemini_api for consistency.
genmini_api = GeminiAPI(settings=settings, log_file=None)

@codecov-commenter
Copy link

codecov-commenter commented May 16, 2025

Codecov Report

❌ Patch coverage is 93.61702% with 9 lines in your changes missing coverage. Please review.
✅ Project coverage is 67.80%. Comparing base (227ed0d) to head (4511cf0).
⚠️ Report is 3 commits behind head on main.

Files with missing lines Patch % Lines
src/prompto/upload_media.py 56.25% 7 Missing ⚠️
src/prompto/apis/gemini/gemini.py 97.10% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #124      +/-   ##
==========================================
+ Coverage   65.09%   67.80%   +2.70%     
==========================================
  Files          44       44              
  Lines        2679     2733      +54     
==========================================
+ Hits         1744     1853     +109     
+ Misses        935      880      -55     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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.

4 participants