MCPcopy Create free account
hub / github.com/Serial-Studio/Serial-Studio / rebuildProviders

Method rebuildProviders

app/src/AI/Assistant.cpp:650–672  ·  view source on GitHub ↗

* @brief Constructs the provider adapters with key-getter lambdas. */

Source from the content-addressed store, hash-verified

648 * @brief Constructs the provider adapters with key-getter lambdas.
649 */
650void AI::Assistant::rebuildProviders()
651{
652 m_anthropic = std::make_unique<AnthropicProvider>(
653 *m_nam, [this]() { return m_vault.key(ProviderId::Anthropic); });
654 m_openai =
655 std::make_unique<OpenAIProvider>(*m_nam, [this]() { return m_vault.key(ProviderId::OpenAI); });
656 m_gemini =
657 std::make_unique<GeminiProvider>(*m_nam, [this]() { return m_vault.key(ProviderId::Gemini); });
658 m_deepseek = std::make_unique<DeepSeekProvider>(
659 *m_nam, [this]() { return m_vault.key(ProviderId::DeepSeek); });
660 m_openrouter = std::make_unique<OpenRouterProvider>(
661 *m_nam, [this]() { return m_vault.key(ProviderId::OpenRouter); });
662 m_groq =
663 std::make_unique<GroqProvider>(*m_nam, [this]() { return m_vault.key(ProviderId::Groq); });
664 m_mistral = std::make_unique<MistralProvider>(
665 *m_nam, [this]() { return m_vault.key(ProviderId::Mistral); });
666
667 auto* local = new LocalProvider(*m_nam);
668 connect(local, &LocalProvider::modelsChanged, this, []() {
669 qCDebug(serialStudioAI) << "Local model list updated";
670 });
671 m_local.reset(local);
672}
673
674/**
675 * @brief Points the conversation at the currently selected provider.

Callers

nothing calls this directly

Calls 2

keyMethod · 0.80
resetMethod · 0.45

Tested by

no test coverage detected