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 .github/workflows/publish-pypi.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# This workflow is triggered when a GitHub release is created.
# It can also be run manually to re-publish to PyPI in case it failed for some reason.
# You can run this workflow by navigating to https://www.github.com/scaleapi/agentex-python/actions/workflows/publish-pypi.yml
# You can run this workflow by navigating to https://www.github.com/scaleapi/scale-agentex-python/actions/workflows/publish-pypi.yml
name: Publish PyPI
on:
workflow_dispatch:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release-doctor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
release_doctor:
name: release doctor
runs-on: ubuntu-latest
if: github.repository == 'scaleapi/agentex-python' && (github.event_name == 'push' || github.event_name == 'workflow_dispatch' || startsWith(github.head_ref, 'release-please') || github.head_ref == 'next')
if: github.repository == 'scaleapi/scale-agentex-python' && (github.event_name == 'push' || github.event_name == 'workflow_dispatch' || startsWith(github.head_ref, 'release-please') || github.head_ref == 'next')

steps:
- uses: actions/checkout@v4
Expand Down
2 changes: 1 addition & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
".": "0.5.1"
".": "0.5.2"
}
6 changes: 3 additions & 3 deletions .stats.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
configured_endpoints: 34
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/sgp%2Fagentex-sdk-2b422fbf02ff3b77795fb8c71cbe784de3a3add48560655ba4fe7f3fcc509995.yml
openapi_spec_hash: bca5c04d823694c87417dae188480291
config_hash: 6481ea6b42040f435dedcb00a98f35f8
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/sgp%2Fagentex-sdk-2ba36d013a2829080b1003d4fecc30e89447db013f87491dd4d76f728d200b85.yml
openapi_spec_hash: ff4de1c4bd38d4ff35bcf30755f0d870
config_hash: 0197f86ba1a4b1b5ce813d0e62138588
14 changes: 10 additions & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,18 @@
# Changelog

## 0.5.1 (2025-10-29)
## 0.5.2 (2025-10-31)

Full Changelog: [v0.5.0...v0.5.1](https://github.com/scaleapi/agentex-python/compare/v0.5.0...v0.5.1)
Full Changelog: [v0.5.0...v0.5.2](https://github.com/scaleapi/scale-agentex-python/compare/v0.5.0...v0.5.2)

### Bug Fixes
### Features

* **api:** manual updates ([dc66b57](https://github.com/scaleapi/scale-agentex-python/commit/dc66b57618525669b3aa15676343ef542675a5f9))
* bump the helm chart version ([1ffafb0](https://github.com/scaleapi/scale-agentex-python/commit/1ffafb0406138d6abd84254fa394b88c4a28ce70))


### Chores

* **client:** close streams without requiring full consumption ([f56acae](https://github.com/scaleapi/agentex-python/commit/f56acae74ee83a116e735ca7bf68f2096aafaf6e))
* sync repo ([0e05416](https://github.com/scaleapi/scale-agentex-python/commit/0e05416219ca93ae347e6175804bc0f2259a6b44))

## 0.5.0 (2025-10-28)

Expand Down
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ If you’d like to use the repository from source, you can either install from g
To install via git:

```sh
$ pip install git+ssh://git@github.com/scaleapi/agentex-python.git
$ pip install git+ssh://git@github.com/scaleapi/scale-agentex-python.git
```

Alternatively, you can build from source and install the wheel file:
Expand Down Expand Up @@ -120,7 +120,7 @@ the changes aren't made through the automated pipeline, you may want to make rel

### Publish with a GitHub workflow

You can release to package managers by using [the `Publish PyPI` GitHub action](https://www.github.com/scaleapi/agentex-python/actions/workflows/publish-pypi.yml). This requires a setup organization or repository secret to be set up.
You can release to package managers by using [the `Publish PyPI` GitHub action](https://www.github.com/scaleapi/scale-agentex-python/actions/workflows/publish-pypi.yml). This requires a setup organization or repository secret to be set up.

### Publish manually

Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -268,9 +268,9 @@ task = response.parse() # get the object that `tasks.list()` would have returne
print(task)
```

These methods return an [`APIResponse`](https://github.com/scaleapi/agentex-python/tree/main/src/agentex/_response.py) object.
These methods return an [`APIResponse`](https://github.com/scaleapi/scale-agentex-python/tree/main/src/agentex/_response.py) object.

The async client returns an [`AsyncAPIResponse`](https://github.com/scaleapi/agentex-python/tree/main/src/agentex/_response.py) with the same structure, the only difference being `await`able methods for reading the response content.
The async client returns an [`AsyncAPIResponse`](https://github.com/scaleapi/scale-agentex-python/tree/main/src/agentex/_response.py) with the same structure, the only difference being `await`able methods for reading the response content.

#### `.with_streaming_response`

Expand Down Expand Up @@ -374,7 +374,7 @@ This package generally follows [SemVer](https://semver.org/spec/v2.0.0.html) con

We take backwards-compatibility seriously and work hard to ensure you can rely on a smooth upgrade experience.

We are keen for your feedback; please open an [issue](https://www.github.com/scaleapi/agentex-python/issues) with questions, bugs, or suggestions.
We are keen for your feedback; please open an [issue](https://www.github.com/scaleapi/scale-agentex-python/issues) with questions, bugs, or suggestions.

### Determining the installed version

Expand Down
6 changes: 2 additions & 4 deletions examples/tutorials/00_sync/000_hello_acp/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,7 @@
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.
The simplest agent type: synchronous request/response pattern with a single `@acp.on_message_send` handler. Best for stateless operations that complete immediately.

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

## Prerequisites
- Development environment set up (see [main repo README](https://github.com/scaleapi/scale-agentex))
Expand Down Expand Up @@ -42,3 +39,4 @@ That's it - one handler, immediate response. No task creation, no state manageme
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.

**Next:** [010_multiturn](../010_multiturn/) - Add conversation memory to your agent
[000 Hello ACP](https://dev.agentex.scale.com/docs/tutorials/sync/000_hello_acp)
53 changes: 3 additions & 50 deletions examples/tutorials/00_sync/010_multiturn/README.md
Original file line number Diff line number Diff line change
@@ -1,54 +1,7 @@
# [Sync] Multiturn

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

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

## Prerequisites
- Development environment set up (see [main repo README](https://github.com/scaleapi/scale-agentex))
- Backend services running: `make dev` from repository root
- Understanding of basic sync agents (see [000_hello_acp](../000_hello_acp/))

## Quick Start

```bash
cd examples/tutorials/00_sync/010_multiturn
uv run agentex agents run --manifest manifest.yaml
```

## Key Pattern

Sync agents are stateless by default. To handle multi-turn conversations, you need to:
1. Accept conversation history in the request
2. Maintain context across messages
3. Return responses that build on previous exchanges

```python
@acp.on_message_send
async def handle_message_send(params: SendMessageParams):
# Accept conversation history from client
history = params.conversation_history

# Build context from history
context = build_context(history)

# Generate response considering full context
response = generate_response(params.content, context)

return TextContent(author="agent", content=response)
```

The handler accepts history, builds context, and returns responses that reference previous exchanges.

## When to Use
- Simple chatbots that need conversation memory
- When client can maintain and send conversation history
- Quick prototypes before building full agentic agents

## Why This Matters
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.

**Next:** [020_streaming](../020_streaming/) - Stream responses in real-time
[010 Multiturn](https://dev.agentex.scale.com/docs/tutorials/sync/010_multiturn)
42 changes: 3 additions & 39 deletions examples/tutorials/00_sync/020_streaming/README.md
Original file line number Diff line number Diff line change
@@ -1,45 +1,9 @@
# [Sync] Streaming

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

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

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

## Quick Start

```bash
cd examples/tutorials/00_sync/020_streaming
uv run agentex agents run --manifest manifest.yaml
```

## Key Code

```python
@acp.on_message_send
async def handle_message_send(params: SendMessageParams):
async def stream_response():
for chunk in response_chunks:
yield TaskMessageUpdate(content=TextContent(...))

return stream_response()
```

Return an async generator instead of a single response - each `yield` sends an update to the client.

## When to Use
- Streaming LLM responses (OpenAI, Anthropic, etc.)
- Large data processing with progress updates
- Any operation that takes >1 second to complete
- Improving perceived responsiveness

## Why This Matters
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.

**Next:** Ready for task management? → [10_agentic/00_base/000_hello_acp](../../10_agentic/00_base/000_hello_acp/)
48 changes: 3 additions & 45 deletions examples/tutorials/10_agentic/00_base/000_hello_acp/README.md
Original file line number Diff line number Diff line change
@@ -1,49 +1,7 @@
# [Agentic] Hello ACP

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.
This tutorial demonstrates how to implement the base agentic ACP type in AgentEx agents.

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

## Prerequisites
- Development environment set up (see [main repo README](https://github.com/scaleapi/scale-agentex))
- Backend services running: `make dev` from repository root
- Understanding of sync agents (see [00_sync/000_hello_acp](../../../00_sync/000_hello_acp/))

## Quick Start

```bash
cd examples/tutorials/10_agentic/00_base/000_hello_acp
uv run agentex agents run --manifest manifest.yaml
```

## Key Pattern

```python
@acp.on_task_create
async def handle_task_create(params: CreateTaskParams):
# Initialize task state, send welcome message

@acp.on_task_event_send
async def handle_event_send(params: SendEventParams):
# Handle each message/event in the task

@acp.on_task_cancel
async def handle_task_cancel(params: CancelTaskParams):
# Cleanup when task is cancelled
```

Three handlers instead of one, giving you full control over task lifecycle. Tasks can receive multiple events and maintain state across them.

## When to Use
- Conversational agents that need memory
- Operations that require task tracking
- Agents that need lifecycle management (initialization, cleanup)
- Building towards production systems

## Why This Matters
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.

**Next:** [010_multiturn](../010_multiturn/) - Add conversation memory
[000 Hello Base Agentic](https://dev.agentex.scale.com/docs/tutorials/agentic/base/hello_acp/)
60 changes: 3 additions & 57 deletions examples/tutorials/10_agentic/00_base/010_multiturn/README.md
Original file line number Diff line number Diff line change
@@ -1,61 +1,7 @@
# [Agentic] Multiturn

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

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

## Prerequisites
- Development environment set up (see [main repo README](https://github.com/scaleapi/scale-agentex))
- Backend services running: `make dev` from repository root
- Understanding of basic agentic agents (see [000_hello_acp](../000_hello_acp/))

## Quick Start

```bash
cd examples/tutorials/10_agentic/00_base/010_multiturn
uv run agentex agents run --manifest manifest.yaml
```

## Key Pattern

Unlike sync agents where you manually track conversation history, agentic agents automatically maintain state within each task:

```python
@app.on_task_event_send()
async def on_task_event_send(event_send: TaskEventSendInput):
# The task's messages list automatically includes all previous exchanges
messages = event_send.task.messages

# No need to manually pass history - it's already there!
response = await openai_client.chat.completions.create(
model="gpt-4o-mini",
messages=messages
)

return {"content": response.choices[0].message.content}
```

## Try It

1. Start the agent with the command above
2. Open the web UI or use the notebook to create a task
3. Send multiple messages in the same task:
- "What's 25 + 17?"
- "What was that number again?"
- "Multiply it by 2"
4. Notice the agent remembers context from previous exchanges

## When to Use
- Conversational agents that need memory across exchanges
- Chat interfaces where users ask follow-up questions
- Agents that build context over time within a session

## Why This Matters
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.

**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.

**Next:** [020_streaming](../020_streaming/) - Add real-time streaming responses
[010 Multiturn Base Agentic](https://dev.agentex.scale.com/docs/tutorials/agentic/base/multiturn/)
46 changes: 3 additions & 43 deletions examples/tutorials/10_agentic/00_base/020_streaming/README.md
Original file line number Diff line number Diff line change
@@ -1,47 +1,7 @@
# [Agentic] Streaming

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.
This tutorial demonstrates how to implement streaming responses in AgentEx agents using the agentic ACP type.

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

## Prerequisites
- Development environment set up (see [main repo README](https://github.com/scaleapi/scale-agentex))
- Backend services running: `make dev` from repository root
- Understanding of agentic basics (see [000_hello_acp](../000_hello_acp/))

## Quick Start

```bash
cd examples/tutorials/10_agentic/00_base/020_streaming
uv run agentex agents run --manifest manifest.yaml
```

## Key Pattern

```python
@acp.on_task_event_send
async def handle_event_send(params: SendEventParams):
# Send first message
await adk.messages.create(task_id=task_id, content=...)

# Do work...

# Send second message
await adk.messages.create(task_id=task_id, content=...)
```

Unlike sync streaming (which uses async generators), agentic streaming uses explicit message creation calls, giving you more control over when and what to send.

## When to Use
- Multi-step processes with intermediate results
- Long-running operations with progress updates
- Agents that need to send messages at arbitrary times
- More complex streaming patterns than simple LLM responses

## Why This Matters
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.

**Next:** [030_tracing](../030_tracing/) - Add observability to your agents
[020 Streaming Base Agentic](https://dev.agentex.scale.com/docs/tutorials/agentic/base/streaming/)
Loading