diff --git a/src/components/AssistantFormInputs.vue b/src/components/AssistantFormInputs.vue index d3bf6916..6b9b8669 100644 --- a/src/components/AssistantFormInputs.vue +++ b/src/components/AssistantFormInputs.vue @@ -7,6 +7,11 @@ :inputs="inputs" :task-type="selectedTaskType" @update:inputs="$emit('update:inputs', $event)" /> + +
import ContextChatInputForm from './ContextChat/ContextChatInputForm.vue' import TaskTypeFields from './fields/TaskTypeFields.vue' +import ContextChatMultiInputForm from './ContextChat/ContextChatMultiInputForm.vue' export default { name: 'AssistantFormInputs', components: { ContextChatInputForm, TaskTypeFields, + ContextChatMultiInputForm, }, props: { inputs: { diff --git a/src/components/AssistantFormOutputs.vue b/src/components/AssistantFormOutputs.vue index 00bad9df..2daec117 100644 --- a/src/components/AssistantFormOutputs.vue +++ b/src/components/AssistantFormOutputs.vue @@ -12,6 +12,10 @@ class="output-fields" :output-shape="selectedTaskType.outputShape" :output="outputs" /> + + + + + + diff --git a/src/components/ContextChat/ContextChatMultiOutputForm.vue b/src/components/ContextChat/ContextChatMultiOutputForm.vue new file mode 100644 index 00000000..4dc88264 --- /dev/null +++ b/src/components/ContextChat/ContextChatMultiOutputForm.vue @@ -0,0 +1,171 @@ + + + + + + diff --git a/src/components/TaskListItem.vue b/src/components/TaskListItem.vue index 59091eb4..6fb8a976 100644 --- a/src/components/TaskListItem.vue +++ b/src/components/TaskListItem.vue @@ -181,6 +181,13 @@ export default { const nbGeneratedImages = this.task.output?.length ?? 0 return n('assistant', '{n} image generated', '{n} images generated', nbGeneratedImages, { n: nbGeneratedImages }) } + if (this.task.type === 'context_chat:context_chat_multi') { + const questions = this.task.input.questions ?? [] + const extraCount = questions.length - 1 + return extraCount > 0 + ? n('assistant', '+{extraCount} more question', '+{extraCount} more questions', extraCount, { extraCount }) + : '' + } return this.textOutputPreview } else if (this.task.status === TASK_STATUS_STRING.scheduled) { if (this.isText2Image) { @@ -203,6 +210,10 @@ export default { return statusTitles[this.task.status] ?? t('assistant', 'Unknown status') }, textInputPreview() { + if (this.task.type === 'context_chat:context_chat_multi') { + const questions = this.task.input.questions ?? [] + return questions.length > 0 ? questions[0] : '' + } const textInputs = [] Object.keys(this.taskType.inputShape).forEach(key => { const field = this.taskType.inputShape[key]