uipath-core 0.2.4__py3-none-any.whl → 0.3.1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- uipath/core/chat/__init__.py +14 -0
- uipath/core/chat/interrupt.py +67 -10
- uipath/core/guardrails/guardrails.py +34 -2
- {uipath_core-0.2.4.dist-info → uipath_core-0.3.1.dist-info}/METADATA +1 -1
- {uipath_core-0.2.4.dist-info → uipath_core-0.3.1.dist-info}/RECORD +7 -7
- {uipath_core-0.2.4.dist-info → uipath_core-0.3.1.dist-info}/WHEEL +0 -0
- {uipath_core-0.2.4.dist-info → uipath_core-0.3.1.dist-info}/licenses/LICENSE +0 -0
uipath/core/chat/__init__.py
CHANGED
|
@@ -79,9 +79,16 @@ from .exchange import (
|
|
|
79
79
|
UiPathConversationExchangeStartEvent,
|
|
80
80
|
)
|
|
81
81
|
from .interrupt import (
|
|
82
|
+
InterruptTypeEnum,
|
|
83
|
+
UiPathConversationGenericInterruptEndEvent,
|
|
84
|
+
UiPathConversationGenericInterruptStartEvent,
|
|
82
85
|
UiPathConversationInterruptEndEvent,
|
|
83
86
|
UiPathConversationInterruptEvent,
|
|
84
87
|
UiPathConversationInterruptStartEvent,
|
|
88
|
+
UiPathConversationToolCallConfirmationEndValue,
|
|
89
|
+
UiPathConversationToolCallConfirmationInterruptEndEvent,
|
|
90
|
+
UiPathConversationToolCallConfirmationInterruptStartEvent,
|
|
91
|
+
UiPathConversationToolCallConfirmationValue,
|
|
85
92
|
)
|
|
86
93
|
from .message import (
|
|
87
94
|
UiPathConversationMessage,
|
|
@@ -122,9 +129,16 @@ __all__ = [
|
|
|
122
129
|
"UiPathConversationMessageEvent",
|
|
123
130
|
"UiPathConversationMessage",
|
|
124
131
|
# Interrupt
|
|
132
|
+
"InterruptTypeEnum",
|
|
125
133
|
"UiPathConversationInterruptStartEvent",
|
|
126
134
|
"UiPathConversationInterruptEndEvent",
|
|
127
135
|
"UiPathConversationInterruptEvent",
|
|
136
|
+
"UiPathConversationToolCallConfirmationValue",
|
|
137
|
+
"UiPathConversationToolCallConfirmationEndValue",
|
|
138
|
+
"UiPathConversationToolCallConfirmationInterruptStartEvent",
|
|
139
|
+
"UiPathConversationToolCallConfirmationInterruptEndEvent",
|
|
140
|
+
"UiPathConversationGenericInterruptStartEvent",
|
|
141
|
+
"UiPathConversationGenericInterruptEndEvent",
|
|
128
142
|
# Content
|
|
129
143
|
"UiPathConversationContentPartChunkEvent",
|
|
130
144
|
"UiPathConversationContentPartStartEvent",
|
uipath/core/chat/interrupt.py
CHANGED
|
@@ -1,12 +1,39 @@
|
|
|
1
1
|
"""Interrupt events for human-in-the-loop patterns."""
|
|
2
2
|
|
|
3
|
-
from
|
|
3
|
+
from enum import Enum
|
|
4
|
+
from typing import Any, Literal, Union
|
|
4
5
|
|
|
5
6
|
from pydantic import BaseModel, ConfigDict, Field
|
|
6
7
|
|
|
7
8
|
|
|
8
|
-
class
|
|
9
|
-
"""
|
|
9
|
+
class InterruptTypeEnum(str, Enum):
|
|
10
|
+
"""Enum of known interrupt types."""
|
|
11
|
+
|
|
12
|
+
TOOL_CALL_CONFIRMATION = "uipath_cas_tool_call_confirmation"
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
class UiPathConversationToolCallConfirmationValue(BaseModel):
|
|
16
|
+
"""Schema for tool call confirmation interrupt value."""
|
|
17
|
+
|
|
18
|
+
tool_call_id: str = Field(..., alias="toolCallId")
|
|
19
|
+
tool_name: str = Field(..., alias="toolName")
|
|
20
|
+
input_schema: Any = Field(..., alias="inputSchema")
|
|
21
|
+
input_value: Any | None = Field(None, alias="inputValue")
|
|
22
|
+
|
|
23
|
+
model_config = ConfigDict(validate_by_name=True, validate_by_alias=True)
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
class UiPathConversationToolCallConfirmationInterruptStartEvent(BaseModel):
|
|
27
|
+
"""Tool call confirmation interrupt start event with strong typing."""
|
|
28
|
+
|
|
29
|
+
type: Literal["uipath_cas_tool_call_confirmation"]
|
|
30
|
+
value: UiPathConversationToolCallConfirmationValue
|
|
31
|
+
|
|
32
|
+
model_config = ConfigDict(validate_by_name=True, validate_by_alias=True)
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
class UiPathConversationGenericInterruptStartEvent(BaseModel):
|
|
36
|
+
"""Generic interrupt start event for custom interrupt types."""
|
|
10
37
|
|
|
11
38
|
type: str
|
|
12
39
|
value: Any
|
|
@@ -14,13 +41,43 @@ class UiPathConversationInterruptStartEvent(BaseModel):
|
|
|
14
41
|
model_config = ConfigDict(validate_by_name=True, validate_by_alias=True)
|
|
15
42
|
|
|
16
43
|
|
|
17
|
-
|
|
18
|
-
|
|
44
|
+
UiPathConversationInterruptStartEvent = Union[
|
|
45
|
+
UiPathConversationToolCallConfirmationInterruptStartEvent,
|
|
46
|
+
UiPathConversationGenericInterruptStartEvent,
|
|
47
|
+
]
|
|
19
48
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
49
|
+
|
|
50
|
+
class UiPathConversationToolCallConfirmationEndValue(BaseModel):
|
|
51
|
+
"""Schema for tool call confirmation end value."""
|
|
52
|
+
|
|
53
|
+
approved: bool
|
|
54
|
+
input: Any | None = None
|
|
55
|
+
|
|
56
|
+
model_config = ConfigDict(validate_by_name=True, validate_by_alias=True)
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
class UiPathConversationToolCallConfirmationInterruptEndEvent(BaseModel):
|
|
60
|
+
"""Tool call confirmation interrupt end event with strong typing."""
|
|
61
|
+
|
|
62
|
+
type: Literal["uipath_cas_tool_call_confirmation"]
|
|
63
|
+
value: UiPathConversationToolCallConfirmationEndValue
|
|
64
|
+
|
|
65
|
+
model_config = ConfigDict(validate_by_name=True, validate_by_alias=True)
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
class UiPathConversationGenericInterruptEndEvent(BaseModel):
|
|
69
|
+
"""Generic interrupt end event for custom interrupt types."""
|
|
70
|
+
|
|
71
|
+
type: str
|
|
72
|
+
value: Any
|
|
73
|
+
|
|
74
|
+
model_config = ConfigDict(validate_by_name=True, validate_by_alias=True)
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
UiPathConversationInterruptEndEvent = Union[
|
|
78
|
+
UiPathConversationToolCallConfirmationInterruptEndEvent,
|
|
79
|
+
UiPathConversationGenericInterruptEndEvent,
|
|
80
|
+
]
|
|
24
81
|
|
|
25
82
|
|
|
26
83
|
class UiPathConversationInterruptEvent(BaseModel):
|
|
@@ -30,6 +87,6 @@ class UiPathConversationInterruptEvent(BaseModel):
|
|
|
30
87
|
start: UiPathConversationInterruptStartEvent | None = Field(
|
|
31
88
|
None, alias="startInterrupt"
|
|
32
89
|
)
|
|
33
|
-
end:
|
|
90
|
+
end: UiPathConversationInterruptEndEvent | None = Field(None, alias="endInterrupt")
|
|
34
91
|
|
|
35
92
|
model_config = ConfigDict(validate_by_name=True, validate_by_alias=True)
|
|
@@ -1,9 +1,18 @@
|
|
|
1
1
|
"""Guardrails models for UiPath Platform."""
|
|
2
2
|
|
|
3
3
|
from enum import Enum
|
|
4
|
-
from typing import Annotated, Callable, Literal
|
|
4
|
+
from typing import Annotated, Any, Callable, Literal
|
|
5
5
|
|
|
6
|
-
from pydantic import BaseModel, ConfigDict, Field
|
|
6
|
+
from pydantic import BaseModel, ConfigDict, Field, field_validator
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
def _decapitalize_first_letter(s: str) -> str:
|
|
10
|
+
"""Convert first letter to lowercase (e.g., 'SimpleText' -> 'simpleText')."""
|
|
11
|
+
if not s or len(s) == 0:
|
|
12
|
+
return s
|
|
13
|
+
if len(s) == 1:
|
|
14
|
+
return s.lower()
|
|
15
|
+
return s[0].lower() + s[1:]
|
|
7
16
|
|
|
8
17
|
|
|
9
18
|
class GuardrailValidationResultType(str, Enum):
|
|
@@ -56,6 +65,12 @@ class FieldReference(BaseModel):
|
|
|
56
65
|
|
|
57
66
|
model_config = ConfigDict(populate_by_name=True, extra="allow")
|
|
58
67
|
|
|
68
|
+
@field_validator("source", mode="before")
|
|
69
|
+
@classmethod
|
|
70
|
+
def normalize_type(cls, v: Any) -> Any:
|
|
71
|
+
"""Normalize type by decapitalizing first letter."""
|
|
72
|
+
return _decapitalize_first_letter(v) if isinstance(v, str) else v
|
|
73
|
+
|
|
59
74
|
|
|
60
75
|
class SelectorType(str, Enum):
|
|
61
76
|
"""Selector type enumeration."""
|
|
@@ -72,6 +87,17 @@ class AllFieldsSelector(BaseModel):
|
|
|
72
87
|
|
|
73
88
|
model_config = ConfigDict(populate_by_name=True, extra="allow")
|
|
74
89
|
|
|
90
|
+
@field_validator("sources", mode="before")
|
|
91
|
+
@classmethod
|
|
92
|
+
def normalize_sources(cls, v: Any) -> Any:
|
|
93
|
+
"""Normalize sources by decapitalizing first letter of each item."""
|
|
94
|
+
if isinstance(v, list):
|
|
95
|
+
return [
|
|
96
|
+
_decapitalize_first_letter(item) if isinstance(item, str) else item
|
|
97
|
+
for item in v
|
|
98
|
+
]
|
|
99
|
+
return v
|
|
100
|
+
|
|
75
101
|
|
|
76
102
|
class SpecificFieldsSelector(BaseModel):
|
|
77
103
|
"""Specific fields selector."""
|
|
@@ -128,6 +154,12 @@ class UniversalRule(BaseModel):
|
|
|
128
154
|
|
|
129
155
|
model_config = ConfigDict(populate_by_name=True, extra="allow")
|
|
130
156
|
|
|
157
|
+
@field_validator("apply_to", mode="before")
|
|
158
|
+
@classmethod
|
|
159
|
+
def normalize_type(cls, v: Any) -> Any:
|
|
160
|
+
"""Normalize type by decapitalizing first letter."""
|
|
161
|
+
return _decapitalize_first_letter(v) if isinstance(v, str) else v
|
|
162
|
+
|
|
131
163
|
|
|
132
164
|
class NumberRule(BaseModel):
|
|
133
165
|
"""Number rule model."""
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
uipath/core/__init__.py,sha256=KaOxKswriK_zGul3KzILhqnR3G0E5otuXny0IuuwTqA,280
|
|
2
2
|
uipath/core/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
3
|
-
uipath/core/chat/__init__.py,sha256=
|
|
3
|
+
uipath/core/chat/__init__.py,sha256=qHwtSReNXvq-yTA-R1uN6e-KPHirnIqqoeWy9JLC3Hc,6719
|
|
4
4
|
uipath/core/chat/async_stream.py,sha256=XbfSAu67TKYzzHoeh-WkolP3WXqEGJ2fTtCX5XqfUKY,2163
|
|
5
5
|
uipath/core/chat/citation.py,sha256=UBZ51wk3PyaXr7uljicEH_8Q2dthBMxYvPR6j2dEhA4,2608
|
|
6
6
|
uipath/core/chat/content.py,sha256=TcZbmuSskr2TrFngp4ILdkNBwlunhcZOzDjmiSWjsls,3163
|
|
@@ -8,7 +8,7 @@ uipath/core/chat/conversation.py,sha256=CVCj4z0DYQsodciCpmiefMjvn8NmJsLTaZU49Qis
|
|
|
8
8
|
uipath/core/chat/error.py,sha256=uXaI0jHYsRhOq8LRHVN5fwODX-uJX68PqJU26oe-4c4,1165
|
|
9
9
|
uipath/core/chat/event.py,sha256=SRif5ZQGEKQBmzcSl2fx0O_--zlKZ7lOVh15hRjLxP4,3832
|
|
10
10
|
uipath/core/chat/exchange.py,sha256=pkYt_pPDyzaJQAfDdqqUM36QLnz4rgBDR0DkBl03r90,2463
|
|
11
|
-
uipath/core/chat/interrupt.py,sha256
|
|
11
|
+
uipath/core/chat/interrupt.py,sha256=DnnmyXHB9r2VOsWzATqV0XG47WNxF5SLFM_xHauh26s,2922
|
|
12
12
|
uipath/core/chat/message.py,sha256=nJJ1xc--b7Nnj5hXwoH4T4pYkZSoiSHzSXlaiPqac4g,2390
|
|
13
13
|
uipath/core/chat/meta.py,sha256=3t0eS9UHoAPHre97QTUeVbjDhnMX4zj4-qG6ju0B8wY,315
|
|
14
14
|
uipath/core/chat/tool.py,sha256=6e5pyX3hOWM5fIzr_fdG49Mbzz6XzJD3nsmha-yGa2k,2308
|
|
@@ -17,7 +17,7 @@ uipath/core/errors/errors.py,sha256=5LajjuTfNW82ju07wT5mD3tXk0S-Ju7OqJqQpPN0F6g,
|
|
|
17
17
|
uipath/core/guardrails/__init__.py,sha256=hUCmD4y5te2iy01YnJlBuf2RWvqxmsNzoyOamXLXf2E,1028
|
|
18
18
|
uipath/core/guardrails/_deterministic_guardrails_service.py,sha256=61ROXYmX3rjBfFUp7E83fm4Lk7h1DlJeukpZm7uzVqQ,6355
|
|
19
19
|
uipath/core/guardrails/_evaluators.py,sha256=10tIRUufxoy9MkZPb-ytjsCSCIfIqQSOYXyEl4G7PSw,15649
|
|
20
|
-
uipath/core/guardrails/guardrails.py,sha256=
|
|
20
|
+
uipath/core/guardrails/guardrails.py,sha256=MPWNaXPzfEgPC_tnBE83G9ggH1JcJYtvp_BNorVNF0Y,6746
|
|
21
21
|
uipath/core/serialization/__init__.py,sha256=thAMx0WY03vnqhKCDVc9burqKWDxSNn3R-CJQU_1LIs,186
|
|
22
22
|
uipath/core/serialization/json.py,sha256=S0-ykGfroleRC0gJBNuTyJCx-GB8e6ZG9uTUKiD4PSc,4791
|
|
23
23
|
uipath/core/tracing/__init__.py,sha256=Y0wfRSGCVcDoFYTmTkVQElu5JE91h4dTNkKQnd86dBM,568
|
|
@@ -28,7 +28,7 @@ uipath/core/tracing/processors.py,sha256=XlMKA_AWwrtC-0ytnAHxl4P9kXlQdsjcn8zwnSp
|
|
|
28
28
|
uipath/core/tracing/span_utils.py,sha256=LZXNdnI0-fhKe49CLPsvMJIfh9zdzk8rK4g4YN5RfDU,13064
|
|
29
29
|
uipath/core/tracing/trace_manager.py,sha256=vmPup-C2pSgwpSdcCzAjzP_nTtRWZgqlxnNT50ygOfk,3843
|
|
30
30
|
uipath/core/tracing/types.py,sha256=8A8fFuWqMGk0SzIrFbMajmY6LA3w57h-YA602OctCrI,634
|
|
31
|
-
uipath_core-0.
|
|
32
|
-
uipath_core-0.
|
|
33
|
-
uipath_core-0.
|
|
34
|
-
uipath_core-0.
|
|
31
|
+
uipath_core-0.3.1.dist-info/METADATA,sha256=CSr0nrG76r9b5cXKRH2bGsnZV0t2cosAcOp0TLxYvtc,938
|
|
32
|
+
uipath_core-0.3.1.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
|
|
33
|
+
uipath_core-0.3.1.dist-info/licenses/LICENSE,sha256=-KBavWXepyDjimmzH5fVAsi-6jNVpIKFc2kZs0Ri4ng,1058
|
|
34
|
+
uipath_core-0.3.1.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|