mirror of
https://github.com/github/awesome-copilot.git
synced 2026-03-20 08:05:12 +00:00
Fix ImportError: SessionEventType not exported from copilot public API (#1093)
* Initial plan * Fix ImportError: remove SessionEventType from copilot imports, use string comparisons Co-authored-by: aaronpowell <434140+aaronpowell@users.noreply.github.com> Agent-Logs-Url: https://github.com/github/awesome-copilot/sessions/0c514b95-5157-4aa9-8590-cbf3fd337472 --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: aaronpowell <434140+aaronpowell@users.noreply.github.com>
This commit is contained in:
@@ -45,7 +45,7 @@ import os
|
||||
import re
|
||||
from copilot import (
|
||||
CopilotClient, SessionConfig, MessageOptions,
|
||||
SessionEvent, SessionEventType,
|
||||
SessionEvent,
|
||||
)
|
||||
|
||||
# ============================================================================
|
||||
@@ -157,9 +157,9 @@ The current working directory is: {os.getcwd()}
|
||||
|
||||
# Set up event handling
|
||||
def handle_event(event: SessionEvent):
|
||||
if event.type == SessionEventType.ASSISTANT_MESSAGE:
|
||||
if event.type.value == "assistant.message":
|
||||
print(f"\n🤖 {event.data.content}\n")
|
||||
elif event.type == SessionEventType.TOOL_EXECUTION_START:
|
||||
elif event.type.value == "tool.execution_start":
|
||||
print(f" ⚙️ {event.data.tool_name}")
|
||||
elif event.type.value == "session.idle":
|
||||
done.set()
|
||||
|
||||
Reference in New Issue
Block a user