File tree Expand file tree Collapse file tree 1 file changed +5
-0
lines changed
sdk/ai/azure-ai-agents/azure/ai/agents/aio/operations Expand file tree Collapse file tree 1 file changed +5
-0
lines changed Original file line number Diff line number Diff line change @@ -1934,6 +1934,8 @@ async def create_and_poll(
19341934 :raises ~azure.core.exceptions.HttpResponseError:
19351935 """
19361936
1937+ curr_time = time .monotonic ()
1938+
19371939 if body is not _Unset :
19381940 if isinstance (body , dict ):
19391941 vector_store_file_batch = await super ().create (
@@ -1961,6 +1963,9 @@ async def create_and_poll(
19611963 )
19621964
19631965 while vector_store_file_batch .status == "in_progress" :
1966+ if timeout is not None and (time .monotonic () - curr_time - sleep_interval ) >= timeout :
1967+ raise TimeoutError ("Timeout reached. Stopping polling." )
1968+
19641969 await asyncio .sleep (sleep_interval )
19651970 vector_store_file_batch = await super ().get (
19661971 vector_store_id = vector_store_id , batch_id = vector_store_file_batch .id
You can’t perform that action at this time.
0 commit comments