@@ -87,16 +87,16 @@ async def on_message_delta(self, delta: MessageDelta, snapshot: Message):
8787 if content .text .value :
8888 assert content .text .value is not None
8989 if content .text .annotations :
90- for annot in content .text .annotations :
91- if annot .type == "file_citation" :
92- assert annot .end_index is not None
93- assert annot .file_citation .file_id
94- assert annot .file_citation .quote
95- assert annot .start_index is not None
96- elif annot .type == "file_path" :
97- assert annot .end_index is not None
98- assert annot .file_path .file_id
99- assert annot .start_index is not None
90+ for annotation in content .text .annotations :
91+ if annotation .type == "file_citation" :
92+ assert annotation .end_index is not None
93+ assert annotation .file_citation .file_id
94+ assert annotation .file_citation .quote
95+ assert annotation .start_index is not None
96+ elif annotation .type == "file_path" :
97+ assert annotation .end_index is not None
98+ assert annotation .file_path .file_id
99+ assert annotation .start_index is not None
100100 elif content .type == "image_file" :
101101 assert content .index is not None
102102 assert content .image_file .file_id
@@ -108,36 +108,36 @@ async def on_message_done(self, message: Message):
108108 if msg .type == "text" :
109109 assert msg .text .value
110110 if msg .text .annotations :
111- for annot in msg .text .annotations :
112- if annot .type == "file_citation" :
113- assert annot .end_index is not None
114- assert annot .file_citation .file_id
115- assert annot .file_citation .quote
116- assert annot .start_index is not None
117- assert annot .text is not None
118- elif annot .type == "file_path" :
119- assert annot .end_index is not None
120- assert annot .file_path .file_id
121- assert annot .start_index is not None
122- assert annot .text is not None
111+ for annotation in msg .text .annotations :
112+ if annotation .type == "file_citation" :
113+ assert annotation .end_index is not None
114+ assert annotation .file_citation .file_id
115+ assert annotation .file_citation .quote
116+ assert annotation .start_index is not None
117+ assert annotation .text is not None
118+ elif annotation .type == "file_path" :
119+ assert annotation .end_index is not None
120+ assert annotation .file_path .file_id
121+ assert annotation .start_index is not None
122+ assert annotation .text is not None
123123
124124 async def on_text_created (self , text : Text ):
125125 assert text .value is not None
126126
127127 async def on_text_done (self , text : Text ):
128128 assert text .value is not None
129- for annot in text .annotations :
130- if annot .type == "file_citation" :
131- assert annot .end_index is not None
132- assert annot .file_citation .file_id
133- assert annot .file_citation .quote
134- assert annot .start_index is not None
135- assert annot .text is not None
136- elif annot .type == "file_path" :
137- assert annot .end_index is not None
138- assert annot .file_path .file_id
139- assert annot .start_index is not None
140- assert annot .text is not None
129+ for annotation in text .annotations :
130+ if annotation .type == "file_citation" :
131+ assert annotation .end_index is not None
132+ assert annotation .file_citation .file_id
133+ assert annotation .file_citation .quote
134+ assert annotation .start_index is not None
135+ assert annotation .text is not None
136+ elif annotation .type == "file_path" :
137+ assert annotation .end_index is not None
138+ assert annotation .file_path .file_id
139+ assert annotation .start_index is not None
140+ assert annotation .text is not None
141141
142142 async def on_image_file_done (self , image_file : ImageFile ):
143143 assert image_file .file_id
@@ -178,6 +178,7 @@ async def on_tool_call_done(self, tool_call: ToolCall):
178178 assert tool_call .function .name is not None
179179
180180
181+ @pytest .mark .live_test_only
181182class TestAssistantsAsync (AzureRecordedTestCase ):
182183
183184 def handle_run_failure (self , run : Run ):
0 commit comments