File tree Expand file tree Collapse file tree 3 files changed +8
-4
lines changed
library/src/main/java/com/owncloud/android/lib/resources/assistant Expand file tree Collapse file tree 3 files changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -20,4 +20,6 @@ data class ChatMessage(
2020 val ocpTaskId : Any? ,
2121 val sources : String ,
2222 val attachments : List <Any ?>
23- )
23+ ) {
24+ val isHuman: Boolean = (role == " human" )
25+ }
Original file line number Diff line number Diff line change @@ -47,7 +47,6 @@ import org.apache.commons.httpclient.HttpStatus
4747 */
4848class GetTaskTypesRemoteOperationV2 : OCSRemoteOperation <List <TaskTypeData >>() {
4949 private val supportedTaskType = " Text"
50- private val chatTaskName = " Chat"
5150
5251 @Suppress(" TooGenericExceptionCaught" )
5352 override fun run (client : NextcloudClient ): RemoteOperationResult <List <TaskTypeData >> {
@@ -72,8 +71,8 @@ class GetTaskTypesRemoteOperationV2 : OCSRemoteOperation<List<TaskTypeData>>() {
7271 ?.types
7372 ?.map { (key, value) -> value.copy(id = value.id ? : key) }
7473 ?.filter { taskType ->
75- isSingleTextInputOutput(taskType) || taskType.name == chatTaskName
76- }?.sortedByDescending { it.name == chatTaskName }
74+ isSingleTextInputOutput(taskType) || taskType.isChat
75+ }?.sortedByDescending { it.isChat }
7776
7877 result = RemoteOperationResult (true , getMethod)
7978 result.resultData = taskTypeList
Original file line number Diff line number Diff line change @@ -19,6 +19,9 @@ data class TaskTypeData(
1919 val inputShape : Map <String , Shape >,
2020 val outputShape : Map <String , Shape >
2121) {
22+ private val chatTaskName = " Chat"
23+ val isChat: Boolean = (name == chatTaskName)
24+
2225 companion object {
2326 private const val CONVERSATION_LIST_ID = " ConversationList"
2427 val conversationList =
You can’t perform that action at this time.
0 commit comments