Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adjustments for the assistant integration #6081

Closed
julien-nc opened this issue Jul 24, 2024 · 0 comments · Fixed by #6079
Closed

Adjustments for the assistant integration #6081

julien-nc opened this issue Jul 24, 2024 · 0 comments · Fixed by #6079
Labels
bug Something isn't working regression technical debt

Comments

@julien-nc
Copy link
Member

julien-nc commented Jul 24, 2024

Hey, there's been a few changes in the assistant and the server AI-related APIs. Here are some pointers if you want to adjust.

Text processing + transcription + image generation + anything else are now handled by one single API: the task processing one.
The concepts of task type and providers are still there. The task types now include the "shape" of their input and output.

The assistant now only submits "task processing" tasks. That's why you don't see any task in the list in Text.

Assistant

The openAssistantForm frontend function is now exposed as window.OCA.Assistant.openAssistantForm but the TPAssistant is still there for backward compatibility.
The identifier parameter is deprecated (but still works) and replaced by customId
The input parameter is deprecated (but still works for core:text2text* task types). It can be replaced by inputs which is an object which contains the values for each field. If you only support core:text2text* task types, only setting the inputs.input field value is enough, more on that below, in the "Task types")

Task processing OCS API

You can get the task types with /ocs/v2.php/taskprocessing/tasktypes

You can get the task list with /ocs/v2.php/taskprocessing/tasks/app/APP_ID?customId=CUSTOM_ID

Task representation

The task objects returned by the OCS API are a bit different.

The input and output attributes are now objects which contain the values for each field.
The status is now a string: https://github.com/nextcloud/server/blob/master/lib/public/TaskProcessing/Task.php#L366-L370

Task types

You could support a static list of task types: the ones that are equivalent to text processing ones:

  • core:text2text (previously called FreePrompt)
  • core:text2text:headline
  • core:text2text:summary
  • core:text2text:topics (extract topics)

All those task types have the same input and output shapes: Just one text field named "input" and "output".

Here is the list of task types defined in the server: https://github.com/nextcloud/server/tree/master/lib/public/TaskProcessing/TaskTypes . We can discuss how to support more task types later.

cc @mejo-

@julien-nc julien-nc added enhancement New feature or request technical debt labels Jul 24, 2024
@juliusknorr juliusknorr added bug Something isn't working regression and removed enhancement New feature or request labels Jul 24, 2024
mejo- added a commit that referenced this issue Jul 24, 2024
Fixes: #6081

Signed-off-by: Jonas <jonas@freesources.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working regression technical debt
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants