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 pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "uipath-dev"
version = "0.0.16"
version = "0.0.17"
description = "UiPath Developer Console"
readme = { file = "README.md", content-type = "text/markdown" }
requires-python = ">=3.11"
Expand Down
2 changes: 1 addition & 1 deletion src/uipath/dev/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ async def handle_chat_input(self, event: Input.Submitted) -> None:
)
)
current_run.add_event(msg_ev)
current_run.input_data = {"messages": [msg]}
current_run.input_data = {"messages": [msg.model_dump(by_alias=True)]}

if current_run.mode == ExecutionMode.DEBUG:
asyncio.create_task(
Expand Down
62 changes: 62 additions & 0 deletions src/uipath/dev/ui/panels/_json_schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,66 @@ def mock_json_from_schema(schema: dict[str, Any]) -> Any:
- For primitives: returns a sensible example / default / enum[0].
- Handles oneOf/anyOf by choosing the first option.
- Special handling for LangChain message types.
- Special handling for UiPath conversational agent input schemas.
"""

def _is_uipath_conversational_input(s: dict[str, Any]) -> bool:
"""Check if this schema represents a UiPath conversational agent input."""
if s.get("type") != "object":
return False
props = s.get("properties", {})
# Check for the characteristic fields of ConversationalAgentInput
has_messages = "messages" in props
has_user_settings = "userSettings" in props

if not (has_messages and has_user_settings):
return False

# Additional check: messages should be an array
messages_prop = props.get("messages", {})
if messages_prop.get("type") != "array":
return False

# Check if $defs contains UiPath message types
defs = s.get("$defs", {})
uipath_types = [
"UiPathConversationMessage",
"UiPathConversationContentPart",
"UiPathInlineValue",
]
has_uipath_defs = any(t in defs for t in uipath_types)

return has_uipath_defs

def _mock_uipath_conversational_input() -> dict[str, Any]:
"""Generate a user-friendly mock for UiPath conversational agent input."""
return {
"messages": [
{
"messageId": "msg-001",
"role": "user",
"contentParts": [
{
"contentPartId": "part-001",
"mimeType": "text/plain",
"data": {"inline": "Hello, how can you help me today?"},
}
],
"createdAt": "2025-01-19T10:00:00Z",
"updatedAt": "2025-01-19T10:00:00Z",
}
],
"userSettings": {
"name": "John Doe",
"email": "john.doe@example.com",
"role": "Software Engineer",
"department": "Engineering",
"company": "Acme Corp",
"country": "United States",
"timezone": "America/New_York",
},
}

def _is_langchain_messages_array(sub_schema: dict[str, Any]) -> bool:
"""Check if this is a LangChain messages array."""
if sub_schema.get("type") != "array":
Expand Down Expand Up @@ -110,6 +168,10 @@ def _mock_value(
# 9) Fallback
return None

# Check for UiPath conversational input schema first
if _is_uipath_conversational_input(schema):
return _mock_uipath_conversational_input()

# Top-level: if it's an object with properties, build a dict
if schema.get("type") == "object":
if "properties" not in schema:
Expand Down
4 changes: 3 additions & 1 deletion src/uipath/dev/ui/styles/terminal.tcss
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,9 @@ SpanDetailsDisplay {

.json-input {
margin-top: 1;
height: auto;
margin-bottom: 3;
height: 100%;
overflow-y: auto;
}

.run-actions {
Expand Down
2 changes: 1 addition & 1 deletion uv.lock

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