Skip to content

Commit

Permalink
feat: change supported task types to enum-like values
Browse files Browse the repository at this point in the history
Signed-off-by: Elizabeth Danzberger <lizzy7128@tutanota.de>
  • Loading branch information
elzody committed Dec 12, 2024
1 parent fd56add commit c38dca0
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions src/mixins/assistant.js
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand All @@ -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
}
Expand Down

0 comments on commit c38dca0

Please sign in to comment.