Skip to content

fix: simplify title generation event logic - #520

Merged
tusharmath merged 1 commit into
mainfrom
fix-title-generation-event
Mar 14, 2025
Merged

fix: simplify title generation event logic#520
tusharmath merged 1 commit into
mainfrom
fix-title-generation-event

Conversation

@tusharmath

Copy link
Copy Markdown
Collaborator

Description

This PR improves the way we track whether a message is the first one in a conversation by:

  1. Adding an is_first boolean flag to the UIState struct
  2. Creating a custom Default implementation for UIState where is_first is initialized to true
  3. Replacing the complex conversation history check with this simple boolean flag

Motivation

The previous approach required querying the conversation history to determine if a message was the first one, which was more complex and potentially less reliable. This change simplifies the logic and makes it more deterministic.

Changes

  • Added is_first: bool field to UIState struct
  • Implemented custom Default for UIState
  • Updated the chat method to use this flag instead of querying conversation history

@tusharmath
tusharmath merged commit e0aefce into main Mar 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant