22
33from hyperbrowser .exceptions import HyperbrowserError
44from ....polling import build_operation_name , wait_for_job_result_async
5+ from ...response_utils import parse_response_model
56
67from .....models import (
78 POLLING_ATTEMPTS ,
@@ -24,25 +25,41 @@ async def start(
2425 self ._client ._build_url ("/task/claude-computer-use" ),
2526 data = params .model_dump (exclude_none = True , by_alias = True ),
2627 )
27- return StartClaudeComputerUseTaskResponse (** response .data )
28+ return parse_response_model (
29+ response .data ,
30+ model = StartClaudeComputerUseTaskResponse ,
31+ operation_name = "claude computer use start" ,
32+ )
2833
2934 async def get (self , job_id : str ) -> ClaudeComputerUseTaskResponse :
3035 response = await self ._client .transport .get (
3136 self ._client ._build_url (f"/task/claude-computer-use/{ job_id } " )
3237 )
33- return ClaudeComputerUseTaskResponse (** response .data )
38+ return parse_response_model (
39+ response .data ,
40+ model = ClaudeComputerUseTaskResponse ,
41+ operation_name = "claude computer use task" ,
42+ )
3443
3544 async def get_status (self , job_id : str ) -> ClaudeComputerUseTaskStatusResponse :
3645 response = await self ._client .transport .get (
3746 self ._client ._build_url (f"/task/claude-computer-use/{ job_id } /status" )
3847 )
39- return ClaudeComputerUseTaskStatusResponse (** response .data )
48+ return parse_response_model (
49+ response .data ,
50+ model = ClaudeComputerUseTaskStatusResponse ,
51+ operation_name = "claude computer use task status" ,
52+ )
4053
4154 async def stop (self , job_id : str ) -> BasicResponse :
4255 response = await self ._client .transport .put (
4356 self ._client ._build_url (f"/task/claude-computer-use/{ job_id } /stop" )
4457 )
45- return BasicResponse (** response .data )
58+ return parse_response_model (
59+ response .data ,
60+ model = BasicResponse ,
61+ operation_name = "claude computer use task stop" ,
62+ )
4663
4764 async def start_and_wait (
4865 self ,
0 commit comments