From 8d3e2bdcb4f184edc6d4346e8725a1983ad94200 Mon Sep 17 00:00:00 2001 From: Georgiy Tarasov Date: Fri, 6 Dec 2024 10:19:04 +0100 Subject: [PATCH] fix(product-assistant): filter out reasoning messages (#26648) --- ee/hogai/utils.py | 2 +- frontend/src/scenes/max/maxLogic.ts | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/ee/hogai/utils.py b/ee/hogai/utils.py index 278e2f4076495..559a369df83c8 100644 --- a/ee/hogai/utils.py +++ b/ee/hogai/utils.py @@ -31,7 +31,7 @@ class Conversation(BaseModel): - messages: list[RootAssistantMessage] = Field(..., min_length=1, max_length=20) + messages: list[RootAssistantMessage] = Field(..., min_length=1, max_length=50) session_id: str diff --git a/frontend/src/scenes/max/maxLogic.ts b/frontend/src/scenes/max/maxLogic.ts index aa8c66e7f9e40..f1f45f1d8ef69 100644 --- a/frontend/src/scenes/max/maxLogic.ts +++ b/frontend/src/scenes/max/maxLogic.ts @@ -4,7 +4,7 @@ import { createParser } from 'eventsource-parser' import { actions, afterMount, connect, kea, key, listeners, path, props, reducers, selectors } from 'kea' import { loaders } from 'kea-loaders' import api, { ApiError } from 'lib/api' -import { isHumanMessage, isVisualizationMessage } from 'scenes/max/utils' +import { isHumanMessage, isReasoningMessage, isVisualizationMessage } from 'scenes/max/utils' import { projectLogic } from 'scenes/projectLogic' import { @@ -84,6 +84,7 @@ export const maxLogic = kea([ }, ...state.slice(index + 1), ], + setThreadLoaded: (state) => state.filter((message) => !isReasoningMessage(message)), }, ], threadLoading: [