Factory for creating AI service clients based on provider.
More...
#include <AIServiceFactory.hpp>
|
| 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.
|
| |
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
◆ 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
-
| provider | Provider name (ollama, lmstudio, openai, etc.) |
| apiKey | API key for cloud providers (empty for local) |
| baseUrl | Base URL for the API endpoint |
| model | Model name to use |
- Returns
- Shared pointer to IAIService implementation
◆ GetDefaultBaseUrl()
| std::string ai::AIServiceFactory::GetDefaultBaseUrl |
( |
const std::string & |
provider | ) |
|
|
static |
Get default base URL for a provider.
- Parameters
-
- Returns
- Default base URL
◆ GetDefaultModel()
| std::string ai::AIServiceFactory::GetDefaultModel |
( |
const std::string & |
provider | ) |
|
|
static |
Get default model for a provider.
- Parameters
-
- Returns
- Default model name
◆ RequiresApiKey()
| bool ai::AIServiceFactory::RequiresApiKey |
( |
const std::string & |
provider | ) |
|
|
static |
Check if a provider requires an API key.
- Parameters
-
- Returns
- true if provider requires API key
The documentation for this class was generated from the following files: