feat: add OpenAI and Gemini LLM providers#15
Open
aditya-gupta-dev wants to merge 2 commits into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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: newdetect_candidates_with_openaianddetect_candidates_with_gemini, following the existing per-provider pattern (own responsestructs, shared
compact_segments+parse_candidate_jsonhelpers, same prompt).lib.rs:"openai"/"gemini"arms ingenerate_candidates(key + model resolved from arg → env → default), andhas_openai_key/has_gemini_keyinenvironment_status.models.rs: two newEnvironmentStatusfields..env.example:OPENAI_API_KEY,GEMINI_API_KEY.Frontend (
src/main.tsx)localStorage.generate_candidatescalls; provider-aware warning labels.Also: fixes an invalid
"\:"string escape inbuild_drawtext_filters(lib.rs) that failed to compile (unknown character escape) — ar"\:"raw string. Needed for the crate to build.Providers / defaults
POST /v1/chat/completions, Bearer auth, JSON mode. Default modelgpt-4o-mini.generateContent,x-goog-api-key,responseMimeType: application/json. Default modelgemini-2.5-flash.Testing
cargo check— passesnpm run build(tsc + vite) — passesNotes
localStorage(matches existing app behavior).