Feature: Add configurable LLM endpoint for Claude-compatible alternatives

This commit is contained in:
WLTBAgent
2026-02-16 16:35:42 +00:00
parent 8b5c8826e2
commit 3c2d356eb0
5 changed files with 45 additions and 12 deletions

View File

@@ -33,6 +33,7 @@ class AdminController {
public function load(): JSONResponse {
$clientId = $this->config->getAppValue('google_client_id', 'analyticshub', '');
$apiKey = $this->config->getAppValue('anthropic_api_key', 'analyticshub', '');
$llmEndpoint = $this->config->getAppValue('llm_api_endpoint', 'analyticshub', '');
$refreshToken = $this->config->getAppValue('google_refresh_token', 'analyticshub', '');
// Check if configured
@@ -54,6 +55,7 @@ class AdminController {
'data' => [
'google_client_id' => $clientId,
'google_refresh_token' => $maskedRefreshToken,
'llm_api_endpoint' => $llmEndpoint,
'anthropic_api_key' => $maskedApiKey,
'is_configured' => $isConfigured,
],
@@ -77,6 +79,7 @@ class AdminController {
$clientSecret = $data['google_client_secret'] ?? '';
$refreshToken = $data['google_refresh_token'] ?? '';
$apiKey = $data['anthropic_api_key'] ?? '';
$llmEndpoint = $data['llm_api_endpoint'] ?? '';
if (empty($clientId) || empty($clientSecret) || empty($apiKey)) {
return new JSONResponse([
@@ -93,6 +96,10 @@ class AdminController {
$this->config->setAppValue('google_refresh_token', 'analyticshub', $refreshToken);
}
if (!empty($llmEndpoint)) {
$this->config->setAppValue('llm_api_endpoint', 'analyticshub', $llmEndpoint);
}
$this->config->setAppValue('anthropic_api_key', 'analyticshub', $apiKey);
// Check if fully configured