55from dataclasses import dataclass
66from typing import Any , Dict , Optional
77
8- from oak_runner import OAKRunner , WorkflowExecutionResult , WorkflowExecutionStatus
8+ from arazzo_runner import ArazzoRunner , WorkflowExecutionResult , WorkflowExecutionStatus
99
1010from jentic import api
1111from jentic .api import JenticAPIClient
@@ -54,7 +54,7 @@ def __init__(self, api_hub_client: Optional[JenticAPIClient] = None):
5454 self .api_hub_client = api_hub_client or JenticAPIClient ()
5555
5656 async def execute_workflow (self , workflow_uuid : str , inputs : Dict [str , Any ]) -> WorkflowResult :
57- """Executes a specified workflow using OAK runner.
57+ """Executes a specified workflow using Arazzo runner.
5858
5959 Args:
6060 workflow_uuid: The UUID of the workflow to execute.
@@ -94,18 +94,18 @@ async def execute_workflow(self, workflow_uuid: str, inputs: Dict[str, Any]) ->
9494 error = f"Arazzo document or internal workflow ID missing for { workflow_uuid } " ,
9595 )
9696
97- # 4. Instantiate OAKRunner
97+ # 4. Instantiate ArazzoRunner
9898 logger .debug (
99- f"Instantiating OAKRunner for internal workflow ID: { friendly_workflow_id } "
99+ f"Instantiating ArazzoRunner for internal workflow ID: { friendly_workflow_id } "
100100 )
101- runner = OAKRunner (
101+ runner = ArazzoRunner (
102102 arazzo_doc = arazzo_doc ,
103103 source_descriptions = source_descriptions ,
104104 )
105105
106106 # 5. Execute the workflow using the INTERNAL workflow ID
107107 logger .debug (
108- f"Running workflow { friendly_workflow_id } via OAKRunner with UUID { workflow_uuid } ."
108+ f"Running workflow { friendly_workflow_id } via ArazzoRunner with UUID { workflow_uuid } ."
109109 )
110110 # Removed await as runner.execute_workflow seems synchronous based on TypeError
111111 execution_output : WorkflowExecutionResult = runner .execute_workflow (
@@ -136,7 +136,7 @@ async def execute_operation(
136136 inputs : Dict [str , Any ],
137137 ) -> OperationResult :
138138 """
139- Executes a specified API operation using OAKRunner after fetching required files from the API.
139+ Executes a specified API operation using ArazzoRunner after fetching required files from the API.
140140
141141 Args:
142142 operation_uuid: The UUID of the operation to execute.
@@ -167,7 +167,7 @@ async def execute_operation(
167167 )
168168 operation_entry = exec_files_response .operations [operation_uuid ]
169169
170- # Prepare OpenAPI spec for OAKRunner
170+ # Prepare OpenAPI spec for ArazzoRunner
171171 openapi_content = None
172172 openapi_files = exec_files_response .files .get ("open_api" , {})
173173 if operation_entry .files .open_api :
@@ -183,15 +183,15 @@ async def execute_operation(
183183 )
184184 source_descriptions = {"default" : openapi_content }
185185
186- # Prepare OAKRunner and execute the operation
187- runner = OAKRunner (source_descriptions = source_descriptions )
186+ # Prepare ArazzoRunner and execute the operation
187+ runner = ArazzoRunner (source_descriptions = source_descriptions )
188188 # Pass operation_uuid, path, and method from the operation_entry
189- oak_result : Any = runner .execute_operation (
189+ runner_result : Any = runner .execute_operation (
190190 inputs = inputs , operation_path = f"{ operation_entry .method } { operation_entry .path } "
191191 )
192- logger .debug (f"Operation execution result: { oak_result } " )
192+ logger .debug (f"Operation execution result: { runner_result } " )
193193
194- return self ._process_operation_result (oak_result , operation_uuid , inputs )
194+ return self ._process_operation_result (runner_result , operation_uuid , inputs )
195195 except Exception as e :
196196 logger .exception (f"Error executing operation { operation_uuid } : { e } " )
197197 return OperationResult (
@@ -201,18 +201,18 @@ async def execute_operation(
201201 )
202202
203203 def _process_operation_result (
204- self , oak_result : Dict [str , Any ], operation_uuid : str , inputs : Dict [str , Any ]
204+ self , runner_result : Dict [str , Any ], operation_uuid : str , inputs : Dict [str , Any ]
205205 ) -> "OperationResult" :
206- """Process the OAKRunner operation result, check status codes, and handle casting.
206+ """Process the ArazzoRunner operation result, check status codes, and handle casting.
207207
208208 Args:
209- oak_result : The result dictionary from OAKRunner .execute_operation.
209+ runner_result : The result dictionary from ArazzoRunner .execute_operation.
210210 operation_uuid: The UUID of the operation being executed, for logging.
211211
212212 Returns:
213213 An OperationResult object.
214214 """
215- status_code_uncast = oak_result .get ("status_code" )
215+ status_code_uncast = runner_result .get ("status_code" )
216216
217217 if status_code_uncast is None :
218218 logger .debug (
@@ -221,7 +221,7 @@ def _process_operation_result(
221221 )
222222 return OperationResult (
223223 success = True ,
224- output = oak_result .get ("body" ) if "body" in oak_result else oak_result ,
224+ output = runner_result .get ("body" ) if "body" in runner_result else runner_result ,
225225 inputs = inputs ,
226226 )
227227
@@ -240,7 +240,7 @@ def _process_operation_result(
240240 return OperationResult (
241241 success = False ,
242242 error = f"Invalid status_code format: '{ status_code_uncast } '. Expected an integer or integer-convertible value." ,
243- output = oak_result , # Include full OAK result for context on casting errors
243+ output = runner_result , # Include full OAK result for context on casting errors
244244 inputs = inputs ,
245245 )
246246 else :
@@ -252,12 +252,12 @@ def _process_operation_result(
252252 return OperationResult (
253253 success = True ,
254254 status_code = status_code ,
255- output = oak_result .get ("body" ) if "body" in oak_result else oak_result ,
255+ output = runner_result .get ("body" ) if "body" in runner_result else runner_result ,
256256 inputs = inputs ,
257257 )
258258 else :
259259 # Non-2xx status code, indicates an error
260- body_content = oak_result .get ("body" )
260+ body_content = runner_result .get ("body" )
261261 error_detail = ""
262262
263263 if isinstance (body_content , dict ):
@@ -284,7 +284,7 @@ def _process_operation_result(
284284 success = False ,
285285 status_code = status_code ,
286286 error = error_detail ,
287- output = oak_result , # Return the full OAK result as output for context on errors
287+ output = runner_result , # Return the full OAK result as output for context on errors
288288 inputs = inputs ,
289289 )
290290
0 commit comments