Skip to content

Commit eb86243

Browse files
Merge branch 'main' into feat/add-internal-tools
2 parents 293e881 + f16845c commit eb86243

File tree

8 files changed

+282
-41
lines changed

8 files changed

+282
-41
lines changed

CONTRIBUTING.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,3 +104,5 @@ For additional commands related to linting, formatting, and building, run `just
104104
### General Rules
105105
- Please write informative description to the PRs for the reviewers to understand the context.
106106
- If you want to publish a `dev` build, please add a `build:dev` label to your PR.
107+
- You can then use the published `dev` version from the PR description/comments to use as needed <img width="880" height="433" alt="image" src="https://github.com/user-attachments/assets/b670bb08-a469-454f-a5f6-10d60477c033" />
108+

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"
3-
version = "2.2.37"
3+
version = "2.2.39"
44
description = "Python SDK and CLI for UiPath Platform, enabling programmatic interaction with automation services, process management, and deployment tools."
55
readme = { file = "README.md", content-type = "text/markdown" }
66
requires-python = ">=3.11"
Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,3 @@
1-
from pydantic import BaseModel, Field
1+
from uipath.agent.models.agent import ExampleCall
22

3-
4-
class ExampleCall(BaseModel):
5-
"""Example invocation for a resource."""
6-
7-
id: str = Field(..., alias="id")
8-
input: str = Field(..., alias="input")
9-
output: str = Field(..., alias="output")
3+
__all__ = ["ExampleCall"]

src/uipath/_cli/_evals/_progress_reporter.py

Lines changed: 99 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -537,12 +537,57 @@ def _serialize_justification(
537537

538538
return justification
539539

540-
def _extract_agent_snapshot(self, entrypoint: str) -> StudioWebAgentSnapshot:
540+
def _extract_agent_snapshot(self, entrypoint: str | None) -> StudioWebAgentSnapshot:
541+
"""Extract agent snapshot from entry points configuration or low-code agent file.
542+
543+
For coded agents, reads from entry-points.json configuration file.
544+
For low-code agents (*.json files like agent.json), reads inputSchema
545+
and outputSchema directly from the agent file.
546+
547+
Args:
548+
entrypoint: The entrypoint file path to look up
549+
550+
Returns:
551+
StudioWebAgentSnapshot with input and output schemas
552+
"""
553+
if not entrypoint:
554+
logger.warning(
555+
"Entrypoint not provided - falling back to empty inputSchema "
556+
"and outputSchema"
557+
)
558+
return StudioWebAgentSnapshot(input_schema={}, output_schema={})
559+
541560
try:
561+
# Check if entrypoint is a low-code agent JSON file (e.g., agent.json)
562+
if entrypoint.endswith(".json"):
563+
agent_file_path = os.path.join(os.getcwd(), entrypoint)
564+
if os.path.exists(agent_file_path):
565+
with open(agent_file_path, "r") as f:
566+
agent_data = json.load(f)
567+
568+
# Low-code agent files have inputSchema and outputSchema at root
569+
input_schema = agent_data.get("inputSchema", {})
570+
output_schema = agent_data.get("outputSchema", {})
571+
572+
logger.debug(
573+
f"Extracted agent snapshot from low-code agent '{entrypoint}': "
574+
f"inputSchema={json.dumps(input_schema)}, "
575+
f"outputSchema={json.dumps(output_schema)}"
576+
)
577+
578+
return StudioWebAgentSnapshot(
579+
input_schema=input_schema, output_schema=output_schema
580+
)
581+
582+
# Fall back to entry-points.json for coded agents
542583
entry_points_file_path = os.path.join(
543584
os.getcwd(), str(UiPathConfig.entry_points_file_path)
544585
)
545586
if not os.path.exists(entry_points_file_path):
587+
logger.debug(
588+
f"Entry points file not found at {entry_points_file_path}, "
589+
"using empty schemas"
590+
)
546591
return StudioWebAgentSnapshot(input_schema={}, output_schema={})
547592

548593
with open(entry_points_file_path, "r") as f:
@@ -563,6 +608,12 @@ def _extract_agent_snapshot(self, entrypoint: str) -> StudioWebAgentSnapshot:
563608
input_schema = ep.get("input", {})
564609
output_schema = ep.get("output", {})
565610

611+
logger.debug(
612+
f"Extracted agent snapshot for entrypoint '{entrypoint}': "
613+
f"inputSchema={json.dumps(input_schema)}, "
614+
f"outputSchema={json.dumps(output_schema)}"
615+
)
616+
566617
return StudioWebAgentSnapshot(
567618
input_schema=input_schema, output_schema=output_schema
568619
)
@@ -724,6 +775,14 @@ def _update_eval_run_spec(
724775
# Both coded and legacy send payload directly at root level
725776
payload = inner_payload
726777

778+
# Log the payload for debugging eval run updates
779+
agent_type = "coded" if is_coded else "low-code"
780+
logger.debug(
781+
f"Updating eval run (type={agent_type}): "
782+
f"evalRunId={eval_run_id}, success={success}"
783+
)
784+
logger.debug(f"Full eval run update payload: {json.dumps(payload, indent=2)}")
785+
727786
return RequestSpec(
728787
method="PUT",
729788
endpoint=Endpoint(
@@ -762,6 +821,16 @@ def _update_coded_eval_run_spec(
762821
"evaluatorRuns": evaluator_runs,
763822
}
764823

824+
# Log the payload for debugging coded eval run updates
825+
agent_type = "coded" if is_coded else "low-code"
826+
logger.debug(
827+
f"Updating coded eval run (type={agent_type}): "
828+
f"evalRunId={eval_run_id}, success={success}"
829+
)
830+
logger.debug(
831+
f"Full coded eval run update payload: {json.dumps(payload, indent=2)}"
832+
)
833+
765834
return RequestSpec(
766835
method="PUT",
767836
endpoint=Endpoint(
@@ -826,6 +895,14 @@ def _create_eval_run_spec(
826895
# Both coded and legacy send payload directly at root level
827896
payload = inner_payload
828897

898+
# Log the payload for debugging eval run reporting
899+
agent_type = "coded" if is_coded else "low-code"
900+
logger.debug(
901+
f"Creating eval run (type={agent_type}): "
902+
f"evalSetRunId={eval_set_run_id}, evalItemId={eval_item.id}"
903+
)
904+
logger.debug(f"Full eval run payload: {json.dumps(payload, indent=2)}")
905+
829906
return RequestSpec(
830907
method="POST",
831908
endpoint=Endpoint(
@@ -872,6 +949,16 @@ def _create_eval_set_run_spec(
872949
# Both coded and legacy send payload directly at root level
873950
payload = inner_payload
874951

952+
# Log the payload for debugging eval set run reporting
953+
agent_type = "coded" if is_coded else "low-code"
954+
logger.info(
955+
f"Creating eval set run (type={agent_type}): "
956+
f"evalSetId={eval_set_id}, "
957+
f"inputSchema={json.dumps(payload.get('agentSnapshot', {}).get('inputSchema', {}))}, "
958+
f"outputSchema={json.dumps(payload.get('agentSnapshot', {}).get('outputSchema', {}))}"
959+
)
960+
logger.debug(f"Full eval set run payload: {json.dumps(payload, indent=2)}")
961+
875962
return RequestSpec(
876963
method="POST",
877964
endpoint=Endpoint(
@@ -926,6 +1013,17 @@ def _update_eval_set_run_spec(
9261013
# Both coded and legacy send payload directly at root level
9271014
payload = inner_payload
9281015

1016+
# Log the payload for debugging eval set run updates
1017+
agent_type = "coded" if is_coded else "low-code"
1018+
logger.info(
1019+
f"Updating eval set run (type={agent_type}): "
1020+
f"evalSetRunId={eval_set_run_id}, success={success}, "
1021+
f"evaluatorScores={json.dumps(payload.get('evaluatorScores', []))}"
1022+
)
1023+
logger.debug(
1024+
f"Full eval set run update payload: {json.dumps(payload, indent=2)}"
1025+
)
1026+
9291027
return RequestSpec(
9301028
method="PUT",
9311029
endpoint=Endpoint(

src/uipath/agent/models/agent.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,10 +90,18 @@ class BaseCfg(BaseModel):
9090
)
9191

9292

93+
class ExampleCall(BaseCfg):
94+
"""Example call for a resource containing resource I/O."""
95+
96+
id: str = Field(..., alias="id")
97+
input: str = Field(..., alias="input")
98+
output: str = Field(..., alias="output")
99+
100+
93101
class BaseResourceProperties(BaseCfg):
94102
"""Base resource properties model."""
95103

96-
pass
104+
example_calls: Optional[list[ExampleCall]] = Field(None, alias="exampleCalls")
97105

98106

99107
class AgentToolSettings(BaseCfg):

src/uipath/agent/models/evals.py

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -9,40 +9,11 @@
99

1010
from uipath._cli._evals._models._evaluation_set import EvaluationSet
1111
from uipath._cli._evals._models._evaluator import Evaluator
12-
from uipath._cli._evals._models._mocks import ExampleCall
1312
from uipath.agent.models.agent import (
1413
AgentDefinition,
15-
AgentEscalationChannelProperties,
16-
AgentIntegrationToolProperties,
17-
AgentProcessToolProperties,
18-
BaseResourceProperties,
1914
)
2015

2116

22-
class AgentEvalResourceProperties(BaseResourceProperties):
23-
"""Resource properties with simulation support."""
24-
25-
example_calls: Optional[List[ExampleCall]] = Field(None, alias="exampleCalls")
26-
27-
28-
class AgentEvalProcessToolProperties(AgentProcessToolProperties):
29-
"""Process tool properties with simulation support."""
30-
31-
example_calls: Optional[List[ExampleCall]] = Field(None, alias="exampleCalls")
32-
33-
34-
class AgentEvalIntegrationToolProperties(AgentIntegrationToolProperties):
35-
"""Integration tool properties with simulation support."""
36-
37-
example_calls: Optional[List[ExampleCall]] = Field(None, alias="exampleCalls")
38-
39-
40-
class AgentEvalEscalationChannelProperties(AgentEscalationChannelProperties):
41-
"""Escalation channel properties with simulation support."""
42-
43-
example_calls: Optional[List[ExampleCall]] = Field(None, alias="exampleCalls")
44-
45-
4617
class AgentEvalsDefinition(AgentDefinition):
4718
"""Agent definition with evaluation sets and evaluators support."""
4819

0 commit comments

Comments
 (0)