Skip to content

Commit b759ecc

Browse files
committed
fix: add warmup method to factory protocol
1 parent 189bfde commit b759ecc

File tree

5 files changed

+18
-2
lines changed

5 files changed

+18
-2
lines changed

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "uipath-runtime"
3-
version = "0.6.2"
3+
version = "0.7.0"
44
description = "Runtime abstractions and interfaces for building agents and automation scripts in the UiPath ecosystem"
55
readme = { file = "README.md", content-type = "text/markdown" }
66
requires-python = ">=3.11"

src/uipath/runtime/factory.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,10 @@ class UiPathRuntimeFactoryProtocol(
2626
):
2727
"""Protocol for discovering and creating UiPath runtime instances."""
2828

29+
async def warmup(self) -> None:
30+
"""Pre-load modules and resources to reduce cold start latency."""
31+
...
32+
2933
def discover_entrypoints(self) -> list[str]:
3034
"""Discover all runtime entrypoints."""
3135
...

tests/test_factory.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,9 @@ async def dispose(self) -> None:
6666
class CreatorWithKwargs:
6767
"""Implementation with kwargs."""
6868

69+
async def warmup(self) -> None:
70+
pass
71+
6972
def discover_entrypoints(self) -> list[str]:
7073
return ["main.py"]
7174

tests/test_registry.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,9 @@ def __init__(self, context: Optional[UiPathRuntimeContext] = None):
7171
self.context = context
7272
self.name = "functions"
7373

74+
async def warmup(self) -> None:
75+
pass
76+
7477
def discover_entrypoints(self) -> list[str]:
7578
return ["main.py", "handler.py"]
7679

@@ -96,6 +99,9 @@ def __init__(self, context: Optional[UiPathRuntimeContext] = None):
9699
self.context = context
97100
self.name = "langgraph"
98101

102+
async def warmup(self) -> None:
103+
pass
104+
99105
def discover_entrypoints(self) -> list[str]:
100106
return ["agent", "workflow"]
101107

@@ -121,6 +127,9 @@ def __init__(self, context: Optional[UiPathRuntimeContext] = None):
121127
self.context = context
122128
self.name = "llamaindex"
123129

130+
async def warmup(self) -> None:
131+
pass
132+
124133
def discover_entrypoints(self) -> list[str]:
125134
return ["chatbot", "rag"]
126135

uv.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)