42
42
:selected-task-id =" selectedTaskId"
43
43
:selected-task-type =" selectedTaskType"
44
44
:show-advanced.sync =" showAdvanced" />
45
- <div v-if =" hasOutput"
46
- class =" output" >
47
- <ContextChatOutputForm v-if =" mySelectedTaskTypeId === 'context_chat:context_chat'"
48
- class =" output-fields"
49
- :output-shape =" selectedTaskType.outputShape"
50
- :output =" myOutputs" />
51
- <TaskTypeFields v-else
52
- class =" output-fields"
53
- :is-output =" true"
54
- :shape =" selectedTaskType.outputShape"
55
- :optional-shape =" selectedTaskType.optionalOutputShape ?? null"
56
- :shape-options =" selectedTaskType.outputShapeEnumValues ?? null"
57
- :optional-shape-options =" selectedTaskType.optionalOutputShapeEnumValues ?? null"
58
- :values.sync =" myOutputs"
59
- :show-advanced.sync =" showAdvanced" />
60
- <NcNoteCard v-if =" outputEqualsInput"
61
- class =" warning-note"
62
- type =" warning" >
63
- {{ t('assistant', 'The task ran successfully but the result is identical to the input.') }}
64
- </NcNoteCard >
65
- <NcNoteCard v-else-if =" hasInitialOutput"
66
- class =" warning-note"
67
- type =" warning" >
68
- {{ t('assistant', 'This output was generated by AI. Make sure to double-check and adjust.') }}
69
- </NcNoteCard >
70
- </div >
45
+ <AssistantFormOutputs v-if =" hasOutput"
46
+ :inputs =" myInputs"
47
+ :outputs.sync =" myOutputs"
48
+ :selected-task-type =" selectedTaskType"
49
+ :show-advanced.sync =" showAdvanced" />
71
50
</div >
72
51
<!-- hide the footer for chatty-llm -->
73
52
<div v-if =" !showHistory && mySelectedTaskTypeId !== 'chatty-llm'" class =" footer" >
@@ -135,14 +114,12 @@ import NcActions from '@nextcloud/vue/dist/Components/NcActions.js'
135
114
import NcButton from ' @nextcloud/vue/dist/Components/NcButton.js'
136
115
import NcIconSvgWrapper from ' @nextcloud/vue/dist/Components/NcIconSvgWrapper.js'
137
116
import NcLoadingIcon from ' @nextcloud/vue/dist/Components/NcLoadingIcon.js'
138
- import NcNoteCard from ' @nextcloud/vue/dist/Components/NcNoteCard.js'
139
117
140
118
import AssistantFormInputs from ' ./AssistantFormInputs.vue'
141
- import ContextChatOutputForm from ' ./ContextChat/ContextChatOutputForm .vue'
119
+ import AssistantFormOutputs from ' ./AssistantFormOutputs .vue'
142
120
import NoProviderEmptyContent from ' ./NoProviderEmptyContent.vue'
143
121
import TaskList from ' ./TaskList.vue'
144
122
import TaskTypeSelect from ' ./TaskTypeSelect.vue'
145
- import TaskTypeFields from ' ./fields/TaskTypeFields.vue'
146
123
147
124
import { SHAPE_TYPE_NAMES } from ' ../constants.js'
148
125
@@ -158,7 +135,6 @@ const TEXT2TEXT_TASK_TYPE_ID = 'core:text2text'
158
135
export default {
159
136
name: ' AssistantTextProcessingForm' ,
160
137
components: {
161
- TaskTypeFields,
162
138
NoProviderEmptyContent,
163
139
TaskList,
164
140
TaskTypeSelect,
@@ -172,9 +148,8 @@ export default {
172
148
UnfoldMoreHorizontalIcon,
173
149
HistoryIcon,
174
150
ArrowLeftIcon,
175
- NcNoteCard,
176
151
AssistantFormInputs,
177
- ContextChatOutputForm ,
152
+ AssistantFormOutputs ,
178
153
},
179
154
provide () {
180
155
return {
@@ -308,20 +283,11 @@ export default {
308
283
? t (' assistant' , ' Launch this task again' )
309
284
: t (' assistant' , ' Launch a task' )
310
285
},
311
- hasInitialOutput () {
312
- return !! this .outputs ? .output ? .trim ()
313
- },
314
286
hasOutput () {
315
287
return this .myOutputs
316
288
&& Object .keys (this .myOutputs ).length > 0
317
289
&& Object .values (this .myOutputs ).every (v => v !== null )
318
290
},
319
- outputEqualsInput () {
320
- if (typeof this .inputs .input === ' string' && typeof this .outputs .output === ' string' ) {
321
- return this .hasInitialOutput && this .outputs ? .output ? .trim () === this .inputs .input ? .trim ()
322
- }
323
- return false
324
- },
325
291
formattedOutput () {
326
292
if (this .mySelectedTaskTypeId === ' OCP\\ TextToImage\\ Task' ) {
327
293
return window .location .protocol + ' //' + window .location .host + generateUrl (' /apps/assistant/i/{imageGenId}' , { imageGenId: this .myOutput })
@@ -443,30 +409,6 @@ export default {
443
409
}
444
410
}
445
411
446
- .output {
447
- margin- top: 24px ;
448
- display: flex;
449
- flex- direction: column;
450
- align- items: start;
451
- justify- content: center;
452
-
453
- .warning - note {
454
- align- self : normal;
455
- }
456
-
457
- hr {
458
- width: 100 % ;
459
- }
460
-
461
- .input - label {
462
- align- self : start;
463
- font- weight: bold;
464
- }
465
- .output - fields {
466
- width: 100 % ;
467
- }
468
- }
469
-
470
412
.assistant - bubble {
471
413
align- self : start;
472
414
display: flex;
0 commit comments