Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 15 additions & 2 deletions appinfo/routes.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,11 @@

['name' => 'settings#getVersionInfo', 'url' => '/api/settings/version', 'verb' => 'GET'],

// AI settings endpoints
['name' => 'settings#getAiSettings', 'url' => '/api/settings/ai', 'verb' => 'GET'],
['name' => 'settings#updateAiSettings', 'url' => '/api/settings/ai', 'verb' => 'PUT'],
['name' => 'settings#testAiConnection', 'url' => '/api/settings/ai/test', 'verb' => 'POST'],

// Statistics endpoint
['name' => 'settings#getStatistics', 'url' => '/api/settings/statistics', 'verb' => 'GET'],

Expand Down Expand Up @@ -165,7 +170,15 @@
['name' => 'organisation#setActive', 'url' => '/api/organisations/{uuid}/set-active', 'verb' => 'POST'],
['name' => 'organisation#join', 'url' => '/api/organisations/{uuid}/join', 'verb' => 'POST'],
['name' => 'organisation#leave', 'url' => '/api/organisations/{uuid}/leave', 'verb' => 'POST'],
// Tags
['name' => 'tags#getAllTags', 'url' => 'api/tags', 'verb' => 'GET'],
// Tags
['name' => 'tags#getAllTags', 'url' => 'api/tags', 'verb' => 'GET'],

// AI Chat endpoints
['name' => 'chat#chat', 'url' => '/api/chat', 'verb' => 'POST'],
['name' => 'chat#getCapabilities', 'url' => '/api/chat/capabilities', 'verb' => 'GET'],
['name' => 'chat#testConnection', 'url' => '/api/chat/test', 'verb' => 'POST'],
['name' => 'chat#getContext', 'url' => '/api/chat/context', 'verb' => 'GET'],
['name' => 'chat#generateText', 'url' => '/api/chat/generate-text', 'verb' => 'POST'],
['name' => 'chat#generateEmbedding', 'url' => '/api/chat/generate-embedding', 'verb' => 'POST'],
],
];
1 change: 1 addition & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@
"bamarni/composer-bin-plugin": "^1.8",
"elasticsearch/elasticsearch": "^v8.14.0",
"guzzlehttp/guzzle": "^7.0",
"theodo-group/llphant": "^0.11.4",
"opis/json-schema": "^2.3",
"phpoffice/phpspreadsheet": "^4.2",
"react/event-loop": "^1.5",
Expand Down
17 changes: 16 additions & 1 deletion lib/AppInfo/Application.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
use OCA\OpenRegister\Service\SolrService;
use OCA\OpenRegister\Service\GuzzleSolrService;
use OCA\OpenRegister\Service\SettingsService;
use OCA\OpenRegister\Service\AiService;
use OCA\OpenRegister\Service\SolrSchemaService;
use OCA\OpenRegister\Setup\SolrSetup;
use OCA\OpenRegister\Service\SchemaCacheService;
Expand Down Expand Up @@ -231,7 +232,20 @@ function ($container) {
);


// Register SaveObject with consolidated cache services
// Register AiService for AI functionality
$context->registerService(
AiService::class,
function ($container) {
return new AiService(
$container->get('OCP\IAppConfig'),
$container->get('OCP\IConfig'),
$container->get('Psr\Log\LoggerInterface'),
$container->get(SettingsService::class)
);
}
);

// Register SaveObject with consolidated cache services and AI service
$context->registerService(
SaveObject::class,
function ($container) {
Expand All @@ -247,6 +261,7 @@ function ($container) {
$container->get(ObjectCacheService::class),
$container->get(SchemaCacheService::class),
$container->get(SchemaFacetCacheService::class),
$container->get(AiService::class),
$container->get('Psr\Log\LoggerInterface'),
new \Twig\Loader\ArrayLoader([])
);
Expand Down
Loading
Loading