Merge pull request #13409 from nextcloud/fix/context-chat-manager

fix(developer): add isContextChatAvailable method to Context Chat OCP API
This commit is contained in:
Marcel Klehr
2025-07-13 14:00:19 +02:00
committed by GitHub
2 changed files with 7 additions and 2 deletions

View File

@@ -36,6 +36,7 @@ Back-end changes
Added APIs
^^^^^^^^^^
- New ``OCP\ContextChat`` API. See :ref:`context_chat` for details.
- New task processing task type ``OCP\TaskProcessing\TextToSpeech`` to convert text to speech.
- New interface ``\OCP\Share\IShareProviderSupportsAllSharesInFolder`` extending ``\OCP\Share\IShareProvider`` to add the method ``\OCP\Share\IShareProviderSupportsAllSharesInFolder::getAllSharesInFolder`` used for querying all shares in a folder without filtering by user.
- New method ``\OCP\IUser::canChangeEmail`` allowing to check if the user backend allows the user to change their email address.

View File

@@ -71,7 +71,8 @@ To add content and register your provider implementation you will need to use th
The ``IContentManager`` class has the following methods:
* ``registerContentProvider(string $providerClass)``
* ``isContextChatAvailable()``: Returns ``true`` if the Context Chat app is enabled, ``false`` otherwise.
* ``registerContentProvider(string $providerClass)``: Register a new content provider.
* ``submitContent(string $appId, array $items)``: Providers can use this to submit content for indexing in Context Chat.
* ``updateAccess(string $appId, string $providerId, string $itemId, string $op, array $userIds)``: Update the access rights for a content item. Use ``\OCP\ContextChat\Type\UpdateAccessOp`` constants for the ``$op`` value.
* ``updateAccessProvider(string $appId, string $providerId, string $op, array $userIds)``: Update the access rights for all content items from a provider. Use ``\OCP\ContextChat\Type\UpdateAccessOp`` constants for the ``$op`` value.
@@ -115,7 +116,10 @@ if you want to trigger an initial import of content items.
Submitting ContentItem data
^^^^^^^^^^^^^^^^^^^^^^^^^^^
To submit content, wrap it in an ``\OCP\ContextChat\ContentItem`` object:
Before submitting, you should check that the Context Chat app is enabled first
by calling the ``isContextChatAvailable()`` method.
Then, to submit content, wrap it in a list of ``\OCP\ContextChat\ContentItem`` objects:
.. code-block:: php