Skip to content

Commit 0e05416

Browse files
chore: sync repo
1 parent 8d58ea7 commit 0e05416

File tree

25 files changed

+1336
-1369
lines changed

25 files changed

+1336
-1369
lines changed

.release-please-manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
".": "0.5.1"
2+
".": "0.5.0"
33
}

.stats.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 34
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/sgp%2Fagentex-sdk-2b422fbf02ff3b77795fb8c71cbe784de3a3add48560655ba4fe7f3fcc509995.yml
3-
openapi_spec_hash: bca5c04d823694c87417dae188480291
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/sgp%2Fagentex-sdk-2ba36d013a2829080b1003d4fecc30e89447db013f87491dd4d76f728d200b85.yml
3+
openapi_spec_hash: ff4de1c4bd38d4ff35bcf30755f0d870
44
config_hash: 6481ea6b42040f435dedcb00a98f35f8

CHANGELOG.md

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,5 @@
11
# Changelog
22

3-
## 0.5.1 (2025-10-29)
4-
5-
Full Changelog: [v0.5.0...v0.5.1](https://github.com/scaleapi/agentex-python/compare/v0.5.0...v0.5.1)
6-
7-
### Bug Fixes
8-
9-
* **client:** close streams without requiring full consumption ([f56acae](https://github.com/scaleapi/agentex-python/commit/f56acae74ee83a116e735ca7bf68f2096aafaf6e))
10-
113
## 0.5.0 (2025-10-28)
124

135
Full Changelog: [v0.4.28...v0.5.0](https://github.com/scaleapi/agentex-python/compare/v0.4.28...v0.5.0)
Lines changed: 3 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,7 @@
11
# [Sync] Hello ACP
22

3-
The simplest agent type: synchronous request/response pattern with a single `@acp.on_message_send` handler. Best for stateless operations that complete immediately.
3+
This is a simple AgentEx agent that just says hello and acknowledges the user's message to show which ACP methods need to be implemented for the sync ACP type.
44

5-
## What You'll Learn
6-
- Building a basic synchronous agent
7-
- The `@acp.on_message_send` handler pattern
8-
- When to use sync vs agentic agents
5+
## Official Documentation
96

10-
## Prerequisites
11-
- Development environment set up (see [main repo README](https://github.com/scaleapi/scale-agentex))
12-
- Backend services running: `make dev` from repository root
13-
14-
## Quick Start
15-
16-
```bash
17-
cd examples/tutorials/00_sync/000_hello_acp
18-
uv run agentex agents run --manifest manifest.yaml
19-
```
20-
21-
## Key Code
22-
23-
```python
24-
@acp.on_message_send
25-
async def handle_message_send(params: SendMessageParams):
26-
return TextContent(
27-
author="agent",
28-
content=f"Echo: {params.content.content}"
29-
)
30-
```
31-
32-
That's it - one handler, immediate response. No task creation, no state management.
33-
34-
## When to Use
35-
- Simple chatbots with no memory requirements
36-
- Quick Q&A or information lookup agents
37-
- Prototyping and testing agent responses
38-
- Operations that complete in under a second
39-
40-
## Why This Matters
41-
Sync agents are the simplest way to get started with AgentEx. They're perfect for learning the basics and building stateless agents. Once you need conversation memory or task tracking, you'll graduate to agentic agents.
42-
43-
**Next:** [010_multiturn](../010_multiturn/) - Add conversation memory to your agent
7+
[000 Hello ACP](https://dev.agentex.scale.com/docs/tutorials/sync/000_hello_acp)
Lines changed: 3 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -1,54 +1,7 @@
11
# [Sync] Multiturn
22

3-
Handle multi-turn conversations in synchronous agents by manually maintaining conversation history and context between messages.
3+
This tutorial demonstrates how to handle multiturn conversations in AgentEx agents using the Agent 2 Client Protocol (ACP).
44

5-
## What You'll Learn
6-
- How to handle conversation history in sync agents
7-
- Building context from previous messages
8-
- The limitations of stateless multiturn patterns
5+
## Official Documentation
96

10-
## Prerequisites
11-
- Development environment set up (see [main repo README](https://github.com/scaleapi/scale-agentex))
12-
- Backend services running: `make dev` from repository root
13-
- Understanding of basic sync agents (see [000_hello_acp](../000_hello_acp/))
14-
15-
## Quick Start
16-
17-
```bash
18-
cd examples/tutorials/00_sync/010_multiturn
19-
uv run agentex agents run --manifest manifest.yaml
20-
```
21-
22-
## Key Pattern
23-
24-
Sync agents are stateless by default. To handle multi-turn conversations, you need to:
25-
1. Accept conversation history in the request
26-
2. Maintain context across messages
27-
3. Return responses that build on previous exchanges
28-
29-
```python
30-
@acp.on_message_send
31-
async def handle_message_send(params: SendMessageParams):
32-
# Accept conversation history from client
33-
history = params.conversation_history
34-
35-
# Build context from history
36-
context = build_context(history)
37-
38-
# Generate response considering full context
39-
response = generate_response(params.content, context)
40-
41-
return TextContent(author="agent", content=response)
42-
```
43-
44-
The handler accepts history, builds context, and returns responses that reference previous exchanges.
45-
46-
## When to Use
47-
- Simple chatbots that need conversation memory
48-
- When client can maintain and send conversation history
49-
- Quick prototypes before building full agentic agents
50-
51-
## Why This Matters
52-
While sync agents can handle conversations, you're responsible for managing state on the client side. This becomes complex quickly. For production conversational agents, consider agentic agents ([10_agentic/00_base/010_multiturn](../../10_agentic/00_base/010_multiturn/)) where the platform manages state automatically.
53-
54-
**Next:** [020_streaming](../020_streaming/) - Stream responses in real-time
7+
[010 Multiturn](https://dev.agentex.scale.com/docs/tutorials/sync/010_multiturn)
Lines changed: 3 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,9 @@
11
# [Sync] Streaming
22

3-
Stream responses progressively using async generators instead of returning a single message. Enables showing partial results as they're generated.
3+
This tutorial demonstrates how to implement streaming responses in AgentEx agents using the Agent 2 Client Protocol (ACP).
44

5-
## What You'll Learn
6-
- How to stream responses using async generators
7-
- The `yield` pattern for progressive updates
8-
- When streaming improves user experience
5+
## Official Documentation
96

10-
## Prerequisites
11-
- Development environment set up (see [main repo README](https://github.com/scaleapi/scale-agentex))
12-
- Backend services running: `make dev` from repository root
13-
- Understanding of basic sync agents (see [000_hello_acp](../000_hello_acp/))
7+
[020 Streaming](https://dev.agentex.scale.com/docs/tutorials/sync/020_streaming)
148

15-
## Quick Start
169

17-
```bash
18-
cd examples/tutorials/00_sync/020_streaming
19-
uv run agentex agents run --manifest manifest.yaml
20-
```
21-
22-
## Key Code
23-
24-
```python
25-
@acp.on_message_send
26-
async def handle_message_send(params: SendMessageParams):
27-
async def stream_response():
28-
for chunk in response_chunks:
29-
yield TaskMessageUpdate(content=TextContent(...))
30-
31-
return stream_response()
32-
```
33-
34-
Return an async generator instead of a single response - each `yield` sends an update to the client.
35-
36-
## When to Use
37-
- Streaming LLM responses (OpenAI, Anthropic, etc.)
38-
- Large data processing with progress updates
39-
- Any operation that takes >1 second to complete
40-
- Improving perceived responsiveness
41-
42-
## Why This Matters
43-
Streaming dramatically improves user experience for longer operations. Instead of waiting 10 seconds for a complete response, users see results immediately as they're generated. This is essential for modern AI agents.
44-
45-
**Next:** Ready for task management? → [10_agentic/00_base/000_hello_acp](../../10_agentic/00_base/000_hello_acp/)
Lines changed: 3 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -1,49 +1,7 @@
11
# [Agentic] Hello ACP
22

3-
Agentic agents use three handlers for async task management: `on_task_create`, `on_task_event_send`, and `on_task_cancel`. Unlike sync agents, tasks persist and can receive multiple events over time.
3+
This tutorial demonstrates how to implement the base agentic ACP type in AgentEx agents.
44

5-
## What You'll Learn
6-
- The three-handler pattern for agentic agents
7-
- How tasks differ from sync messages
8-
- When to use agentic vs sync agents
5+
## Official Documentation
96

10-
## Prerequisites
11-
- Development environment set up (see [main repo README](https://github.com/scaleapi/scale-agentex))
12-
- Backend services running: `make dev` from repository root
13-
- Understanding of sync agents (see [00_sync/000_hello_acp](../../../00_sync/000_hello_acp/))
14-
15-
## Quick Start
16-
17-
```bash
18-
cd examples/tutorials/10_agentic/00_base/000_hello_acp
19-
uv run agentex agents run --manifest manifest.yaml
20-
```
21-
22-
## Key Pattern
23-
24-
```python
25-
@acp.on_task_create
26-
async def handle_task_create(params: CreateTaskParams):
27-
# Initialize task state, send welcome message
28-
29-
@acp.on_task_event_send
30-
async def handle_event_send(params: SendEventParams):
31-
# Handle each message/event in the task
32-
33-
@acp.on_task_cancel
34-
async def handle_task_cancel(params: CancelTaskParams):
35-
# Cleanup when task is cancelled
36-
```
37-
38-
Three handlers instead of one, giving you full control over task lifecycle. Tasks can receive multiple events and maintain state across them.
39-
40-
## When to Use
41-
- Conversational agents that need memory
42-
- Operations that require task tracking
43-
- Agents that need lifecycle management (initialization, cleanup)
44-
- Building towards production systems
45-
46-
## Why This Matters
47-
The task-based model is the foundation of production agents. Unlike sync agents where each message is independent, agentic agents maintain persistent tasks that can receive multiple events, store state, and have full lifecycle management. This is the stepping stone to Temporal-based agents.
48-
49-
**Next:** [010_multiturn](../010_multiturn/) - Add conversation memory
7+
[000 Hello Base Agentic](https://dev.agentex.scale.com/docs/tutorials/agentic/base/hello_acp/)
Lines changed: 3 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -1,61 +1,7 @@
11
# [Agentic] Multiturn
22

3-
Handle multi-turn conversations in agentic agents with task-based state management. Each task maintains its own conversation history automatically.
3+
This tutorial demonstrates how to handle multiturn conversations in AgentEx agents using the agentic ACP type.
44

5-
## What You'll Learn
6-
- How tasks maintain conversation state across multiple exchanges
7-
- Difference between sync and agentic multiturn patterns
8-
- Building stateful conversational agents with minimal code
5+
## Official Documentation
96

10-
## Prerequisites
11-
- Development environment set up (see [main repo README](https://github.com/scaleapi/scale-agentex))
12-
- Backend services running: `make dev` from repository root
13-
- Understanding of basic agentic agents (see [000_hello_acp](../000_hello_acp/))
14-
15-
## Quick Start
16-
17-
```bash
18-
cd examples/tutorials/10_agentic/00_base/010_multiturn
19-
uv run agentex agents run --manifest manifest.yaml
20-
```
21-
22-
## Key Pattern
23-
24-
Unlike sync agents where you manually track conversation history, agentic agents automatically maintain state within each task:
25-
26-
```python
27-
@app.on_task_event_send()
28-
async def on_task_event_send(event_send: TaskEventSendInput):
29-
# The task's messages list automatically includes all previous exchanges
30-
messages = event_send.task.messages
31-
32-
# No need to manually pass history - it's already there!
33-
response = await openai_client.chat.completions.create(
34-
model="gpt-4o-mini",
35-
messages=messages
36-
)
37-
38-
return {"content": response.choices[0].message.content}
39-
```
40-
41-
## Try It
42-
43-
1. Start the agent with the command above
44-
2. Open the web UI or use the notebook to create a task
45-
3. Send multiple messages in the same task:
46-
- "What's 25 + 17?"
47-
- "What was that number again?"
48-
- "Multiply it by 2"
49-
4. Notice the agent remembers context from previous exchanges
50-
51-
## When to Use
52-
- Conversational agents that need memory across exchanges
53-
- Chat interfaces where users ask follow-up questions
54-
- Agents that build context over time within a session
55-
56-
## Why This Matters
57-
Task-based state management eliminates the complexity of manually tracking conversation history. The AgentEx platform handles state persistence automatically, making it easier to build stateful agents without custom session management code.
58-
59-
**Comparison:** In the sync version ([00_sync/010_multiturn](../../../00_sync/010_multiturn/)), you manually manage conversation history. Here, the task object does it for you.
60-
61-
**Next:** [020_streaming](../020_streaming/) - Add real-time streaming responses
7+
[010 Multiturn Base Agentic](https://dev.agentex.scale.com/docs/tutorials/agentic/base/multiturn/)
Lines changed: 3 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,7 @@
11
# [Agentic] Streaming
22

3-
Stream responses in agentic agents using `adk.messages.create()` to send progressive updates. More flexible than sync streaming since you can send multiple messages at any time.
3+
This tutorial demonstrates how to implement streaming responses in AgentEx agents using the agentic ACP type.
44

5-
## What You'll Learn
6-
- How to stream with explicit message creation
7-
- Difference between sync and agentic streaming patterns
8-
- When to send multiple messages vs single streamed response
5+
## Official Documentation
96

10-
## Prerequisites
11-
- Development environment set up (see [main repo README](https://github.com/scaleapi/scale-agentex))
12-
- Backend services running: `make dev` from repository root
13-
- Understanding of agentic basics (see [000_hello_acp](../000_hello_acp/))
14-
15-
## Quick Start
16-
17-
```bash
18-
cd examples/tutorials/10_agentic/00_base/020_streaming
19-
uv run agentex agents run --manifest manifest.yaml
20-
```
21-
22-
## Key Pattern
23-
24-
```python
25-
@acp.on_task_event_send
26-
async def handle_event_send(params: SendEventParams):
27-
# Send first message
28-
await adk.messages.create(task_id=task_id, content=...)
29-
30-
# Do work...
31-
32-
# Send second message
33-
await adk.messages.create(task_id=task_id, content=...)
34-
```
35-
36-
Unlike sync streaming (which uses async generators), agentic streaming uses explicit message creation calls, giving you more control over when and what to send.
37-
38-
## When to Use
39-
- Multi-step processes with intermediate results
40-
- Long-running operations with progress updates
41-
- Agents that need to send messages at arbitrary times
42-
- More complex streaming patterns than simple LLM responses
43-
44-
## Why This Matters
45-
Agentic streaming is more powerful than sync streaming. You can send messages at any time, from anywhere in your code, and even from background tasks. This flexibility is essential for complex agents with multiple concurrent operations.
46-
47-
**Next:** [030_tracing](../030_tracing/) - Add observability to your agents
7+
[020 Streaming Base Agentic](https://dev.agentex.scale.com/docs/tutorials/agentic/base/streaming/)

0 commit comments

Comments
 (0)