Skip to content

feat(windows): add Google Gemini chat provider support - #166

Open
AlphaIsYour wants to merge 1 commit into
Louis-CFM:mainfrom
AlphaIsYour:feat/windows-gemini-provider
Open

AlphaIsYour wants to merge 1 commit into
Louis-CFM:mainfrom
AlphaIsYour:feat/windows-gemini-provider

Conversation

@AlphaIsYour

Copy link
Copy Markdown

Summary

Adds Google Gemini as an alternative chat provider in the Windows and Linux Tauri build, aligning with the macOS implementation.

Closes #75

Motivation

On macOS, Coucou already supports Google AI / Gemini alongside Claude, using Google's OpenAI-compatible endpoint. On Windows and Linux, however, the chat was hardcoded to Anthropic only. Users without an Anthropic API key can now interact with Mochi using their Google Gemini API key (including the free tier available via Google AI Studio).

Key Changes

  • windows/src-tauri/src/gemini.rs:
    • Implemented the Gemini chat client using the official OpenAI-compatible endpoint (https://generativelanguage.googleapis.com/v1beta/openai/chat/completions).
    • Preserved multi-turn conversation context and supported image and document file attachments.
    • Added unit tests for default model configuration and system prompt constraints.
  • windows/src-tauri/src/secrets.rs:
    • Added google-api-key to KNOWN_KEYS (stored securely in Windows Credential Manager / Secret Service, never written to disk).
  • windows/src-tauri/src/settings.rs & windows/src-tauri/src/lib.rs:
    • Added chat_provider (default: "anthropic") and google_model (default: "gemini-2.0-flash") with serde defaults to preserve backward compatibility for existing configurations.
    • Routed chat_send dynamically based on the configured provider.
  • windows/src/core/state.ts & windows/src/settings/main.ts:
    • Added provider selector (Claude (Anthropic) vs Google Gemini) under Settings.
    • Added Gemini API key input and model selector (gemini-2.5-pro, gemini-2.0-flash, gemini-2.0-flash-lite, gemini-1.5-flash, gemini-1.5-pro).

Testing

  • cargo test: all 10/10 tests passing (including new Gemini unit tests).
  • cargo check --release: passes with no warnings.
  • tsc --noEmit: 0 errors.
  • npm run build: built production bundle cleanly in ~2s.
  • Tested on Windows 11.

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.

Support for other LLM's like Gemini

1 participant