Files
nuqloud-ai/lib/Service/TextSessionResetService.php
T
Pascal Kienast 0739d3da6a Initial open-source release of Talk AI
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.
2026-07-08 21:13:13 +02:00

38 lines
895 B
PHP

<?php
declare(strict_types=1);
namespace OCA\EducAI\Service;
use OCP\Files\File;
use Psr\Log\LoggerInterface;
class TextSessionResetService {
public function __construct(
private LoggerInterface $logger,
) {
}
public function resetFileSession(File $file): void {
try {
if (!class_exists(\OCA\Text\Service\DocumentService::class)
|| !class_exists(\OCP\Server::class)
|| !method_exists(\OCP\Server::class, 'get')) {
return;
}
$documentService = \OCP\Server::get(\OCA\Text\Service\DocumentService::class);
if (!is_object($documentService) || !method_exists($documentService, 'resetDocument')) {
return;
}
$documentService->resetDocument((int)$file->getId(), true);
} catch (\Throwable $e) {
$this->logger->debug('Unable to reset Text document session after wiki write', [
'exception' => $e,
'file_id' => $file->getId(),
]);
}
}
}