@@ -45,7 +45,7 @@ import sys
4545
4646from copilot import CopilotClient, SessionConfig
4747from copilot.generated.session_events import SessionEvent, SessionEventType
48- from copilot.types import CopilotClientOptions, MessageOptions, SystemMessageAppendConfig
48+ from copilot.types import CopilotClientOptions, MessageOptions
4949
5050# ============================================================================
5151# Git & GitHub Detection
@@ -126,17 +126,17 @@ async def main():
126126
127127 owner, repo_name = repo.split(" /" , 1 )
128128
129- options = CopilotClientOptions(
130- log_level = " info" ,
131- )
129+ options: CopilotClientOptions = {
130+ " log_level" : " info" ,
131+ }
132132 # Create Copilot client - no custom tools needed!
133133 client = CopilotClient(options = options)
134134 await client.start()
135135
136- session_config = SessionConfig(
137- model = " gpt-5" ,
138- system_message = SystemMessageAppendConfig(
139- content = f """
136+ session_config: SessionConfig = {
137+ " model" : " gpt-5" ,
138+ " system_message" : {
139+ " content" : f """
140140<context>
141141You are analyzing pull requests for the GitHub repository: { owner} / { repo_name}
142142The current working directory is: { os.getcwd()}
@@ -149,8 +149,8 @@ The current working directory is: {os.getcwd()}
149149- Be concise in your responses
150150</instructions>
151151"""
152- ) ,
153- )
152+ } ,
153+ }
154154
155155 session = await client.create_session(config = session_config)
156156
@@ -166,16 +166,16 @@ The current working directory is: {os.getcwd()}
166166 # Initial prompt - let Copilot figure out the details
167167 print (" \n 📊 Starting analysis...\n " )
168168
169- message_options = MessageOptions(
170- prompt = f """
169+ message_options: MessageOptions = {
170+ " prompt" : f """
171171 Fetch the open pull requests for { owner} / { repo_name} from the last week.
172172 Calculate the age of each PR in days.
173173 Then generate a bar chart image showing the distribution of PR ages
174174 (group them into sensible buckets like <1 day, 1-3 days, etc.).
175175 Save the chart as "pr-age-chart.png" in the current directory.
176176 Finally, summarize the PR health - average age, oldest PR, and how many might be considered stale.
177- """ ,
178- )
177+ """
178+ }
179179
180180 await session.send_and_wait(options = message_options, timeout = 300.0 )
181181
@@ -196,7 +196,7 @@ The current working directory is: {os.getcwd()}
196196 break
197197
198198 if user_input:
199- message_options = MessageOptions( prompt = user_input)
199+ message_options: MessageOptions = { " prompt" : user_input}
200200 await session.send_and_wait(options = message_options, timeout = 300.0 )
201201
202202 await session.destroy()
0 commit comments