Skip to content

Commit 4943fea

Browse files
committed
update
1 parent fb014cb commit 4943fea

File tree

1 file changed

+5
-0
lines changed
  • sdk/ai/azure-ai-agents/azure/ai/agents/aio/operations

1 file changed

+5
-0
lines changed

sdk/ai/azure-ai-agents/azure/ai/agents/aio/operations/_patch.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff 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

0 commit comments

Comments
 (0)