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
5 changes: 2 additions & 3 deletions docs/core/getting_started.md
Original file line number Diff line number Diff line change
Expand Up @@ -117,14 +117,13 @@ Upon successful authentication, your project will contain a `.env` file with you
Open `main.py` in your code editor. You can start with this example code:
```python
from dataclasses import dataclass
from typing import Optional


@dataclass
class EchoIn:
message: str
repeat: Optional[int] = 1
prefix: Optional[str] = None
repeat: int | None = 1
prefix: str | None = None


@dataclass
Expand Down
22 changes: 10 additions & 12 deletions docs/eval/custom_evaluators.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,6 @@ class MyEvaluatorConfig(BaseEvaluatorConfig[MyEvaluationCriteria]):
Implement the core evaluation logic:

```python
from typing import List
from uipath.eval.evaluators import BaseEvaluator
from uipath.eval.models import AgentExecution, NumericEvaluationResult
import json
Expand Down Expand Up @@ -150,13 +149,13 @@ class MyCustomEvaluator(
}),
)

def _extract_values(self, agent_execution: AgentExecution) -> List[str]:
def _extract_values(self, agent_execution: AgentExecution) -> list[str]:
"""Extract values from agent execution (implement your logic)."""
# Your custom extraction logic here
return []

def _compute_similarity(
self, actual: List[str], expected: List[str]
self, actual: list[str], expected: list[str]
) -> float:
"""Compute similarity score (implement your logic)."""
# Your custom scoring logic here
Expand Down Expand Up @@ -248,7 +247,7 @@ Custom evaluators often need to extract information from tool calls in the agent
```python
from uipath.eval._helpers.evaluators_helpers import extract_tool_calls

def _process_tool_calls(self, agent_execution: AgentExecution) -> List[str]:
def _process_tool_calls(self, agent_execution: AgentExecution) -> list[str]:
"""Extract and process tool calls from the execution trace."""
tool_calls = extract_tool_calls(agent_execution.agent_trace)

Expand Down Expand Up @@ -286,7 +285,6 @@ Here's a complete example based on real-world usage that compares data patterns
```python
"""Custom evaluator for pattern comparison."""
import json
from typing import List

from pydantic import Field
from uipath.eval.evaluators import BaseEvaluator
Expand All @@ -299,7 +297,7 @@ from uipath.eval.models import AgentExecution
from uipath.eval._helpers.evaluators_helpers import extract_tool_calls


def _compute_jaccard_similarity(expected: List[str], actual: List[str]) -> float:
def _compute_jaccard_similarity(expected: list[str], actual: list[str]) -> float:
"""Compute Jaccard similarity (intersection over union).

Returns 1.0 when both expected and actual are empty (perfect match).
Expand All @@ -319,7 +317,7 @@ def _compute_jaccard_similarity(expected: List[str], actual: List[str]) -> float
class PatternEvaluatorCriteria(BaseEvaluationCriteria):
"""Evaluation criteria for pattern evaluator."""

expected_output: List[str] = Field(default_factory=list)
expected_output: list[str] = Field(default_factory=list)


class PatternEvaluatorConfig(BaseEvaluatorConfig[PatternEvaluatorCriteria]):
Expand Down Expand Up @@ -371,7 +369,7 @@ class PatternComparisonEvaluator(
}),
)

def _extract_patterns(self, agent_execution: AgentExecution) -> List[str]:
def _extract_patterns(self, agent_execution: AgentExecution) -> list[str]:
"""Extract patterns from tool calls.

Args:
Expand Down Expand Up @@ -418,7 +416,7 @@ def _extract_data(
self,
agent_execution: AgentExecution,
tool_name: str
) -> List[str]:
) -> list[str]:
"""Extract data from specific tool calls.

Args:
Expand Down Expand Up @@ -484,8 +482,8 @@ Make your scoring logic explicit and well-documented, using config values approp
```python
def _compute_score(
self,
actual: List[str],
expected: List[str]
actual: list[str],
expected: list[str]
) -> float:
"""Compute evaluation score.

Expand Down Expand Up @@ -618,7 +616,7 @@ def _extract_from_specific_tool(

```python
def _compute_set_similarity(
self, actual: List[str], expected: List[str]
self, actual: list[str], expected: list[str]
) -> float:
"""Compute similarity using set operations."""
actual_set = set(actual)
Expand Down
6 changes: 3 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
[project]
name = "uipath"
version = "2.2.7"
version = "2.2.8"
description = "Python SDK and CLI for UiPath Platform, enabling programmatic interaction with automation services, process management, and deployment tools."
readme = { file = "README.md", content-type = "text/markdown" }
requires-python = ">=3.11"
dependencies = [
"uipath-core>=0.0.5, <0.1.0",
"uipath-runtime>=0.1.0, <0.2.0",
"uipath-runtime>=0.1.1, <0.2.0",
"click>=8.3.1",
"httpx>=0.28.1",
"pyjwt>=2.10.1",
Expand All @@ -17,7 +17,7 @@ dependencies = [
"truststore>=0.10.1",
"mockito>=1.5.4",
"hydra-core>=1.3.2",
"pydantic-function-models>=0.1.10",
"pydantic-function-models>=0.1.11",
"pysignalr==1.3.0",
"coverage>=7.8.2",
"mermaid-builder==0.0.3",
Expand Down
7 changes: 3 additions & 4 deletions samples/asset-modifier-agent/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@
import dotenv
import logging
import os

from typing import Optional
from typing import Any
from uipath.platform import UiPath
from uipath.tracing import traced

Expand Down Expand Up @@ -38,15 +37,15 @@ class AgentInput:
asset_name: str
folder_path: str

def get_asset(client: UiPath, name: str, folder_path: str) -> Optional[object]:
def get_asset(client: UiPath, name: str, folder_path: str) -> Any:
"""Retrieve an asset from UiPath.

Args:
name (str): The asset name.
folder_path (str): The UiPath folder path.

Returns:
Optional[object]: The asset object if found, else None.
Any: The asset object if found, else None.
"""
return client.assets.retrieve(name=name, folder_path=folder_path)

Expand Down
5 changes: 2 additions & 3 deletions samples/google-ADK-agent/multi_tool_agent/agent.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import dataclasses
import datetime
from typing import Dict
from zoneinfo import ZoneInfo

from google.adk.agents import Agent
Expand All @@ -9,7 +8,7 @@
from google.genai.types import Content, Part


def get_weather(city: str) -> Dict[str, str]:
def get_weather(city: str) -> dict[str, str]:
"""Retrieves the current weather report for a specified city.

Args:
Expand All @@ -33,7 +32,7 @@ def get_weather(city: str) -> Dict[str, str]:
}


def get_current_time(city: str) -> Dict[str, str]:
def get_current_time(city: str) -> dict[str, str]:
"""Returns the current time in a specified city.

Args:
Expand Down
10 changes: 5 additions & 5 deletions samples/llm_chat_agent/agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
import asyncio
import json
import os
from typing import Any, Dict, List
from typing import Any

import httpx
from dotenv import load_dotenv
Expand Down Expand Up @@ -54,14 +54,14 @@ class AgentOutput(BaseModel):
"""Output model for the agent."""

response: str = Field(description="Agent's response to the user")
tool_calls_made: List[str] = Field(
tool_calls_made: list[str] = Field(
default_factory=list, description="Names of tools that were called"
)


# Tool implementations
@traced()
async def get_current_weather(city: str) -> Dict[str, Any]:
async def get_current_weather(city: str) -> dict[str, Any]:
"""
Get the current weather for a city using Open-Meteo API.

Expand Down Expand Up @@ -174,7 +174,7 @@ def get_weather_description(code: int) -> str:


@traced()
async def calculate(expression: str) -> Dict[str, Any]:
async def calculate(expression: str) -> dict[str, Any]:
"""
Perform a mathematical calculation using Newton API.

Expand Down Expand Up @@ -274,7 +274,7 @@ async def calculate(expression: str) -> Dict[str, Any]:


@traced()
async def execute_tool_call(tool_name: str, tool_arguments: Dict[str, Any]) -> Dict[str, Any]:
async def execute_tool_call(tool_name: str, tool_arguments: dict[str, Any]) -> dict[str, Any]:
"""
Execute a tool based on its name and arguments.

Expand Down
Loading