From c38dca01933cab393809ab64090d46a1c7dfb84d Mon Sep 17 00:00:00 2001 From: Elizabeth Danzberger Date: Thu, 12 Dec 2024 14:59:09 -0500 Subject: [PATCH] feat: change supported task types to enum-like values Signed-off-by: Elizabeth Danzberger --- src/mixins/assistant.js | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/mixins/assistant.js b/src/mixins/assistant.js index 7e6d4b15d0..85f1ea13f5 100644 --- a/src/mixins/assistant.js +++ b/src/mixins/assistant.js @@ -5,8 +5,10 @@ import { translate as t } from '@nextcloud/l10n' -const GENERATE_TEXT = 'core:text2text' -const GENERATE_IMAGE = 'core:text2image' +const SupportedTaskTypes = { + Text: 'core:text2text', + Image: 'core:text2image', +} export default { data() { @@ -32,11 +34,14 @@ export default { }, handleTask(task) { switch (task.type) { - case GENERATE_TEXT: + + case SupportedTaskTypes.Text: this.insertAIText(task.output.output) break - case GENERATE_IMAGE: + + case SupportedTaskTypes.Image: break + default: break }