Skip to content

Commit ff96290

Browse files
committed
fix: update readme
1 parent d671446 commit ff96290

File tree

1 file changed

+13
-10
lines changed

1 file changed

+13
-10
lines changed

README.md

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
# UiPath Runtime
22

3+
[![PyPI downloads](https://img.shields.io/pypi/dm/uipath-runtime.svg)](https://pypi.org/project/uipath-runtime/)
4+
[![Python versions](https://img.shields.io/pypi/pyversions/uipath-runtime.svg)](https://pypi.org/project/uipath-runtime/)
5+
36
Core runtime abstractions and contracts for the UiPath Python SDK.
47

58
## Overview
@@ -36,7 +39,7 @@ class MyCustomRuntime(UiPathBaseRuntime):
3639

3740
async def stream(
3841
self,
39-
) -> AsyncGenerator[Union[UiPathRuntimeEvent, UiPathRuntimeResult], None]:
42+
) -> AsyncGenerator[UiPathRuntimeEvent, None]:
4043
# Stream events during execution for real-time monitoring
4144
yield UiPathRuntimeStateEvent(
4245
payload={"status": "starting"},
@@ -69,30 +72,30 @@ class MyCustomRuntime(UiPathBaseRuntime):
6972
The factory pattern handles runtime instantiation, instrumentation, and tracing:
7073

7174
```python
72-
from uipath.runtime import UiPathRuntimeFactory, UiPathRuntimeContext
75+
from uipath.runtime import UiPathRuntimeFactory, UiPathRuntimeContext, UiPathRuntimeExecutor
7376

74-
factory = UiPathRuntimeFactory(
75-
MyCustomRuntime,
76-
UiPathRuntimeContext,
77-
)
77+
factory = UiPathRuntimeFactory(MyCustomRuntime)
78+
79+
executor = UiPathRuntimeExecutor()
7880

7981
# Add OpenTelemetry instrumentation
80-
factory.add_instrumentor(MyInstrumentor, get_current_span)
82+
executor.add_instrumentor(MyInstrumentor, get_current_span)
8183

8284
# Add span exporters for tracing
83-
factory.add_span_exporter(JsonLinesFileExporter("trace.jsonl"))
85+
executor.add_span_exporter(JsonLinesFileExporter("trace.jsonl"))
8486

8587
# Execute
8688
context = UiPathRuntimeContext(entrypoint="main.py", input='{"query": "hello"}')
87-
result = await factory.execute(context)
89+
async with factory.from_context(context):
90+
result = await executor.execute(runtime)
8891
```
8992

9093
### Event Streaming
9194

9295
Runtimes can stream events during execution for real-time monitoring:
9396

9497
```python
95-
async for event in factory.stream(context):
98+
async for event in executor.stream(runtime):
9699
if isinstance(event, UiPathRuntimeStateEvent):
97100
print(f"State update: {event.payload}")
98101
elif isinstance(event, UiPathRuntimeMessageEvent):

0 commit comments

Comments
 (0)