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
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -179,13 +179,14 @@ cython_debug/
**/__uipath/
.claude/settings.local.json

/.vscode/launch.json
.vscode/

playground.py

# Samples generated files
**/samples/**/.agent/
**/samples/**/.claude/
**/samples/**/.vscode/
**/samples/**/AGENTS.md
**/samples/**/CLAUDE.md
**/samples/**/bindings.json
Expand Down
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,11 @@ All packages extend the [UiPath Python SDK](https://github.com/UiPath/uipath-pyt

| Framework | Version | Downloads | Links |
|---|---|---|---|
| [LlamaIndex](https://www.llamaindex.ai/) | [![PyPI](https://img.shields.io/pypi/v/uipath-llamaindex)](https://pypi.org/project/uipath-llamaindex/) | [![Downloads](https://img.shields.io/pypi/dm/uipath-llamaindex.svg)](https://pypi.org/project/uipath-llamaindex/) | [README](packages/uipath-llamaindex/README.md) · [Docs](https://uipath.github.io/uipath-python/llamaindex/quick_start/) · [Samples](packages/uipath-llamaindex/samples/) |
| [OpenAI Agents](https://github.com/openai/openai-agents-python) | [![PyPI](https://img.shields.io/pypi/v/uipath-openai-agents)](https://pypi.org/project/uipath-openai-agents/) | [![Downloads](https://img.shields.io/pypi/dm/uipath-openai-agents.svg)](https://pypi.org/project/uipath-openai-agents/) | [README](packages/uipath-openai-agents/README.md) · [Docs](https://uipath.github.io/uipath-python/openai-agents/quick_start/) · [Samples](packages/uipath-openai-agents/samples/) |
| [Google ADK](https://github.com/google/adk-python) | [![PyPI](https://img.shields.io/pypi/v/uipath-google-adk)](https://pypi.org/project/uipath-google-adk/) | [![Downloads](https://img.shields.io/pypi/dm/uipath-google-adk.svg)](https://pypi.org/project/uipath-google-adk/) | [README](packages/uipath-google-adk/README.md) · [Samples](packages/uipath-google-adk/samples/) |
| [LangChain](https://github.com/langchain-ai/langchain) | [![PyPI](https://img.shields.io/pypi/v/uipath-langchain)](https://pypi.org/project/uipath-langchain/) | [![Downloads](https://img.shields.io/pypi/dm/uipath-langchain.svg)](https://pypi.org/project/uipath-langchain/) | [README](https://github.com/UiPath/uipath-langchain-python#readme) · [Docs](https://uipath.github.io/uipath-python/langchain/quick_start/) · [Samples](https://github.com/UiPath/uipath-langchain-python/tree/main/samples) |
| [LlamaIndex](https://www.llamaindex.ai/) | [![PyPI](https://img.shields.io/pypi/v/uipath-llamaindex)](https://pypi.org/project/uipath-llamaindex/) | [![Downloads](https://img.shields.io/pypi/dm/uipath-llamaindex.svg)](https://pypi.org/project/uipath-llamaindex/) | [README](packages/uipath-llamaindex/README.md) · [Docs](https://uipath.github.io/uipath-python/llamaindex/quick_start/) · [Samples](packages/uipath-llamaindex/samples/) |
| [Microsoft Agent Framework](https://github.com/microsoft/agent-framework) | [![PyPI](https://img.shields.io/pypi/v/uipath-agent-framework)](https://pypi.org/project/uipath-agent-framework/) | [![Downloads](https://img.shields.io/pypi/dm/uipath-agent-framework.svg)](https://pypi.org/project/uipath-agent-framework/) | [README](packages/uipath-agent-framework/README.md) · [Samples](packages/uipath-agent-framework/samples/) |
| [OpenAI Agents](https://github.com/openai/openai-agents-python) | [![PyPI](https://img.shields.io/pypi/v/uipath-openai-agents)](https://pypi.org/project/uipath-openai-agents/) | [![Downloads](https://img.shields.io/pypi/dm/uipath-openai-agents.svg)](https://pypi.org/project/uipath-openai-agents/) | [README](packages/uipath-openai-agents/README.md) · [Docs](https://uipath.github.io/uipath-python/openai-agents/quick_start/) · [Samples](packages/uipath-openai-agents/samples/) |


## Structure
Expand Down
3 changes: 2 additions & 1 deletion packages/uipath-agent-framework/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
[project]
name = "uipath-agent-framework"
version = "0.0.3"
version = "0.0.5"
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"
dependencies = [
"agent-framework-core>=1.0.0b260212",
"agent-framework-orchestrations>=1.0.0b260212",
"aiosqlite>=0.20.0",
"openinference-instrumentation-agent-framework>=0.1.0",
"uipath>=2.8.41, <2.9.0",
Expand Down
4 changes: 2 additions & 2 deletions packages/uipath-agent-framework/samples/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ Sample agents built with [Agent Framework](https://github.com/microsoft/agent-fr

| Sample | Description |
|--------|-------------|
| [quickstart-agent](./quickstart-agent/) | Single agent with tool calling: fetches live weather data for any location |
| [multi-agent](./multi-agent/) | Multi-agent coordinator: delegates research and code execution to specialist sub-agents via `as_tool()` |
| [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 |
| [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 |
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,3 @@ dev = [

[tool.uv]
prerelease = "allow"

[tool.uv.sources]
uipath-dev = { path = "../../../../../uipath-dev-python", editable = true }
uipath-agent-framework = { path = "../../", editable = true }
18 changes: 18 additions & 0 deletions packages/uipath-agent-framework/samples/group-chat/agent.mermaid
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
flowchart TB
__start__(__start__)
__end__(__end__)
orchestrator(orchestrator)
researcher(researcher)
researcher_tools(tools)
critic(critic)
writer(writer)
researcher --> researcher_tools
researcher_tools --> researcher
__start__ --> |input|orchestrator
orchestrator --> researcher
researcher --> orchestrator
orchestrator --> critic
critic --> orchestrator
orchestrator --> writer
writer --> orchestrator
orchestrator --> |output|__end__
24 changes: 24 additions & 0 deletions packages/uipath-agent-framework/samples/handoff/agent.mermaid
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
flowchart TB
__start__(__start__)
__end__(__end__)
triage(triage)
billing_agent(billing_agent)
tech_agent(tech_agent)
returns_agent(returns_agent)
__start__ --> |input|triage
triage --> billing_agent
triage --> tech_agent
triage --> returns_agent
billing_agent --> triage
billing_agent --> tech_agent
billing_agent --> returns_agent
tech_agent --> triage
tech_agent --> billing_agent
tech_agent --> returns_agent
returns_agent --> triage
returns_agent --> billing_agent
returns_agent --> tech_agent
triage --> |output|__end__
billing_agent --> |output|__end__
tech_agent --> |output|__end__
returns_agent --> |output|__end__
43 changes: 43 additions & 0 deletions packages/uipath-agent-framework/samples/hitl-workflow/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# HITL Workflow

A customer support workflow with human-in-the-loop approval for sensitive operations. A triage agent routes requests to billing or returns specialists. Both `transfer_funds` and `issue_refund` tools require human approval before executing.

## Agent Graph

```mermaid
flowchart TB
__start__(__start__)
triage(triage)
billing_agent(billing_agent)
returns_agent(returns_agent)
__end__(__end__)
__start__ --> |input|triage
triage --> billing_agent
triage --> returns_agent
billing_agent --> returns_agent
billing_agent --> triage
returns_agent --> billing_agent
returns_agent --> triage
billing_agent --> |output|__end__
returns_agent --> |output|__end__
```

## Prerequisites

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

```bash
uipath auth
```

## Run

```
uipath run agent '{"messages": [{"contentParts": [{"data": {"inline": "I need a refund for order #12345"}}], "role": "user"}]}'
```

## Debug

```
uipath dev web
```
83 changes: 83 additions & 0 deletions packages/uipath-agent-framework/samples/hitl-workflow/main.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
from agent_framework.orchestrations import HandoffBuilder

from uipath_agent_framework.chat import UiPathOpenAIChatClient, requires_approval


@requires_approval
def transfer_funds(from_account: str, to_account: str, amount: float) -> str:
"""Transfer funds between accounts. Requires human approval.

Args:
from_account: Source account ID
to_account: Destination account ID
amount: Amount to transfer

Returns:
Confirmation message
"""
return f"Transferred ${amount:.2f} from {from_account} to {to_account}"


@requires_approval
def issue_refund(order_id: str, amount: float, reason: str) -> str:
"""Issue a refund for an order. Requires human approval.

Args:
order_id: The order ID to refund
amount: Refund amount
reason: Reason for the refund

Returns:
Confirmation message
"""
return f"Refund of ${amount:.2f} issued for order {order_id}: {reason}"


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

triage = client.as_agent(
name="triage",
description="Routes customer requests to the right specialist.",
instructions=(
"You are a customer support triage agent. Determine what the "
"customer needs help with and hand off to the right agent:\n"
"- Billing issues (payments, transfers) -> billing_agent\n"
"- Returns and refunds -> returns_agent\n"
),
)

billing = client.as_agent(
name="billing_agent",
description="Handles billing, payments, and fund transfers.",
instructions=(
"You are a billing specialist. Help customers with payments "
"and transfers. Use the transfer_funds tool when needed — "
"it will require human approval before executing."
),
tools=[transfer_funds],
)

returns = client.as_agent(
name="returns_agent",
description="Handles product returns and refund requests.",
instructions=(
"You are a returns specialist. Help customers process returns "
"and issue refunds. Use the issue_refund tool — it will "
"require human approval before executing."
),
tools=[issue_refund],
)

workflow = (
HandoffBuilder(
name="customer_support",
participants=[triage, billing, returns],
)
.with_start_agent(triage)
.add_handoff(triage, [billing, returns])
.add_handoff(billing, [returns, triage])
.add_handoff(returns, [billing, triage])
.build()
)

agent = workflow.as_agent(name="customer_support")
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[project]
name = "multi-agent"
name = "hitl-workflow"
version = "0.0.1"
description = "Multi-agent Agent Framework example with coordinator pattern"
description = "Agent Framework workflow with human-in-the-loop tool approval"
authors = [{ name = "John Doe" }]
readme = "README.md"
requires-python = ">=3.11"
Expand All @@ -18,7 +18,3 @@ dev = [

[tool.uv]
prerelease = "allow"

[tool.uv.sources]
uipath-agent-framework = { path = "../../", editable = true }
uipath-dev = { path = "../../../../../uipath-dev-python", editable = true }
46 changes: 0 additions & 46 deletions packages/uipath-agent-framework/samples/multi-agent/README.md

This file was deleted.

18 changes: 0 additions & 18 deletions packages/uipath-agent-framework/samples/multi-agent/agent.mermaid

This file was deleted.

79 changes: 0 additions & 79 deletions packages/uipath-agent-framework/samples/multi-agent/main.py

This file was deleted.

Loading