Skip to content

Commit

Permalink
Merge pull request #12112 from nextcloud/fix/task-text-processing
Browse files Browse the repository at this point in the history
[task processing] Fix text processing still being mentioned
  • Loading branch information
julien-nc authored Aug 19, 2024
2 parents 22562cb + 5c2815b commit 5baecd1
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ OCS TaskProcessing API

.. versionadded:: 30.0.0

The OCS Text processing API allows you to run text processing tasks, like prompting large language models implemented by apps using :ref:`the backend Text Processing API<text_processing>`.
The OCS Task processing API allows you to run task processing tasks, like prompting large language models implemented by apps using :ref:`the backend Task Processing API<task_processing>`.

The base URL for all calls to this API is: ``<nextcloud_base_url>/ocs/v2.php/taskprocessing/``

Expand Down
3 changes: 3 additions & 0 deletions developer_manual/client_apis/OCS/ocs-textprocessing-api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ OCS TextProcessing API

.. versionadded:: 27.1.0

.. deprecated:: 30
Use the TaskProcessing API instead

The OCS Text processing API allows you to run text processing tasks, like prompting large language models implemented by apps using :ref:`the backend Text Processing API<text_processing>`.

The base URL for all calls to this API is: *<nextcloud_base_url>/ocs/v2.php/textprocessing/*
Expand Down
4 changes: 2 additions & 2 deletions developer_manual/digging_deeper/task_processing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ To consume the Task Processing API, you will need to :ref:`inject<dependency-in
* ``deleteTask(Task $task)`` This method deletes a task
* ``cancelTask(int $id)`` This method cancels a task specified by its id.

If you would like to use the text processing functionality in a client, there are also OCS endpoints available for this: :ref:`OCS Text Processing API<ocs-taskprocessing-api>`
If you would like to use the task processing functionality in a client, there are also OCS endpoints available for this: :ref:`OCS Task Processing API<ocs-taskprocessing-api>`

Tasks types
^^^^^^^^^^^
Expand Down Expand Up @@ -336,7 +336,7 @@ A **Task processing provider** will usually be a class that implements the inter
The method ``getName`` returns a string to identify the registered provider in the user interface.

The method ``process`` implements the text processing step. In case execution fails for some reason, you should throw a ``\OCP\TaskProcessing\Exception\ProcessingException`` with an explanatory error message. Important to note here is that ``Image``, ``Audio``, ``Video`` and ``File`` slots in the input array will be filled with ``\OCP\Files\File`` objects for your convenience. When outputting one of these you should simply return a string, the API will turn the data into a proper file for convenience. The ``$reportProgress`` parameter is a callback that you may use at will to report the task progress as a single float value between 0 and 1. Its return value will indicate if the task is still running (``true``) or if it was cancelled (``false``) and processing should be terminated.
The method ``process`` implements the task processing step. In case execution fails for some reason, you should throw a ``\OCP\TaskProcessing\Exception\ProcessingException`` with an explanatory error message. Important to note here is that ``Image``, ``Audio``, ``Video`` and ``File`` slots in the input array will be filled with ``\OCP\Files\File`` objects for your convenience. When outputting one of these you should simply return a string, the API will turn the data into a proper file for convenience. The ``$reportProgress`` parameter is a callback that you may use at will to report the task progress as a single float value between 0 and 1. Its return value will indicate if the task is still running (``true``) or if it was cancelled (``false``) and processing should be terminated.

This class would typically be saved into a file in ``lib/TaskProcessing`` of your app but you are free to put it elsewhere as long as it's loadable by Nextcloud's :ref:`dependency injection container<dependency-injection>`.

Expand Down

0 comments on commit 5baecd1

Please sign in to comment.