Skip to content

feat: add OpenAI and Gemini LLM providers#15

Open
aditya-gupta-dev wants to merge 2 commits into
JayWebtech:mainfrom
aditya-gupta-dev:feat/openai-gemini-providers
Open

feat: add OpenAI and Gemini LLM providers#15
aditya-gupta-dev wants to merge 2 commits into
JayWebtech:mainfrom
aditya-gupta-dev:feat/openai-gemini-providers

Conversation

@aditya-gupta-dev

Copy link
Copy Markdown

Adds OpenAI and Google Gemini as cloud moment-detection providers, alongside the existing DeepSeek / Claude / Ollama.

Part of #5. Starting with these two; Groq, OpenRouter, and xAI can follow the same pattern in later PRs.

Changes

Backend (src-tauri/)

  • llm.rs: new detect_candidates_with_openai and detect_candidates_with_gemini, following the existing per-provider pattern (own response
    structs, shared compact_segments + parse_candidate_json helpers, same prompt).
  • lib.rs: "openai" / "gemini" arms in generate_candidates (key + model resolved from arg → env → default), and has_openai_key /
    has_gemini_key in environment_status.
  • models.rs: two new EnvironmentStatus fields.
  • .env.example: OPENAI_API_KEY, GEMINI_API_KEY.

Frontend (src/main.tsx)

  • OpenAI / Gemini in the LLM Engine dropdown, onboarding cloud form, and status bar.
  • Per-provider API key + free-text model selection, persisted to localStorage.
  • Key/model threaded through the generate_candidates calls; provider-aware warning labels.

Also: fixes an invalid "\:" string escape in build_drawtext_filters (lib.rs) that failed to compile (unknown character escape) — a
r"\:" raw string. Needed for the crate to build.

Providers / defaults

  • OpenAI: POST /v1/chat/completions, Bearer auth, JSON mode. Default model gpt-4o-mini.
  • Gemini: generateContent, x-goog-api-key, responseMimeType: application/json. Default model gemini-2.5-flash.

Testing

  • cargo check — passes
  • npm run build (tsc + vite) — passes
  • Manual: Settings → pick OpenAI/Gemini → enter key + model → Import → Transcribe → Find Viral Moments returns candidates.

Notes

  • Keys stored in localStorage (matches existing app behavior).
  • Model selection is a free-text field (like the existing Ollama model input), so new models don't require a code change.

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