Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Unverified Commit 4c07e6a6 authored by Tobias Kaminsky's avatar Tobias Kaminsky Committed by GitHub
Browse files

Merge pull request #1624 from nextcloud/bugfix/task-processing-response

BugFix - TaskProcessingAPI
parents bea1b68b 874915d8
Loading
Loading
Loading
Loading
+16 −11
Original line number Diff line number Diff line
@@ -9,6 +9,7 @@
package com.owncloud.android.lib.resources.assistant.v2

import com.owncloud.android.AbstractIT
import com.owncloud.android.lib.resources.assistant.v2.model.Shape
import com.owncloud.android.lib.resources.assistant.v2.model.TaskInputShape
import com.owncloud.android.lib.resources.assistant.v2.model.TaskOutputShape
import com.owncloud.android.lib.resources.assistant.v2.model.TaskTypeData
@@ -29,15 +30,19 @@ class AssistantV2Tests : AbstractIT() {
            "core:text2text",
            "Free text to text prompt",
            "Runs an arbitrary prompt through a language model that returns a reply",
            listOf(
            inputShape =
                TaskInputShape(
                    input =
                        Shape(
                            "Prompt",
                            "Describe a task that you want the assistant to do or ask a question",
                            "Text"
                        )
                ),
            listOf(
            outputShape =
                TaskOutputShape(
                    output =
                        Shape(
                            "Generated reply",
                            "The generated text from the assistant",
                            "Text"
+2 −6
Original line number Diff line number Diff line
@@ -45,12 +45,8 @@ class GetTaskTypesRemoteOperationV2 : OCSRemoteOperation<List<TaskTypeData>>() {

                val supportedTaskTypeList =
                    taskTypeList?.filter { taskType ->
                        taskType.inputShape?.any { inputShape ->
                            inputShape.type == supportedTaskType
                        } == true &&
                            taskType.outputShape?.any { outputShape ->
                                outputShape.type == supportedTaskType
                            } == true
                        taskType.inputShape?.input?.type == supportedTaskType &&
                            taskType.outputShape?.output?.type == supportedTaskType
                    }

                result = RemoteOperationResult(true, getMethod)
+10 −8
Original line number Diff line number Diff line
@@ -16,18 +16,20 @@ data class TaskTypeData(
    val id: String?,
    val name: String?,
    val description: String?,
    val inputShape: List<TaskInputShape>?,
    val outputShape: List<TaskOutputShape>?
    val inputShape: TaskInputShape?,
    val outputShape: TaskOutputShape?
)

data class TaskInputShape(
    val name: String?,
    val description: String?,
    val type: String?
    val input: Shape?
)

data class TaskOutputShape(
    val name: String?,
    val description: String?,
    val type: String?
    val output: Shape?
)

data class Shape(
    val name: String,
    val description: String,
    val type: String
)