Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@ class AssistantRepositoryTests : AbstractOnServerIT() {
"core:text2text",
"Free text to text prompt",
"Runs an arbitrary prompt through a language model that returns a reply",
null,
null
emptyMap(),
emptyMap()
)
val result = sut?.createTask(input, taskType)
assertTrue(result?.isSuccess == true)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import com.owncloud.android.R

@Composable
fun AddTaskAlertDialog(
title: String?,
title: String,
description: String?,
defaultInput: String = "",
addTask: (String) -> Unit,
Expand All @@ -34,7 +34,7 @@ fun AddTaskAlertDialog(
}

SimpleAlertDialog(
title = title ?: "",
title = title,
description = description ?: "",
dismiss = { dismiss() },
onComplete = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ sealed class ScreenOverlayState {
task.type,
activity.getString(R.string.assistant_screen_add_task_alert_dialog_title),
null,
null,
null
emptyMap(),
emptyMap()
)
val newState = AddTask(taskType, getInput() ?: "")
onComplete(newState)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,31 +12,29 @@ import com.owncloud.android.lib.common.operations.RemoteOperationResult
import com.owncloud.android.lib.resources.assistant.v2.model.Shape
import com.owncloud.android.lib.resources.assistant.v2.model.Task
import com.owncloud.android.lib.resources.assistant.v2.model.TaskInput
import com.owncloud.android.lib.resources.assistant.v2.model.TaskInputShape
import com.owncloud.android.lib.resources.assistant.v2.model.TaskOutput
import com.owncloud.android.lib.resources.assistant.v2.model.TaskOutputShape
import com.owncloud.android.lib.resources.assistant.v2.model.TaskTypeData

@Suppress("MagicNumber")
class AssistantMockRepository(private val giveEmptyTasks: Boolean = false) : AssistantRepositoryType {
override fun getTaskTypes(): List<TaskTypeData> {
return listOf(
TaskTypeData(
"core:text2text",
"Free text to text prompt",
"Runs an arbitrary prompt through a language model that returns a reply",
inputShape = TaskInputShape(
input = Shape(
"Prompt",
"Describe a task that you want the assistant to do or ask a question",
"Text"
id = "core:text2text",
name = "Free text to text prompt",
description = "Runs an arbitrary prompt through a language model that returns a reply",
inputShape = mapOf(
"input" to Shape(
name = "Prompt",
description = "Describe a task that you want the assistant to do or ask a question",
type = "Text"
)
),
outputShape = TaskOutputShape(
output = Shape(
"Generated reply",
"The generated text from the assistant",
"Text"
outputShape = mapOf(
"output" to Shape(
name = "Generated reply",
description = "The generated text from the assistant",
type = "Text"
)
)
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,13 @@ fun TaskTypesRow(selectedTaskType: TaskTypeData?, data: List<TaskTypeData>, sele
}
) {
data.forEach { taskType ->
taskType.name?.let { taskTypeName ->
if (taskType.name.isNotEmpty()) {
Tab(
selected = selectedTaskType?.id == taskType.id,
onClick = { selectTaskType(taskType) },
selectedContentColor = colorResource(R.color.text_color),
unselectedContentColor = colorResource(R.color.disabled_text),
text = { Text(text = taskTypeName) }
text = { Text(text = taskType.name) }
)
}
}
Expand All @@ -54,12 +54,12 @@ fun TaskTypesRow(selectedTaskType: TaskTypeData?, data: List<TaskTypeData>, sele
@Composable
@Preview
private fun TaskTypesRowPreview() {
val selectedTaskType = TaskTypeData("1", "Free text to text prompt", "", null, null)
val selectedTaskType = TaskTypeData("1", "Free text to text prompt", "", emptyMap(), emptyMap())
val taskTypes = listOf(
TaskTypeData("1", "Free text to text prompt", "", null, null),
TaskTypeData("2", "Extract topics", "", null, null),
TaskTypeData("3", "Generate Headline", "", null, null),
TaskTypeData("4", "Summarize", "", null, null)
TaskTypeData("1", "Free text to text prompt", "", emptyMap(), emptyMap()),
TaskTypeData("2", "Extract topics", "", emptyMap(), emptyMap()),
TaskTypeData("3", "Generate Headline", "", emptyMap(), emptyMap()),
TaskTypeData("4", "Summarize", "", emptyMap(), emptyMap())
)

TaskTypesRow(selectedTaskType, taskTypes) { }
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
*/
buildscript {
ext {
androidLibraryVersion ="8c14b444c709e91462fd503af87608a7fa40e90b"
androidLibraryVersion ="0edf15760b8a086ab9969e103c7229dad973efbd"
androidCommonLibraryVersion = "0.26.0"
androidPluginVersion = "8.9.2"
androidxMediaVersion = "1.5.1"
Expand Down
26 changes: 25 additions & 1 deletion gradle/verification-metadata.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4835,7 +4835,7 @@
</component>
<component group="androidx.lifecycle" name="lifecycle-viewmodel" version="2.3.1">
<artifact name="lifecycle-viewmodel-2.3.1.aar">
<sha256 value="b6db4c274a12ff85a4747e1e6669c7e98aefa2571ace9d1f1a6fa6be417ce838" origin="Generated by Gradle"/>
<sha256 value="b6db4c274a12ff85a4747e1e6669c7e98aefa2571ace9d1f1a6fa6be417ce838" origin="Generated by Gradle" reason="Artifact is not signed"/>
</artifact>
<artifact name="lifecycle-viewmodel-2.3.1.module">
<sha256 value="a531853dfe316c90b7466d24be94dbe60a60ef54a52c904c86381986202e51f4" origin="Generated by Gradle" reason="Artifact is not signed"/>
Expand Down Expand Up @@ -12309,6 +12309,14 @@
<sha256 value="c29795ee883fc3364b2f16be5b9246b927271b961214f1a661b2caa2f42459a8" origin="Generated by Gradle" reason="Artifact is not signed"/>
</artifact>
</component>
<component group="com.github.nextcloud" name="android-library" version="0edf15760b8a086ab9969e103c7229dad973efbd">
<artifact name="android-library-0edf15760b8a086ab9969e103c7229dad973efbd.aar">
<sha256 value="37176d4d4a54d4176436355c5f948a4558c91458a03a20d874ae6da0739e7411" origin="Generated by Gradle" reason="Artifact is not signed"/>
</artifact>
<artifact name="android-library-0edf15760b8a086ab9969e103c7229dad973efbd.module">
<sha256 value="c58a8d03f5dd0801523612b0012983ae3cfe45d6d323d35d9fa018484f54af89" origin="Generated by Gradle" reason="Artifact is not signed"/>
</artifact>
</component>
<component group="com.github.nextcloud" name="android-library" version="18f01f7cdffa09bbddbcb610d222fb6df46dae47">
<artifact name="android-library-18f01f7cdffa09bbddbcb610d222fb6df46dae47.aar">
<sha256 value="c6c70775d49d935e7691f43fee0ff51c2c0df03c041fd75da92cf1f0df1385a7" origin="Generated by Gradle" reason="Artifact is not signed"/>
Expand Down Expand Up @@ -12637,6 +12645,14 @@
<sha256 value="ed3adfc1e8120360bdaa26c4d0337c54d288cbb2ca215cf07c38d034ae853fcc" origin="Generated by Gradle" reason="Artifact is not signed"/>
</artifact>
</component>
<component group="com.github.nextcloud" name="android-library" version="8fc329be4d">
<artifact name="android-library-8fc329be4d.aar">
<sha256 value="37176d4d4a54d4176436355c5f948a4558c91458a03a20d874ae6da0739e7411" origin="Generated by Gradle" reason="Artifact is not signed"/>
</artifact>
<artifact name="android-library-8fc329be4d.module">
<sha256 value="0243c635c4b81c057040bcb23ff7df3bfab222b7d8a895174cdc501299cd40d6" origin="Generated by Gradle" reason="Artifact is not signed"/>
</artifact>
</component>
<component group="com.github.nextcloud" name="android-library" version="9e3c0046d242d8395855772d1105cb0b9fdd9f1f">
<artifact name="android-library-9e3c0046d242d8395855772d1105cb0b9fdd9f1f.aar">
<sha256 value="8f6337f2494d67ae9732c57850172588b9bf87f4f2ca4aa74e5f8f79f1192928" origin="Generated by Gradle" reason="Artifact is not signed"/>
Expand Down Expand Up @@ -12765,6 +12781,14 @@
<sha256 value="23be4020754cbb39a6d197281a0d55f84e8851b13afa204081e29132d785a340" origin="Generated by Gradle" reason="Artifact is not signed"/>
</artifact>
</component>
<component group="com.github.nextcloud" name="android-library" version="d0e6fa5c8b">
<artifact name="android-library-d0e6fa5c8b.aar">
<sha256 value="a6ed682f5e0c651759519963e8470fdd3aabcf0104868e8455811d7b7dfa1405" origin="Generated by Gradle" reason="Artifact is not signed"/>
</artifact>
<artifact name="android-library-d0e6fa5c8b.module">
<sha256 value="b29d8928cba81c13d016ac2e0b7a7d40f1b2e71f8229d65efcffb871a27576de" origin="Generated by Gradle" reason="Artifact is not signed"/>
</artifact>
</component>
<component group="com.github.nextcloud" name="android-library" version="d5f21fa1ec5b67c564983b0c8a07bc3acd96f695">
<artifact name="android-library-d5f21fa1ec5b67c564983b0c8a07bc3acd96f695.aar">
<sha256 value="95c86f501a4c1a2e055ba2d1fe68f5ffeed3613492bdaf0594abbae4b21b9227" origin="Generated by Gradle" reason="Artifact is not signed"/>
Expand Down
Loading