Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/uipath-core/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "uipath-core"
version = "0.5.13"
version = "0.5.14"
description = "UiPath Core abstractions"
readme = { file = "README.md", content-type = "text/markdown" }
requires-python = ">=3.11"
Expand Down
27 changes: 27 additions & 0 deletions packages/uipath-core/src/uipath/core/chat/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,20 @@
UiPathConversationExchangeEvent,
UiPathConversationExchangeStartEvent,
)
from .interrupt import (
InterruptTypeEnum,
UiPathConversationGenericInterruptEndEvent,
UiPathConversationGenericInterruptStartEvent,
UiPathConversationInterrupt,
UiPathConversationInterruptData,
UiPathConversationInterruptEndEvent,
UiPathConversationInterruptEvent,
UiPathConversationInterruptStartEvent,
UiPathConversationToolCallConfirmationEndValue,
UiPathConversationToolCallConfirmationInterruptEndEvent,
UiPathConversationToolCallConfirmationInterruptStartEvent,
UiPathConversationToolCallConfirmationValue,
)
from .message import (
UiPathConversationMessage,
UiPathConversationMessageData,
Expand Down Expand Up @@ -177,4 +191,17 @@
"UiPathVoiceToolCallRequest",
"UiPathVoiceToolCallMessage",
"UiPathVoiceToolCallResult",
# Interrupt (compat shims — deprecated, see interrupt.py)
"InterruptTypeEnum",
"UiPathConversationInterruptStartEvent",
"UiPathConversationInterruptEndEvent",
"UiPathConversationInterruptEvent",
"UiPathConversationInterruptData",
"UiPathConversationInterrupt",
"UiPathConversationGenericInterruptStartEvent",
"UiPathConversationGenericInterruptEndEvent",
"UiPathConversationToolCallConfirmationValue",
"UiPathConversationToolCallConfirmationEndValue",
"UiPathConversationToolCallConfirmationInterruptStartEvent",
"UiPathConversationToolCallConfirmationInterruptEndEvent",
]
122 changes: 122 additions & 0 deletions packages/uipath-core/src/uipath/core/chat/interrupt.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
"""Compatibility shims for legacy interrupt event types.

The interrupt-based tool-call confirmation flow was replaced by `confirmToolCall`
on the tool call event itself (see PR #1558). The original `interrupt.py` was
removed in `uipath-core` 0.5.13, but published `uipath-runtime` versions still
import these names at module load time, breaking installs that pull the new
`uipath-core` alongside an older runtime.

These shims keep those imports working. They are not used by current code paths
and should be removed in the next minor bump of `uipath-core`.
"""

from enum import Enum
from typing import Any, Literal, Union

from pydantic import BaseModel, ConfigDict, Field


class InterruptTypeEnum(str, Enum):
"""Enum of known interrupt types."""

TOOL_CALL_CONFIRMATION = "uipath_cas_tool_call_confirmation"


class UiPathConversationToolCallConfirmationValue(BaseModel):
"""Schema for tool call confirmation interrupt value."""

tool_call_id: str = Field(..., alias="toolCallId")
tool_name: str = Field(..., alias="toolName")
input_schema: Any = Field(..., alias="inputSchema")
input_value: Any | None = Field(None, alias="inputValue")

model_config = ConfigDict(validate_by_name=True, validate_by_alias=True)


class UiPathConversationToolCallConfirmationInterruptStartEvent(BaseModel):
"""Tool call confirmation interrupt start event with strong typing."""

type: Literal["uipath_cas_tool_call_confirmation"]
value: UiPathConversationToolCallConfirmationValue

model_config = ConfigDict(validate_by_name=True, validate_by_alias=True)


class UiPathConversationGenericInterruptStartEvent(BaseModel):
"""Generic interrupt start event for custom interrupt types."""

type: str
value: Any

model_config = ConfigDict(validate_by_name=True, validate_by_alias=True)


UiPathConversationInterruptStartEvent = Union[
UiPathConversationToolCallConfirmationInterruptStartEvent,
UiPathConversationGenericInterruptStartEvent,
]


class UiPathConversationToolCallConfirmationEndValue(BaseModel):
"""Schema for tool call confirmation end value."""

approved: bool
input: Any | None = None

model_config = ConfigDict(validate_by_name=True, validate_by_alias=True)


class UiPathConversationToolCallConfirmationInterruptEndEvent(BaseModel):
"""Tool call confirmation interrupt end event with strong typing."""

type: Literal["uipath_cas_tool_call_confirmation"]
value: UiPathConversationToolCallConfirmationEndValue

model_config = ConfigDict(validate_by_name=True, validate_by_alias=True)


class UiPathConversationGenericInterruptEndEvent(BaseModel):
"""Generic interrupt end event for custom interrupt types."""

type: str
value: Any

model_config = ConfigDict(validate_by_name=True, validate_by_alias=True)


UiPathConversationInterruptEndEvent = Union[
UiPathConversationToolCallConfirmationInterruptEndEvent,
UiPathConversationGenericInterruptEndEvent,
]


class UiPathConversationInterruptEvent(BaseModel):
"""Encapsulates interrupt-related events within a message."""

interrupt_id: str = Field(..., alias="interruptId")
start: UiPathConversationInterruptStartEvent | None = Field(
None, alias="startInterrupt"
)
end: UiPathConversationInterruptEndEvent | None = Field(None, alias="endInterrupt")

model_config = ConfigDict(validate_by_name=True, validate_by_alias=True)


class UiPathConversationInterruptData(BaseModel):
"""Core data of an interrupt within a message."""

type: str
interrupt_value: Any = Field(..., alias="interruptValue")
end_value: Any | None = Field(None, alias="endValue")

model_config = ConfigDict(validate_by_name=True, validate_by_alias=True)


class UiPathConversationInterrupt(UiPathConversationInterruptData):
"""An interrupt within a message — a pause point where the agent needs external input."""

interrupt_id: str = Field(..., alias="interruptId")
created_at: str = Field(..., alias="createdAt")
updated_at: str = Field(..., alias="updatedAt")

model_config = ConfigDict(validate_by_name=True, validate_by_alias=True)
2 changes: 1 addition & 1 deletion packages/uipath-core/uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/uipath-platform/uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/uipath/uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading