Skip to content

Refactor role handling for flexible model output parsing#4

Open
MazenSalama wants to merge 2 commits into
bsides230:mainfrom
MazenSalama:fix-role-display
Open

Refactor role handling for flexible model output parsing#4
MazenSalama wants to merge 2 commits into
bsides230:mainfrom
MazenSalama:fix-role-display

Conversation

@MazenSalama

Copy link
Copy Markdown

No description provided.

The previous implementation used a hardcoded dictionary of role tags,
which only worked for models that used the `<|channel|>` format. This
caused incorrect display for other models.

This change refactors the role-handling logic to be more flexible:
- Role definitions are centralized in the `LyrnAIInterface` class,
  with separate maps for role names (from stream metadata) and role
  tags (from inline content).
- The `StreamHandler` is updated to use these new maps and can now
  process any string-based tag.
- The UI update logic in `process_queue` is simplified by using a new
  `display_prefix` message, making the display more reliable.
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