11# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
22from __future__ import annotations
33
4- import httpx
54import time
65
6+ import httpx
7+
78from .routes import (
89 RoutesResource ,
910 AsyncRoutesResource ,
@@ -646,9 +647,9 @@ def wait_until_ready(
646647 AgentRetrieveResponse: The agent response when it reaches STATUS_RUNNING
647648
648649 Raises:
649- AgentDeploymentError: If the agent deployment fails (STATUS_FAILED,
650+ AgentDeploymentError: If the agent deployment fails (STATUS_FAILED,
650651 STATUS_UNDEPLOYMENT_FAILED, or STATUS_DELETED)
651- AgentDeploymentTimeoutError: If the agent doesn't reach STATUS_RUNNING
652+ AgentDeploymentTimeoutError: If the agent doesn't reach STATUS_RUNNING
652653 within the timeout period
653654 ValueError: If uuid is empty
654655 """
@@ -658,7 +659,7 @@ def wait_until_ready(
658659 raise ValueError (f"Expected a non-empty value for `uuid` but received { uuid !r} " )
659660
660661 start_time = time .time ()
661-
662+
662663 while True :
663664 agent_response = self .retrieve (
664665 uuid ,
@@ -691,8 +692,7 @@ def wait_until_ready(
691692 else "UNKNOWN"
692693 )
693694 raise AgentDeploymentTimeoutError (
694- f"Agent did not reach STATUS_RUNNING within { timeout } seconds. "
695- f"Current status: { current_status } " ,
695+ f"Agent did not reach STATUS_RUNNING within { timeout } seconds. Current status: { current_status } " ,
696696 agent_id = uuid ,
697697 )
698698
@@ -1229,9 +1229,9 @@ async def wait_until_ready(
12291229 AgentRetrieveResponse: The agent response when it reaches STATUS_RUNNING
12301230
12311231 Raises:
1232- AgentDeploymentError: If the agent deployment fails (STATUS_FAILED,
1232+ AgentDeploymentError: If the agent deployment fails (STATUS_FAILED,
12331233 STATUS_UNDEPLOYMENT_FAILED, or STATUS_DELETED)
1234- AgentDeploymentTimeoutError: If the agent doesn't reach STATUS_RUNNING
1234+ AgentDeploymentTimeoutError: If the agent doesn't reach STATUS_RUNNING
12351235 within the timeout period
12361236 ValueError: If uuid is empty
12371237 """
@@ -1243,7 +1243,7 @@ async def wait_until_ready(
12431243 raise ValueError (f"Expected a non-empty value for `uuid` but received { uuid !r} " )
12441244
12451245 start_time = time .time ()
1246-
1246+
12471247 while True :
12481248 agent_response = await self .retrieve (
12491249 uuid ,
@@ -1276,8 +1276,7 @@ async def wait_until_ready(
12761276 else "UNKNOWN"
12771277 )
12781278 raise AgentDeploymentTimeoutError (
1279- f"Agent did not reach STATUS_RUNNING within { timeout } seconds. "
1280- f"Current status: { current_status } " ,
1279+ f"Agent did not reach STATUS_RUNNING within { timeout } seconds. Current status: { current_status } " ,
12811280 agent_id = uuid ,
12821281 )
12831282
0 commit comments