Skip to content

Commit

Permalink
fix(product-assistant): filter out reasoning messages (#26648)
Browse files Browse the repository at this point in the history
  • Loading branch information
skoob13 authored Dec 6, 2024
1 parent 8b7c348 commit 8d3e2bd
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion ee/hogai/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand Down
3 changes: 2 additions & 1 deletion frontend/src/scenes/max/maxLogic.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -84,6 +84,7 @@ export const maxLogic = kea<maxLogicType>([
},
...state.slice(index + 1),
],
setThreadLoaded: (state) => state.filter((message) => !isReasoningMessage(message)),
},
],
threadLoading: [
Expand Down

0 comments on commit 8d3e2bd

Please sign in to comment.