mirror of
https://github.com/crowetic/nc-talk-ai.git
synced 2026-09-07 15:42:31 +00:00
Talk AI is a multi-bot AI assistant manager for Nextcloud Talk: per-bot prompts and models, agentic tool calling (MCP + built-in tools), RAG over Nextcloud files, room-document search, vision and speech-to-text attachments, persistent bot wikis, approval workflows, rate limiting, and multi-provider LLM support (any OpenAI-compatible endpoint). Developed within EDUC - the European Digital UniverCity (https://educalliance.eu), where it runs as the 'EDUC AI' assistant on the alliance-wide Nextcloud portal. This public repository is the upstream point of truth; deployment-specific tools plug in via the tool-provider extension point (docs/TOOL_PROVIDERS.md). License: AGPL-3.0-or-later.
72 lines
2.1 KiB
PHP
72 lines
2.1 KiB
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace OCA\EducAI\Migration;
|
|
|
|
use Closure;
|
|
use OCP\DB\ISchemaWrapper;
|
|
use OCP\DB\Types;
|
|
use OCP\Migration\IOutput;
|
|
use OCP\Migration\SimpleMigrationStep;
|
|
|
|
/**
|
|
* Add progress tracking columns to bot_sources table for RAG indexing progress bar
|
|
*/
|
|
class Version020600Date20251126000000 extends SimpleMigrationStep {
|
|
/**
|
|
* @param IOutput $output
|
|
* @param Closure(): ISchemaWrapper $schemaClosure
|
|
* @param array $options
|
|
* @return null|ISchemaWrapper
|
|
*/
|
|
public function changeSchema(IOutput $output, Closure $schemaClosure, array $options): ?ISchemaWrapper {
|
|
/** @var ISchemaWrapper $schema */
|
|
$schema = $schemaClosure();
|
|
|
|
$tableName = 'educai_bot_sources';
|
|
if ($schema->hasTable($tableName)) {
|
|
$table = $schema->getTable($tableName);
|
|
|
|
// Progress percentage (0-100)
|
|
if (!$table->hasColumn('progress')) {
|
|
$table->addColumn('progress', Types::INTEGER, [
|
|
'notnull' => false,
|
|
'default' => 0,
|
|
'unsigned' => true,
|
|
]);
|
|
}
|
|
|
|
// Current item being processed
|
|
if (!$table->hasColumn('progress_current')) {
|
|
$table->addColumn('progress_current', Types::INTEGER, [
|
|
'notnull' => false,
|
|
'default' => 0,
|
|
'unsigned' => true,
|
|
]);
|
|
}
|
|
|
|
// Total items to process
|
|
if (!$table->hasColumn('progress_total')) {
|
|
$table->addColumn('progress_total', Types::INTEGER, [
|
|
'notnull' => false,
|
|
'default' => 0,
|
|
'unsigned' => true,
|
|
]);
|
|
}
|
|
|
|
// Current processing stage: collecting, extracting, chunking, embedding, storing
|
|
if (!$table->hasColumn('progress_stage')) {
|
|
$table->addColumn('progress_stage', Types::STRING, [
|
|
'notnull' => false,
|
|
'length' => 50,
|
|
]);
|
|
}
|
|
|
|
return $schema;
|
|
}
|
|
|
|
return null;
|
|
}
|
|
}
|