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-agent-framework/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "uipath-agent-framework"
version = "0.0.7"
version = "0.0.8"
description = "Python SDK that enables developers to build and deploy Microsoft Agent Framework agents to the UiPath Cloud Platform"
readme = "README.md"
requires-python = ">=3.11"
Expand Down
8 changes: 6 additions & 2 deletions packages/uipath-agent-framework/samples/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,11 @@ Sample agents built with [Agent Framework](https://github.com/microsoft/agent-fr
| Sample | Description |
|--------|-------------|
| [quickstart-workflow](./quickstart-workflow/) | Single workflow agent with tool calling: fetches live weather data for any location |
| [group-chat](./group-chat/) | Group chat orchestration: researcher, critic, and writer discuss a topic with an orchestrator picking speakers |
| [structured-output](./structured-output/) | Structured output workflow: extracts city information and returns it as a typed Pydantic model |
| [sequential-structured-output](./sequential-structured-output/) | Sequential pipeline with structured output: researcher and editor agents produce a typed Pydantic city profile |
| [hitl-workflow](./hitl-workflow/) | Human-in-the-loop workflow: customer support with approval-gated billing and refund operations |
| [sequential](./sequential/) | Sequential pipeline: writer, reviewer, and editor agents process a task one after another |
| [concurrent](./concurrent/) | Concurrent orchestration: sentiment, topic extraction, and summarization agents analyze text in parallel |
| [handoff](./handoff/) | Handoff orchestration: customer support agents transfer control to specialists with explicit routing rules |
| [hitl-workflow](./hitl-workflow/) | Human-in-the-loop workflow: customer support with approval-gated billing and refund operations |
| [group-chat](./group-chat/) | Group chat orchestration: researcher, critic, and writer discuss a topic with an orchestrator picking speakers |
| [magentic](./magentic/) | Magentic-One orchestration: a manager dynamically coordinates researcher and analyst agents based on task progress |
Original file line number Diff line number Diff line change
Expand Up @@ -57,3 +57,4 @@ uipath run agent '{"messages": [{"contentParts": [{"data": {"inline": "Transfer
```
uipath dev web
```

Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"agents": {
"agent": "main.py:agent"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# Sequential + Structured Output

A sequential pipeline that combines multi-agent processing with structured output. A researcher gathers facts about a city, then an editor organizes them into a well-defined Pydantic model (`CityInfo`). The final output is a typed JSON object — not free-form text.

## Agent Graph

```mermaid
flowchart TB
__start__(__start__)
__end__(__end__)
input-conversation(input-conversation)
researcher(researcher)
editor(editor)
end_(end)
__start__ --> |input|input-conversation
input-conversation --> researcher
researcher --> editor
editor --> end_
end_ --> |output|__end__
```

Internally, the sequential orchestration chains:
- **researcher** — gathers key facts about the city (country, population, landmarks, cultural significance)
- **editor** — organizes the research into a structured `CityInfo` schema with `response_format`

Each agent sees the full conversation history from previous agents. The last agent's `response_format` determines the output schema.

## Prerequisites

Authenticate with UiPath to configure your `.env` file:

```bash
uipath auth
```

## Run

```
uipath run agent '{"messages": [{"contentParts": [{"data": {"inline": "Tell me about Tokyo"}}], "role": "user"}]}'
```

## Debug

```
uipath dev web
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
flowchart TB
__start__(__start__)
__end__(__end__)
input-conversation(input-conversation)
researcher(researcher)
editor(editor)
end(end)
__start__ --> |input|input-conversation
input-conversation --> researcher
researcher --> editor
editor --> end
end --> |output|__end__
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"agents": {
"agent": "main.py:agent"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
from agent_framework.orchestrations import SequentialBuilder
from pydantic import BaseModel

from uipath_agent_framework.chat import UiPathOpenAIChatClient


class CityInfo(BaseModel):
"""Structured output for city information."""

city: str
country: str
description: str
population_estimate: str
famous_for: list[str]


client = UiPathOpenAIChatClient(model="gpt-5-mini-2025-08-07")

researcher = client.as_agent(
name="researcher",
description="Researches factual information about a city.",
instructions=(
"You are a thorough researcher. Given a city name, gather key facts "
"including its country, population, notable landmarks, cultural "
"significance, and what it is famous for. Present your findings clearly."
),
)

editor = client.as_agent(
name="editor",
description="Edits research into a structured city profile.",
instructions=(
"You are a precise editor. Take the researcher's findings and organize "
"them into a well-structured city profile. Ensure all facts are accurate "
"and the description is concise and informative."
),
default_options={"response_format": CityInfo},
)

workflow = SequentialBuilder(
participants=[researcher, editor],
).build()

agent = workflow.as_agent(name="sequential_structured_output_workflow")
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
[project]
name = "sequential-structured-output"
version = "0.0.1"
description = "Sequential + structured output: agents process a task in a pipeline, the last agent returns data in a well-defined Pydantic schema"
authors = [{ name = "John Doe" }]
readme = "README.md"
requires-python = ">=3.11"
dependencies = [
"uipath",
"uipath-agent-framework",
"agent-framework-core>=1.0.0rc1",
"agent-framework-orchestrations>=1.0.0b260219",
]

[dependency-groups]
dev = [
"uipath-dev",
]

[tool.uv]
prerelease = "allow"

[tool.uv.sources]
uipath-dev = { path = "../../../../../uipath-dev-python", editable = true }
uipath-agent-framework = { path = "../../", editable = true }
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"$schema": "https://cloud.uipath.com/draft/2024-12/uipath",
"runtimeOptions": {
"isConversational": false
},
"packOptions": {
"fileExtensionsIncluded": [],
"filesIncluded": [],
"filesExcluded": [],
"directoriesExcluded": [],
"includeUvLock": true
},
"functions": {}
}
14 changes: 14 additions & 0 deletions packages/uipath-agent-framework/samples/sequential/agent.mermaid
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
flowchart TB
__start__(__start__)
__end__(__end__)
input-conversation(input-conversation)
writer(writer)
reviewer(reviewer)
editor(editor)
end(end)
__start__ --> |input|input-conversation
input-conversation --> writer
writer --> reviewer
reviewer --> editor
editor --> end
end --> |output|__end__
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"agents": {
"agent": "main.py:agent"
}
}
14 changes: 14 additions & 0 deletions packages/uipath-agent-framework/samples/sequential/uipath.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"$schema": "https://cloud.uipath.com/draft/2024-12/uipath",
"runtimeOptions": {
"isConversational": false
},
"packOptions": {
"fileExtensionsIncluded": [],
"filesIncluded": [],
"filesExcluded": [],
"directoriesExcluded": [],
"includeUvLock": true
},
"functions": {}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
flowchart TB
__start__(__start__)
__end__(__end__)
city_agent(city_agent)
__start__ --> |input|city_agent
city_agent --> |output|__end__
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"agents": {
"agent": "main.py:agent"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class CityInfo(BaseModel):
"Given a city name, provide the city name, country, a brief description, "
"an estimated population, and a list of things the city is famous for."
),
response_format=CityInfo,
default_options={"response_format": CityInfo},
)

workflow = WorkflowBuilder(start_executor=city_agent).build()
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"$schema": "https://cloud.uipath.com/draft/2024-12/uipath",
"runtimeOptions": {
"isConversational": false
},
"packOptions": {
"fileExtensionsIncluded": [],
"filesIncluded": [],
"filesExcluded": [],
"directoriesExcluded": [],
"includeUvLock": true
},
"functions": {}
}
Loading