feat: Implement multi-LLM provider support #1
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.
This commit introduces a flexible architecture to support multiple LLM providers for problem analysis and solution generation.
Key changes:
LLMServiceinterface (electron/llmService/llmServiceInterface.ts) defining a common contract for LLM operations (extractProblemInfo, generateSolution, debugSolution).electron/handlers/problemHandler.tsto use a factory function (getLLMService) that dynamically instantiates an LLM service based on your preference.OpenAILLMService(electron/llmProviders/openai.ts) by migrating existing OpenAI API logic into this dedicated class.electron/store.tsto store API keys for OpenAI, Gemini (placeholder), Claude (placeholder), Local LLM, and GitHub Marketplace LLM (placeholder), along with apreferredProvidersetting.src/components/ApiKeyAuth.tsxto allow you to input API keys/configurations for multiple providers and select your preferred one. UI elements for Local LLM (base URL) and GitHub Marketplace LLM (API key, model ID) are included.LocalLLMService(electron/llmProviders/localLlm.ts) andGitHubMarketplaceLLMService(electron/llmProviders/githubMarketplaceLlm.ts) with stubbed methods as placeholders for future implementation.README.mdto explain the new multi-provider functionality and configuration process.getLLMService,OpenAILLMService, and the stubbed provider classes.This refactoring allows for easier integration of new LLM providers in the future and gives you more flexibility in choosing your preferred service.