LogViewer
A modern log viewer with AI-assisted analysis (Qt 6)
Loading...
Searching...
No Matches
ai::AIServiceFactory Class Reference

Factory for creating AI service clients based on provider. More...

#include <AIServiceFactory.hpp>

Collaboration diagram for ai::AIServiceFactory:
Collaboration graph

Static Public Member Functions

static std::shared_ptr< IAIService > CreateClient (const std::string &provider, const std::string &apiKey, const std::string &baseUrl, const std::string &model)
 Create an AI service client based on provider configuration.
 
static bool RequiresApiKey (const std::string &provider)
 Check if a provider requires an API key.
 
static std::string GetDefaultBaseUrl (const std::string &provider)
 Get default base URL for a provider.
 
static std::string GetDefaultModel (const std::string &provider)
 Get default model for a provider.
 

Detailed Description

Factory for creating AI service clients based on provider.

Supported providers:

  • ollama: Local Ollama server
  • lmstudio: Local LM Studio server
  • openai: OpenAI/ChatGPT API
  • anthropic: Anthropic/Claude API
  • google: Google/Gemini API
  • xai: xAI/Grok API

Member Function Documentation

◆ CreateClient()

std::shared_ptr< IAIService > ai::AIServiceFactory::CreateClient ( const std::string &  provider,
const std::string &  apiKey,
const std::string &  baseUrl,
const std::string &  model 
)
static

Create an AI service client based on provider configuration.

Parameters
providerProvider name (ollama, lmstudio, openai, etc.)
apiKeyAPI key for cloud providers (empty for local)
baseUrlBase URL for the API endpoint
modelModel name to use
Returns
Shared pointer to IAIService implementation
Here is the caller graph for this function:

◆ GetDefaultBaseUrl()

std::string ai::AIServiceFactory::GetDefaultBaseUrl ( const std::string &  provider)
static

Get default base URL for a provider.

Parameters
providerProvider name
Returns
Default base URL
Here is the caller graph for this function:

◆ GetDefaultModel()

std::string ai::AIServiceFactory::GetDefaultModel ( const std::string &  provider)
static

Get default model for a provider.

Parameters
providerProvider name
Returns
Default model name

◆ RequiresApiKey()

bool ai::AIServiceFactory::RequiresApiKey ( const std::string &  provider)
static

Check if a provider requires an API key.

Parameters
providerProvider name
Returns
true if provider requires API key

The documentation for this class was generated from the following files: