11"""Configurable runtime factory that supports model settings overrides."""
22
3+ import inspect
34import json
5+ import logging
46import os
57import tempfile
6- import logging
78from pathlib import Path
8- from typing import Any
99
1010from uipath .runtime import UiPathRuntimeFactoryProtocol , UiPathRuntimeProtocol
1111
1515
1616
1717class ConfigurableRuntimeFactory :
18- """
19- Wrapper factory that supports model settings overrides for evaluation runs.
18+ """Wrapper factory that supports model settings overrides for evaluation runs.
2019
2120 This factory wraps an existing UiPathRuntimeFactoryProtocol implementation
2221 and allows applying model settings overrides when creating runtimes.
@@ -29,17 +28,15 @@ def __init__(self, base_factory: UiPathRuntimeFactoryProtocol):
2928 self ._temp_files : list [str ] = []
3029
3130 def set_model_settings_override (self , settings : EvaluationSetModelSettings | None ) -> None :
32- """
33- Set model settings to override when creating runtimes.
31+ """Set model settings to override when creating runtimes.
3432
3533 Args:
3634 settings: The model settings to apply, or None to clear overrides
3735 """
3836 self .model_settings_override = settings
3937
4038 async def new_runtime (self , entrypoint : str , runtime_id : str ) -> UiPathRuntimeProtocol :
41- """
42- Create a new runtime with optional model settings overrides.
39+ """Create a new runtime with optional model settings overrides.
4340
4441 If model settings override is configured, creates a temporary modified
4542 entrypoint file with the overridden settings.
@@ -66,8 +63,7 @@ async def new_runtime(self, entrypoint: str, runtime_id: str) -> UiPathRuntimePr
6663 return await self .base_factory .new_runtime (entrypoint , runtime_id )
6764
6865 def _apply_overrides (self , entrypoint : str , settings : EvaluationSetModelSettings ) -> str | None :
69- """
70- Apply model settings overrides to an agent entrypoint.
66+ """Apply model settings overrides to an agent entrypoint.
7167
7268 Creates a temporary modified version of the entrypoint file with
7369 the specified model settings overrides applied.
@@ -150,17 +146,4 @@ async def dispose(self) -> None:
150146
151147 # Delegate disposal to base factory
152148 if hasattr (self .base_factory , 'dispose' ):
153- await self .base_factory .dispose ()
154-
155- # Delegate other factory protocol methods to base factory
156- async def discover_entrypoints (self ) -> list [str ]:
157- """Discover available entrypoints from the base factory."""
158- if hasattr (self .base_factory , 'discover_entrypoints' ):
159- return await self .base_factory .discover_entrypoints ()
160- return []
161-
162- async def discover_runtimes (self ) -> list [UiPathRuntimeProtocol ]:
163- """Discover available runtimes from the base factory."""
164- if hasattr (self .base_factory , 'discover_runtimes' ):
165- return await self .base_factory .discover_runtimes ()
166- return []
149+ await self .base_factory .dispose ()
0 commit comments