@@ -132,7 +132,7 @@ async def main():
132132 # Show current conversation
133133 print ("Current conversation:" )
134134 current_items = await session .get_items ()
135- for i , item in enumerate (current_items , 1 ):
135+ for i , item in enumerate (current_items , 1 ): # type: ignore[assignment]
136136 role = str (item .get ("role" , item .get ("type" , "unknown" )))
137137 if item .get ("type" ) == "function_call" :
138138 content = f"{ item .get ('name' , 'unknown' )} ({ item .get ('arguments' , '{}' )} )"
@@ -151,8 +151,8 @@ async def main():
151151 # Show available turns for branching
152152 print ("\n Available turns for branching:" )
153153 turns = await session .get_conversation_turns ()
154- for turn in turns :
155- print (f" Turn { turn ['turn' ]} : { turn ['content' ]} " )
154+ for turn in turns : # type: ignore[assignment]
155+ print (f" Turn { turn ['turn' ]} : { turn ['content' ]} " ) # type: ignore[index]
156156
157157 # Create a branch from turn 2
158158 print ("\n Creating new branch from turn 2..." )
@@ -163,7 +163,7 @@ async def main():
163163 branch_items = await session .get_items ()
164164 print (f"Items copied to new branch: { len (branch_items )} " )
165165 print ("New branch contains:" )
166- for i , item in enumerate (branch_items , 1 ):
166+ for i , item in enumerate (branch_items , 1 ): # type: ignore[assignment]
167167 role = str (item .get ("role" , item .get ("type" , "unknown" )))
168168 if item .get ("type" ) == "function_call" :
169169 content = f"{ item .get ('name' , 'unknown' )} ({ item .get ('arguments' , '{}' )} )"
@@ -198,7 +198,7 @@ async def main():
198198 print ("\n === New Conversation Branch ===" )
199199 new_conversation = await session .get_items ()
200200 print ("New conversation with branch:" )
201- for i , item in enumerate (new_conversation , 1 ):
201+ for i , item in enumerate (new_conversation , 1 ): # type: ignore[assignment]
202202 role = str (item .get ("role" , item .get ("type" , "unknown" )))
203203 if item .get ("type" ) == "function_call" :
204204 content = f"{ item .get ('name' , 'unknown' )} ({ item .get ('arguments' , '{}' )} )"
@@ -224,8 +224,8 @@ async def main():
224224 # Show conversation turns in current branch
225225 print ("\n Conversation turns in current branch:" )
226226 current_turns = await session .get_conversation_turns ()
227- for turn in current_turns :
228- print (f" Turn { turn ['turn' ]} : { turn ['content' ]} " )
227+ for turn in current_turns : # type: ignore[assignment]
228+ print (f" Turn { turn ['turn' ]} : { turn ['content' ]} " ) # type: ignore[index]
229229
230230 print ("\n === Branch Switching Demo ===" )
231231 print ("We can switch back to the main branch..." )
0 commit comments