From d6b15efa63e92aa5ca7867c7165b06c8d3dc7590 Mon Sep 17 00:00:00 2001 From: Maurice Date: Fri, 23 Oct 2026 13:10:55 +0200 Subject: [PATCH] feat(assistant): the model offers the follow-up questions that fit the conversation A turn may end on suggest_follow_ups: the server answers the call itself, keeps its questions as data-trek-follow-ups and the chat shows them as chips under the answer. Without them the chips fall back to what the answer holds, now by the kind of change: a tour asks about the tour, the day plan's questions only follow a change to the day plan, and an answer that asks the user something offers no "tell me more". --- .../Assistant/AssistantFollowUps.tsx | 2 +- .../Assistant/assistantFollowUpRules.test.ts | 60 ++++++++++++- .../Assistant/assistantFollowUpRules.ts | 74 ++++++++++++++-- client/src/store/assistantMessages.ts | 2 + server/src/nest/assistant/assistant-agent.ts | 30 +++++-- .../nest/assistant/assistant-follow-ups.ts | 54 ++++++++++++ .../nest/assistant/assistant-tools.service.ts | 9 +- server/src/nest/assistant/assistant.prompt.ts | 2 + server/src/nest/assistant/ui-stream.writer.ts | 6 ++ .../nest/assistant/assistant-agent.test.ts | 86 ++++++++++++++++++- .../assistant-journey-session.test.ts | 5 +- .../assistant/assistant-tools.service.test.ts | 2 + shared/src/assistant/assistant.schema.ts | 19 ++++ 13 files changed, 330 insertions(+), 21 deletions(-) create mode 100644 server/src/nest/assistant/assistant-follow-ups.ts diff --git a/client/src/components/Assistant/AssistantFollowUps.tsx b/client/src/components/Assistant/AssistantFollowUps.tsx index 2947a3a83..ed27ce1b2 100644 --- a/client/src/components/Assistant/AssistantFollowUps.tsx +++ b/client/src/components/Assistant/AssistantFollowUps.tsx @@ -35,7 +35,7 @@ export default function AssistantFollowUps({ message }: { message: AssistantMess return (
{chips.map((chip, i) => { - const text = t(chip.labelKey); + const text = chip.text ?? t(chip.labelKey); return (