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
6 changes: 3 additions & 3 deletions template/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ A quickstart UiPath LangGraph agent. It answers user queries using live tools an
| Tool | Description |
| ------------------ | ------------------------------------------------ |
| `get_current_time` | Returns the current UTC date and time (ISO 8601) |
| `web_search` | Searches the web via DuckDuckGo |
| `get_weather` | Returns weather data for a city (mock data) |

### LLM Providers

Expand Down Expand Up @@ -43,7 +43,7 @@ flowchart TD
```json
// Input
{
"query": "What is the current UTC time?"
"query": "What's the weather like in London?"
}

// Output
Expand All @@ -64,7 +64,7 @@ uv run uipath debug agent --file input.json

## Evaluation

The agent ships with a tool call order evaluator that verifies the ReAct node calls `get_current_time` **before** `web_search` when given a time-dependent query.
The agent ships with a tool call order evaluator that verifies the ReAct node calls `get_current_time` **before** `get_weather` when given a time-and-weather query, and an LLM judge that checks weather output for semantic similarity.

```bash
uv run uipath eval
Expand Down
35 changes: 14 additions & 21 deletions template/evaluations/eval-sets/evaluation-set-default.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,37 +4,30 @@
"name": "Default Evaluation Set",
"evaluatorRefs": [
"evaluator-llm-judge-output",
"evaluator-tool-call-order"
"evaluator-tool-call-order",
"evaluator-tool-call-arguments",
"evaluator-tool-call-count"
],
"evaluations": [
{
"id": "ada5a2c1-976c-470b-964f-eb70a5e61eb4",
"name": "Current time tool should be called before web search",
"name": "Weather in Paris",
"inputs": {
"query": "search the web using current time as input"
},
"evaluationCriterias": {
"evaluator-tool-call-order": null
},
"createdAt": "2026-03-23T17:10:17.394Z",
"updatedAt": "2026-03-23T17:10:40.659Z"
},
{
"id": "cf113553-5055-4cbf-a97f-e3801b05acd8",
"name": "UiPath details",
"inputs": {
"query": "tell me about UiPath"
"query": "Is it good weather for a walk in Paris?"
},
"evaluationCriterias": {
"evaluator-llm-judge-output": {
"expectedOutput": "{\n \"response\": \"# UiPath Overview: **UiPath** is a global software company and a leading platform for **Robotic Process Automation (RPA)** and **Agentic Automation**. Here are the key details:\\\\n\\\\n## Company Background\\\\n- **Founded:** 2005 by Daniel Dines and Marius Tirca\\\\n- **Headquarters:** New York City, United States\\\\n- **Status:** Public company\\\\n- **Funding:** Raised $1.96B from investors like Accel, Coatue, and Alkeon Capital Management\\\\n\\\\n## What It Does\\\\nUiPath specializes in automating repetitive, routine business tasks by using software robots that mimic human actions across digital systems. The platform helps organizations:\\\\n- Automate end-to-end business processes\\\\n- Reduce manual work and improve efficiency\\\\n- Enhance enterprise digital transformation\\\\n\\\\n## Core Offerings\\\\n- **RPA (Robotic Process Automation):** Build, manage, and deploy bots to automate repetitive tasks\\\\n- **AI Integration:** Advanced AI capabilities through collaborations with NVIDIA, OpenAI, Google, Microsoft, and Snowflake\\\\n- **UiPath Studio Web:** Browser-based tool for building cross-platform automations with templates and collaboration features\\\\n- **Agentic Automation:** AI agents that can orchestrate workflows with robots and human effort\\\\n\\\\n## Business Model Evolution\\\\n- **Shifting to consumption-based pricing:** Moving from traditional \\\"per-user seat\\\" licensing to \\\"pay-per-action\\\" models\\\\n- This reflects the changing value proposition as AI agents become more capable\\\\n\\\\n## Recent Developments\\\\n- Announced acquisition of **WorkFusion** (a pioneer in AI agents for financial crime compliance)\\\\n- Expanding AI capabilities and partnerships with major tech companies\\\\n- Offering globally recognized certification programs for automation expertise\\\\n\\\\nUiPath is positioned as one of the leading enterprise automation platforms for digital transformation\"\n}"
}
"expectedOutput": "{\n \"response\": \"Yes, it's quite good weather for a walk in Paris! The current conditions are:**Temperature**: 18°C (64°F) - mild and pleasant spring weather **Wind**: 12 km/h (7 mph) - light, manageable breeze **Conditions**: Partly cloudy - perfect for a walk without being too sunny or too gray\"\n}"
},
"evaluator-tool-call-order": null,
"evaluator-tool-call-arguments": null,
"evaluator-tool-call-count": null
},
"createdAt": "2026-04-08T15:19:44.377Z",
"updatedAt": "2026-04-08T15:21:50.470Z"
"createdAt": "2026-03-23T17:10:17.394Z",
"updatedAt": "2026-04-09T07:11:59.193Z"
}
],
"fileName": "evaluation-set-default.json",
"updatedAt": "2026-04-08T15:21:50.470Z",
"updatedAt": "2026-04-09T07:11:59.193Z",
"selectedEntrypoint": "agent"
}
}
24 changes: 24 additions & 0 deletions template/evaluations/evaluators/tool-call-arguments.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"version": "1.0",
"fileName": "tool-call-arguments.json",
"id": "evaluator-tool-call-arguments",
"description": "Verify tool call arguments match expected values",
"evaluatorTypeId": "uipath-tool-call-args",
"evaluatorConfig": {
"strict": false,
"subset": false,
"name": "Tool Call Arguments",
"defaultEvaluationCriteria": {
"toolCalls": [
{
"name": "get_weather",
"args": {
"city": "Paris"
}
}
]
}
},
"createdAt": "2026-04-09T07:09:28.326Z",
"updatedAt": "2026-04-09T07:09:31.178Z"
}
25 changes: 25 additions & 0 deletions template/evaluations/evaluators/tool-call-count.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"version": "1.0",
"fileName": "tool-call-count.json",
"id": "evaluator-tool-call-count",
"description": "Verify tool call counts match expected values",
"evaluatorTypeId": "uipath-tool-call-count",
"evaluatorConfig": {
"strict": false,
"name": "Tool Call Count",
"defaultEvaluationCriteria": {
"toolCallsCount": {
"get_weather": [
"=",
1
],
"get_current_time": [
"=",
1
]
}
}
},
"createdAt": "2026-04-09T07:09:51.451Z",
"updatedAt": "2026-04-09T07:09:53.843Z"
}
2 changes: 1 addition & 1 deletion template/evaluations/evaluators/tool-call-order.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"defaultEvaluationCriteria": {
"toolCallsOrder": [
"get_current_time",
"web_search"
"get_weather"
]
}
},
Expand Down
2 changes: 1 addition & 1 deletion template/input.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"query": "What is the current UTC time?"
"query": "What's the weather like in London?"
}
30 changes: 22 additions & 8 deletions template/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
from typing import Annotated, Any, TypedDict

from langchain.agents import create_agent
from langchain_community.tools import DuckDuckGoSearchRun
from langchain_community.utilities import DuckDuckGoSearchAPIWrapper
from langchain_core.messages import HumanMessage, SystemMessage
from langchain_core.tools import tool
from langgraph.graph import END, START, StateGraph
Expand Down Expand Up @@ -52,11 +50,27 @@ def get_current_time() -> str:
return datetime.now(timezone.utc).isoformat()


web_search = DuckDuckGoSearchRun(
name="web_search",
description="Search the web for information.",
api_wrapper=DuckDuckGoSearchAPIWrapper(backend="duckduckgo"),
)
@tool
def get_weather(city: str, utc_time: str) -> str:
"""Get the current weather for a city. Requires the current UTC time from get_current_time.

Args:
city: The city name, e.g. 'Paris' or 'Tokyo'.
utc_time: The current UTC time.
"""

WEATHER_DATA = {
"paris": "Weather in Paris, France: 18°C, wind 12 km/h, partly cloudy",
"london": "Weather in London, UK: 14°C, wind 20 km/h, overcast",
"new york": "Weather in New York, USA: 22°C, wind 8 km/h, clear sky",
"tokyo": "Weather in Tokyo, Japan: 26°C, wind 5 km/h, sunny",
"sydney": "Weather in Sydney, Australia: 19°C, wind 15 km/h, light rain",
}

weather = WEATHER_DATA.get(city.lower().strip())
if weather:
return f"{weather} (as of {utc_time})"
return f"Weather data not available for {city}"


async def prepare(input: InputModel) -> dict[str, Any]:
Expand All @@ -70,7 +84,7 @@ async def prepare(input: InputModel) -> dict[str, Any]:

react_agent = create_agent(
model=llm,
tools=[get_current_time, web_search],
tools=[get_current_time, get_weather],
response_format=AgentResponse,
)

Expand Down
2 changes: 0 additions & 2 deletions template/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ version = "0.0.1"
description = "uipath-langchain-template-agent"
authors = [{ name = "John Doe", email = "john.doe@myemail.com" }]
dependencies = [
"ddgs>=9.11.4",
"langchain-community>=0.4.1",
"uipath-langchain[bedrock,vertex]>=0.9.21, <0.10.0",
]
requires-python = ">=3.11"
Expand Down
Loading
Loading