|
3 | 3 | from ...agent_payload_utils import build_agent_start_payload |
4 | 4 | from ...agent_status_utils import is_agent_terminal_status |
5 | 5 | from ...agent_stop_utils import stop_agent_task_async |
| 6 | +from ...agent_task_read_utils import get_agent_task_async, get_agent_task_status_async |
6 | 7 | from ...job_wait_utils import wait_for_job_result_with_defaults_async |
7 | 8 | from ...response_utils import parse_response_model |
8 | 9 | from ...start_job_utils import build_started_job_context |
@@ -43,21 +44,19 @@ async def start( |
43 | 44 | ) |
44 | 45 |
|
45 | 46 | async def get(self, job_id: str) -> ClaudeComputerUseTaskResponse: |
46 | | - response = await self._client.transport.get( |
47 | | - self._client._build_url(f"/task/claude-computer-use/{job_id}") |
48 | | - ) |
49 | | - return parse_response_model( |
50 | | - response.data, |
| 47 | + return await get_agent_task_async( |
| 48 | + client=self._client, |
| 49 | + route_prefix="/task/claude-computer-use", |
| 50 | + job_id=job_id, |
51 | 51 | model=ClaudeComputerUseTaskResponse, |
52 | 52 | operation_name="claude computer use task", |
53 | 53 | ) |
54 | 54 |
|
55 | 55 | async def get_status(self, job_id: str) -> ClaudeComputerUseTaskStatusResponse: |
56 | | - response = await self._client.transport.get( |
57 | | - self._client._build_url(f"/task/claude-computer-use/{job_id}/status") |
58 | | - ) |
59 | | - return parse_response_model( |
60 | | - response.data, |
| 56 | + return await get_agent_task_status_async( |
| 57 | + client=self._client, |
| 58 | + route_prefix="/task/claude-computer-use", |
| 59 | + job_id=job_id, |
61 | 60 | model=ClaudeComputerUseTaskStatusResponse, |
62 | 61 | operation_name="claude computer use task status", |
63 | 62 | ) |
|
0 commit comments