forked from NuQloud/nc-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.
35 lines
888 B
PHP
35 lines
888 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace OCA\EducAI\ToolProvider;
|
|
|
|
use OCP\EventDispatcher\Event;
|
|
|
|
/**
|
|
* Dispatched (lazily, once per request) when the agent tool loadout is
|
|
* assembled. Listeners register {@see IToolProvider} instances to contribute
|
|
* additional tools.
|
|
*
|
|
* Companion apps register a listener in their Application bootstrap:
|
|
*
|
|
* $context->registerEventListener(CollectToolProvidersEvent::class, MyToolProviderListener::class);
|
|
*
|
|
* and call {@see CollectToolProvidersEvent::registerProvider()} in the listener.
|
|
*/
|
|
class CollectToolProvidersEvent extends Event {
|
|
/** @var array<int,IToolProvider> */
|
|
private array $providers = [];
|
|
|
|
public function registerProvider(IToolProvider $provider): void {
|
|
$this->providers[] = $provider;
|
|
}
|
|
|
|
/**
|
|
* @return array<int,IToolProvider>
|
|
*/
|
|
public function getProviders(): array {
|
|
return $this->providers;
|
|
}
|
|
}
|