Skip to content

feat(ai): add Google Gemini API key support to QUILL Lite and fix Gemini endpoint URLs - #1615

Open
salorajan wants to merge 8 commits into
Community-Access:mainfrom
salorajan:feat/gemini-api-key-support
Open

salorajan wants to merge 8 commits into
Community-Access:mainfrom
salorajan:feat/gemini-api-key-support

Conversation

@salorajan

Copy link
Copy Markdown
Contributor

Summary

This PR adds full Google Gemini API key support to QUILL Lite 2.0 and resolves Gemini endpoint routing bugs.

🐛 Bug Fixes

  1. Duplicate \models/\ in API Endpoints: Google Gemini's /v1beta/models\ endpoint returns model IDs prefixed with \models/\ (e.g. \models/gemini-2.5-flash). Directly interpolating this into /v1beta/models/{model}:generateContent\ created invalid URLs like /v1beta/models/models/gemini-2.5-flash:generateContent. Added .removeprefix('models/')\ across endpoint URL builders and model listing utilities.
  2. Hardcoded OpenAI Provider in QUILL Lite BYOK: \quill/core/ai/own_key.py\ was hardcoded to OpenAI only, ignoring \GEMINI_API_KEY\ set in the environment or .env. Added multi-provider support (\OWN_KEY_PROVIDERS = ('openai', 'gemini')), provider auto-detection, and provider fallback resolution.
  3. Environment & .env Key Resolution: Enhanced \environment_api_key('gemini')\ with clean .env\ file discovery.
  4. Gemini Model Ordering & Pricing: Added Gemini model ranking (\gemini-2.5-flash, \gemini-2.5-pro, \gemini-2.0-flash, etc.), tiered pricing estimates, and pricing URL references.

🧪 Testing & Verification

  • Unit Tests: 18 passing tests in \ ests/unit/core/ai/\ (including new \ est_own_key_gemini.py).
  • Live Feature Verification: All 19 AI writing features (Summarize, Rewrite, Proofread, Explain, Ask, Document Q&A, Shorten, Simplify, Formal, Friendly, Make List, Action Items, Headings, Continue, Tidy Dictation, Multi-Turn Chat, Translate, SSE Streaming, and Audio Modality) were tested and verified against Google Gemini's live API with rate-pacing.
  • Detailed audit and test report documented in
    eport.md.

…ini endpoint URLs

- Fix duplicate 'models/' prefix in Gemini API endpoints (/v1beta/models)
- Add multi-provider support (OpenAI & Gemini) to own-key AI assistance
- Add provider auto-detection, fallback resolution, and .env key discovery
- Add Gemini flagship model ordering, pricing tiers, and choice labels
- Add provider selection in Own Key Settings UI
- Add comprehensive unit tests (tests/unit/core/ai/test_own_key_gemini.py)
- Add live feature verification test suite (tests/test_gemini_live_features.py)
- Add audit and verification report.md
…ailures

- Fix GATE-11 module size budget limits in assistant_ai.py, hosted_ai_service.py, and hosted_ai_commands.py without raising budgets
- Update accessible name and lite help inventory snapshots and F1 help reference for OwnKeyDialog provider choice
- Fix ruff lint formatting and line length constraints across AI modules
- Add ai_own_key_provider and ai_own_key_model to lite parity table
- Clean up root directory files to conform to repository layout rules
accesswatch pushed a commit that referenced this pull request Oct 2, 2026
…nd QUILL Lite (X-07)

Use My Own AI Key (the row was Use My Own OpenAI Key; Alt+F2 in both editors)
opens on a Provider list, OpenAI or Google Gemini, and everything under it
follows the choice: where the text goes and where keys are made, the key
field, that account's own models with that company's prices, Test the Key,
Remove. The provider is saved as ai_own_key_provider in both settings files
and own_key.provider_for is its only source: own_key_active, ask_with_own_key,
size_warning and the service route take it; a key saved for the other
provider is reported in the status line and never used. PR #1615's inference
from model names and fallback to whichever key exists are not taken, by
decision. Ask About an Image works on a Gemini key through the shared vision
client. The service's own-key properties move to hosted_ai_own_key_route.py.

Tests: tests/unit/core/ai/test_own_key_gemini.py drives the shipped client
against a Gemini-shaped loopback server with a synthetic key; the own-key,
dialog, route and Lite AI suites follow the provider argument. Docs: both
user guides and the Lite AI guide, QUILL PRD 5.59f, both changelogs, the Lite
1.1 release notes; settings, help and keyboard references regenerated.
qc.md: X-07 closed, X-08 (PR #1618 review) added, counts recomputed.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>

This branch has not been deployed

No deployments
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