Skip to content

Commit 0cdf409

Browse files
Fix Python sample event type comparison
event.type is a SessionEventType enum, not a string - use .value for comparison Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 9b6fbd8 commit 0cdf409

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

python/samples/chat.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ async def main():
1212

1313
def on_event(event):
1414
output = None
15-
if event.type == "assistant.reasoning":
15+
if event.type.value == "assistant.reasoning":
1616
output = f"[reasoning: {event.data.content}]"
17-
elif event.type == "tool.execution_start":
17+
elif event.type.value == "tool.execution_start":
1818
output = f"[tool: {event.data.tool_name}]"
1919
if output:
2020
print(f"{BLUE}{output}{RESET}")

0 commit comments

Comments
 (0)