|
51 | 51 | </q-tree> |
52 | 52 | <template v-else> |
53 | 53 | <template v-for="(task, idx) in props.selectedThread" :key="task.id"> |
54 | | - <q-expansion-item v-if="reasoning.get(task.id)" label="thoughts:" dense> |
| 54 | + <q-expansion-item |
| 55 | + v-if="reasoning.get(task.id)" |
| 56 | + label="reasoning" |
| 57 | + dense |
| 58 | + class="text-caption" |
| 59 | + > |
55 | 60 | <tyMarkdown :src="reasoning.get(task.id)!" /> |
56 | 61 | </q-expansion-item> |
57 | 62 | <Task |
|
71 | 76 | </template> |
72 | 77 | <!--Render tasks which are in progress--> |
73 | 78 | <div class="task-logs q-py-sm"> |
| 79 | + <tyMarkdown |
| 80 | + v-if=" |
| 81 | + currentMessageStream?.length === 0 && |
| 82 | + currentThinkingStream && |
| 83 | + currentThinkingStream.length > 0 |
| 84 | + " |
| 85 | + no-line-numbers |
| 86 | + no-mermaid |
| 87 | + :src="'THINKING:\n' + currentThinkingStream?.split('\n').slice(-20).join('\n')" |
| 88 | + class="text-caption" |
| 89 | + style="font-size: 0.8rem" |
| 90 | + > |
| 91 | + </tyMarkdown> |
74 | 92 | <q-card |
75 | 93 | v-if=" |
76 | 94 | !!tystate.lastTaskState.get(currentTask.id) && |
|
80 | 98 | flat |
81 | 99 | > |
82 | 100 | <div class="col"> |
83 | | - <tyMarkdown v-if="!currentMessageStream && currentThinkingStream"> |
84 | | - {{ currentThinkingStream?.slice(-200) }} |
85 | | - </tyMarkdown> |
86 | 101 | <tyMarkdown |
87 | 102 | v-if="currentMessageStream" |
88 | 103 | no-line-numbers |
89 | 104 | no-mermaid |
90 | | - :use-iframe="false" |
91 | 105 | :src="currentMessageStream || ''" |
92 | 106 | /> |
93 | 107 | <div> |
@@ -156,11 +170,12 @@ const props = defineProps<{ |
156 | 170 |
|
157 | 171 | const reasoning = ref(new Map<string, string>()) |
158 | 172 | watch( |
159 | | - props.selectedThread, |
160 | | - (thread) => { |
| 173 | + () => props.currentTask.id, |
| 174 | + () => { |
| 175 | + console.log('re-calculate reason lists!') |
161 | 176 | reasoning.value.clear() |
162 | 177 | void Promise.all( |
163 | | - thread.map(async (t) => { |
| 178 | + props.selectedThread.map(async (t) => { |
164 | 179 | const meta = await tystate.getMeta(t.id) |
165 | 180 | if (meta) { |
166 | 181 | const reason = getReasoning(meta) |
@@ -222,9 +237,9 @@ const currentMessageStream = computed(() => { |
222 | 237 | }) |
223 | 238 |
|
224 | 239 | const currentThinkingStream = computed(() => { |
225 | | - if (props.currentTask) |
| 240 | + if (props.currentTask) { |
226 | 241 | return streamingTracker.value.get(props.currentTask.id)?.choices?.[0]?.reasoning || '' |
227 | | - else return undefined |
| 242 | + } else return undefined |
228 | 243 | }) |
229 | 244 |
|
230 | 245 | const currentFunctionStream = computed(() => { |
|
0 commit comments