Skip to content

Commit c6a2167

Browse files
committed
fix: add chat context ids
1 parent 16001ec commit c6a2167

File tree

4 files changed

+24
-7
lines changed

4 files changed

+24
-7
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.2.2"
3+
version = "0.2.3"
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/chat/runtime.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,6 @@ async def stream(
7272

7373
yield event
7474

75-
await self.chat_bridge.disconnect()
76-
7775
async def get_schema(self) -> UiPathRuntimeSchema:
7876
"""Get schema from the delegate runtime."""
7977
return await self.delegate.get_schema()

src/uipath/runtime/context.py

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,9 @@ class UiPathRuntimeContext(BaseModel):
3131
resume: bool = False
3232
command: str | None = None
3333
job_id: str | None = None
34+
conversation_id: str | None = None
35+
exchange_id: str | None = None
36+
message_id: str | None = None
3437
tenant_id: str | None = None
3538
org_id: str | None = None
3639
folder_key: str | None = None
@@ -298,7 +301,7 @@ def from_config(
298301
) -> "UiPathRuntimeContext":
299302
"""Load configuration from uipath.json file."""
300303
path = config_path or "uipath.json"
301-
config = {}
304+
config: dict[str, Any] = {}
302305

303306
if os.path.exists(path):
304307
with open(path, "r") as f:
@@ -313,14 +316,30 @@ def from_config(
313316
"logsFile": "logs_file",
314317
}
315318

319+
fps_mappings = {
320+
"conversationId": "conversation_id",
321+
"exchangeId": "exchange_id",
322+
"messageId": "message_id",
323+
}
324+
316325
attributes_set = set()
317-
if "runtime" in config:
318-
runtime_config = config["runtime"]
326+
327+
runtime_config = config.get("runtime", {})
328+
fps_config = config.get("fpsProperties", {})
329+
330+
if runtime_config or fps_config:
331+
# Handle runtime mapping
319332
for config_key, attr_name in mapping.items():
320333
if config_key in runtime_config and hasattr(instance, attr_name):
321334
attributes_set.add(attr_name)
322335
setattr(instance, attr_name, runtime_config[config_key])
323336

337+
# Handle fpsProperties mapping
338+
for config_key, attr_name in fps_mappings.items():
339+
if config_key in fps_config and hasattr(instance, attr_name):
340+
attributes_set.add(attr_name)
341+
setattr(instance, attr_name, fps_config[config_key])
342+
324343
for _, attr_name in mapping.items():
325344
if attr_name in kwargs and hasattr(instance, attr_name):
326345
if attr_name not in attributes_set:

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)