Skip to content

Commit 4045c4a

Browse files
authored
Merge pull request #185 from UiPath/feat/agent-framework-orchestration-samples
feat: multi-agent graph, streaming refactor, and orchestration samples
2 parents 6cc77ae + 8e56187 commit 4045c4a

30 files changed

Lines changed: 1998 additions & 257 deletions

File tree

packages/uipath-agent-framework/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-agent-framework"
3-
version = "0.0.2"
3+
version = "0.0.3"
44
description = "Python SDK that enables developers to build and deploy Microsoft Agent Framework agents to the UiPath Cloud Platform"
55
readme = "README.md"
66
requires-python = ">=3.11"

packages/uipath-agent-framework/samples/README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,6 @@ Sample agents built with [Agent Framework](https://github.com/microsoft/agent-fr
88
|--------|-------------|
99
| [quickstart-agent](./quickstart-agent/) | Single agent with tool calling: fetches live weather data for any location |
1010
| [multi-agent](./multi-agent/) | Multi-agent coordinator: delegates research and code execution to specialist sub-agents via `as_tool()` |
11+
| [group-chat](./group-chat/) | Group chat orchestration: researcher, critic, and writer discuss a topic with an orchestrator picking speakers |
12+
| [concurrent](./concurrent/) | Concurrent orchestration: sentiment, topic extraction, and summarization agents analyze text in parallel |
13+
| [handoff](./handoff/) | Handoff orchestration: customer support agents transfer control to specialists with explicit routing rules |
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# Concurrent
2+
3+
Three specialist agents analyze the same input text in parallel: sentiment analysis, topic extraction, and summarization. Results are aggregated automatically.
4+
5+
## Agent Graph
6+
7+
```mermaid
8+
flowchart TB
9+
__start__(__start__)
10+
concurrent_analysis(concurrent_analysis)
11+
__end__(__end__)
12+
__start__ --> |input|concurrent_analysis
13+
concurrent_analysis --> |output|__end__
14+
```
15+
16+
Internally, the concurrent orchestration fans out to:
17+
- **sentiment** — analyzes positive/negative/neutral sentiment
18+
- **topic_extractor** — identifies topics, entities, and themes
19+
- **summarizer** — writes a concise summary
20+
21+
All three run simultaneously, results are collected and returned together.
22+
23+
## Run
24+
25+
```
26+
uipath run agent '{"messages": [{"contentParts": [{"data": {"inline": "Apple announced a new Vision Pro headset today, priced at $3,499. The mixed-reality device features a custom M4 chip and will be available in 10 countries. Analysts are divided on whether the high price point will limit adoption."}}], "role": "user"}]}'
27+
```
28+
29+
## Debug
30+
31+
```
32+
uipath dev web
33+
```
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
flowchart TB
2+
__start__(__start__)
3+
__end__(__end__)
4+
dispatcher(dispatcher)
5+
sentiment(sentiment)
6+
topic_extractor(topic_extractor)
7+
summarizer(summarizer)
8+
aggregator(aggregator)
9+
__start__ --> |input|dispatcher
10+
dispatcher --> sentiment
11+
dispatcher --> topic_extractor
12+
dispatcher --> summarizer
13+
sentiment --> aggregator
14+
topic_extractor --> aggregator
15+
summarizer --> aggregator
16+
aggregator --> |output|__end__
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"agents": {
3+
"agent": "main.py:agent"
4+
}
5+
}
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
from agent_framework.orchestrations import ConcurrentBuilder
2+
3+
from uipath_agent_framework.chat import UiPathOpenAIChatClient
4+
5+
client = UiPathOpenAIChatClient(model="gpt-5-mini-2025-08-07")
6+
7+
sentiment_agent = client.as_agent(
8+
name="sentiment",
9+
description="Analyzes text sentiment.",
10+
instructions=(
11+
"You are a sentiment analyst. Analyze the sentiment of the given text. "
12+
"Return a short assessment: positive/negative/neutral with a confidence "
13+
"percentage and a one-sentence explanation."
14+
),
15+
)
16+
17+
topic_agent = client.as_agent(
18+
name="topic_extractor",
19+
description="Extracts main topics and entities from text.",
20+
instructions=(
21+
"You are a topic extraction specialist. Identify the main topics, "
22+
"entities (people, organizations, places), and key themes in the "
23+
"given text. Return a structured list."
24+
),
25+
)
26+
27+
summary_agent = client.as_agent(
28+
name="summarizer",
29+
description="Writes concise summaries.",
30+
instructions=(
31+
"You are a summarization expert. Write a concise one-paragraph "
32+
"summary of the given text, capturing the key points."
33+
),
34+
)
35+
36+
workflow = ConcurrentBuilder(
37+
participants=[sentiment_agent, topic_agent, summary_agent],
38+
).build()
39+
40+
agent = workflow.as_agent(name="concurrent_analysis")
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
[project]
2+
name = "concurrent"
3+
version = "0.0.1"
4+
description = "Concurrent: multiple agents analyze the same input in parallel"
5+
authors = [{ name = "John Doe" }]
6+
readme = "README.md"
7+
requires-python = ">=3.11"
8+
dependencies = [
9+
"uipath",
10+
"uipath-agent-framework",
11+
"agent-framework-core>=1.0.0b260212",
12+
"agent-framework-orchestrations>=1.0.0b260212",
13+
]
14+
15+
[dependency-groups]
16+
dev = [
17+
"uipath-dev",
18+
]
19+
20+
[tool.uv]
21+
prerelease = "allow"
22+
23+
[tool.uv.sources]
24+
uipath-dev = { path = "../../../../../uipath-dev-python", editable = true }
25+
uipath-agent-framework = { path = "../../", editable = true }
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"$schema": "https://cloud.uipath.com/draft/2024-12/uipath",
3+
"runtimeOptions": {
4+
"isConversational": true
5+
},
6+
"packOptions": {
7+
"fileExtensionsIncluded": [],
8+
"filesIncluded": [],
9+
"filesExcluded": [],
10+
"directoriesExcluded": [],
11+
"includeUvLock": true
12+
},
13+
"functions": {}
14+
}
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# Group Chat
2+
3+
A group discussion where multiple agents (researcher, critic, writer) take turns in a shared conversation. An orchestrator agent selects who speaks next based on the discussion flow.
4+
5+
## Agent Graph
6+
7+
```mermaid
8+
flowchart TB
9+
__start__(__start__)
10+
group_chat(group_chat)
11+
__end__(__end__)
12+
__start__ --> |input|group_chat
13+
group_chat --> |output|__end__
14+
```
15+
16+
Internally, the group chat orchestration manages:
17+
- **researcher** — finds facts via Wikipedia
18+
- **critic** — challenges claims and asks probing questions
19+
- **writer** — synthesizes the discussion into clear prose
20+
- **orchestrator** — picks the next speaker each round
21+
22+
## Run
23+
24+
```
25+
uipath run agent '{"messages": [{"contentParts": [{"data": {"inline": "What are the environmental impacts of lithium mining?"}}], "role": "user"}]}'
26+
```
27+
28+
## Debug
29+
30+
```
31+
uipath dev web
32+
```
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"agents": {
3+
"agent": "main.py:agent"
4+
}
5+
}

0 commit comments

Comments
 (0)