Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions jupyter_ai_persona_manager/base_persona.py
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,9 @@ async def stream_message(
stream, then continuously updates it until the stream is closed.

- Automatically manages its awareness state to show writing status.

- Triggers mention detection after streaming completes, allowing
personas to mention each other in their responses.
"""
stream_id: Optional[str] = None
try:
Expand Down Expand Up @@ -266,7 +269,17 @@ async def stream_message(
raw_time=False,
),
append=True,
find_mentions=False, # Defer mention extraction during streaming
)

# Stream complete - trigger mention extraction and notifications
if stream_id:
msg = self.ychat.get_message(stream_id)
if msg:
self.ychat.update_message(
msg,
find_mentions=True, # Extract mentions and notify mentioned personas
)
except Exception as e:
self.log.error(
f"Persona '{self.name}' encountered an exception printed below when attempting to stream output."
Expand Down
Loading