diff --git a/packages/client/hmi-client/src/components/llm/tera-notebook-jupyter-input.vue b/packages/client/hmi-client/src/components/llm/tera-notebook-jupyter-input.vue index 82cc7f4c49..41ea72b991 100644 --- a/packages/client/hmi-client/src/components/llm/tera-notebook-jupyter-input.vue +++ b/packages/client/hmi-client/src/components/llm/tera-notebook-jupyter-input.vue @@ -98,6 +98,7 @@ const submitQuestion = () => { const message = props.kernelManager.sendMessage('llm_request', { request: questionString.value }); + llmThoughts.value = []; emit('question-asked', questionString.value); // May prefer to use a manual status rather than following this. TBD. Both options work for now @@ -110,12 +111,16 @@ const submitQuestion = () => { }); message.register('llm_thought', (data) => { thoughts.value = data; - llmThoughts.value = []; llmThoughts.value.push(data); llmQuery.value = questionString.value; emit('llm-thought-output', data); }); message.register('llm_response', (data) => { + // Check if our llm_response is providing a response text to a user's question + if (data.content.name === 'response_text') { + llmThoughts.value = []; + llmThoughts.value.push(data); + } thoughts.value = data; emit('llm-thought-output', data); });