-
Notifications
You must be signed in to change notification settings - Fork 56
Fix delegation visualization labels to show correct sender/receiver #1119
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
37206de
792ff4c
9d9377c
dd090cd
7938989
ede1f04
ec29096
e049427
51a554f
65faa7e
cd046ca
1fe8889
f89e115
c8f4182
bbf2183
4e86e98
8c778b0
c00319c
d8b7b58
64fbecd
8ed9293
06a9076
b75ae23
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -18,7 +18,7 @@ class ConversationVisualizerBase(ABC): | |
|
|
||
| The typical usage pattern: | ||
| 1. Create a visualizer instance: | ||
| `viz = MyVisualizer(name="agent1")` | ||
| `viz = MyVisualizer()` | ||
| 2. Pass it to Conversation: `conv = Conversation(agent, visualizer=viz)` | ||
| 3. Conversation automatically calls `viz.initialize(state)` to attach the state | ||
|
|
||
|
|
@@ -28,21 +28,10 @@ class ConversationVisualizerBase(ABC): | |
| Conversation will then calls `MyVisualizer()` followed by `initialize(state)` | ||
| """ | ||
|
|
||
| _name: str | None | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. is there anyway that we are not breaking this? removing this is a breaking changes. But i do see doing so would simplify our code and hopefully have minimal impact to users
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do we have any other breaking change for 1.0.1 ?
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I mean if you know, off-hand. Don't worry if you don't! I'll find out automatically
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this |
||
| _state: "ConversationStateProtocol | None" | ||
|
|
||
| def __init__( | ||
| self, | ||
| name: str | None = None, | ||
| ): | ||
| """Initialize the visualizer base. | ||
|
|
||
| Args: | ||
| name: Optional name to prefix in panel titles to identify | ||
| which agent/conversation is speaking. Will be | ||
| capitalized automatically. | ||
| """ | ||
| self._name = name.capitalize() if name else None | ||
| def __init__(self): | ||
| """Initialize the visualizer base.""" | ||
| self._state = None | ||
|
|
||
| @final | ||
|
|
@@ -60,14 +49,6 @@ def initialize(self, state: "ConversationStateProtocol") -> None: | |
| """ | ||
| self._state = state | ||
|
|
||
| def update_name(self, name: str | None) -> None: | ||
| """Update the name used for visualization. | ||
|
|
||
| Args: | ||
| name: New name to use for visualization | ||
| """ | ||
| self._name = name.capitalize() if name else None | ||
|
|
||
| @property | ||
| def conversation_stats(self) -> "ConversationStats | None": | ||
| """Get conversation stats from the state.""" | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -43,6 +43,13 @@ class MessageEvent(LLMConvertibleEvent): | |
| extended_content: list[TextContent] = Field( | ||
| default_factory=list, description="List of content added by agent context" | ||
| ) | ||
| sender: str | None = Field( | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please let me try to see if I got this right, so right now, on the PR, we save a
🤔
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Agreed that's a bit sketchy! |
||
| default=None, | ||
| description=( | ||
| "Optional identifier of the sender. " | ||
| "Can be used to track message origin in multi-agent scenarios." | ||
| ), | ||
| ) | ||
|
|
||
| @property | ||
| def reasoning_content(self) -> str: | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.