Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
16 commits
Select commit Hold shift + click to select a range
b759d42
feat(tools): tool groups, call state, stats per agent and app-wide ho…
tschellenbach Nov 18, 2026
81d29a7
chore: ignore the swift_assistant backend binary
tschellenbach Nov 18, 2026
778b45c
docs(readme): add the Stream skill, drop a tool call's update
tschellenbach Nov 18, 2026
8c59cf8
Merge remote-tracking branch 'origin/main' into tool-groups
tschellenbach Nov 19, 2026
83876e8
feat(sdk-go)!: register tools once on the client and run them with Ru…
tschellenbach Nov 19, 2026
7c804a9
feat(stream)!: register tools once on client.tools and run them with …
tschellenbach Nov 19, 2026
df65f05
feat(sdk-js)!: register tools once on client.tools and run them with …
tschellenbach Nov 19, 2026
424fc84
feat(sdk-dotnet)!: host the client's tools for every agent and add Ru…
tschellenbach Nov 19, 2026
9957da3
chore(sdk-ruby): regenerate the spec table
tschellenbach Nov 19, 2026
93d460c
feat(sdk-ruby)!: register tools once on client.tools and run them wit…
tschellenbach Nov 19, 2026
da0d753
feat(sdk-rust)!: register tools once on client.tools() and run them w…
tschellenbach Nov 19, 2026
c14e4ec
chore(sdk-rust): regenerate types from the spec
tschellenbach Nov 19, 2026
8c7e625
feat(sdk-php)!: register tools once on client->tools and run them wit…
tschellenbach Nov 19, 2026
3f998bd
chore(sdk-php): regenerate models from the spec
tschellenbach Nov 19, 2026
ef0efab
docs: client.tools and run_dispatch in the changelog, skills and trav…
tschellenbach Nov 19, 2026
c735984
Merge remote-tracking branch 'origin/main' into tool-groups
tschellenbach Nov 19, 2026
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 .claude/skills/sdk-dotnet/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ Hand-written in `Socket.cs`, because OpenAPI stops at the upgrade. One `Socket`
and closes the agents it made. Dropping work would hang up on whoever is talking.
- `GetOrCreateAgentAsync` keeps one agent per channel while its session is live, and opens
chats with the message's `AgentId`, as Go and Python do.
- `Host(agent, toolTimeout)` sends `host_tools` for `agent.Tools` under `agent.Name` after every `ready`. Hosted calls are
- `Host(client, toolTimeout)` sends `host_tools` for `client.Tools` with `every_agent: true` after every `ready`; `client.RunDispatchAsync()` hosts them alone. Hosted calls are
tracked work like calls, and `hosting_refused` throws out of `RunAsync`. A connection
that ends without a normal close is redialled with backoff (1s doubling to 30s), as in
Go. This is the one socket that reconnects: dispatch frames belong to one connection.
Expand Down
5 changes: 3 additions & 2 deletions .claude/skills/sdk-rust/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,9 @@ returned. `close()` is idempotent.
(or there was none). `active` and `handles` go on the handshake. A message with a
`session_id` is answered with `answer`, as the server acting for the writer. `load` and `ping` every 15s. `get_or_create_agent` keeps one session
per channel and closes them all when `run` ends.
- `Dispatch::host(&agent, tool_timeout)` declares the `AgentRef`'s own `tools` under its name
(`host_tools`) after every `ready`, runs each `tool_call` in
- `Dispatch::host(&client, tool_timeout)` declares the client's `tools()` for every agent
(`host_tools` with `every_agent: true`) after every `ready`, and `Client::run_dispatch` hosts
them alone; it runs each `tool_call` in
the same `JoinSet`, and ends `run` with `Error::Failed` on `hosting_refused`. Unlike Go, it
does not reconnect.
- `Knowledge::add_url` and `Router::transcribe`/`record` poll until the job settles.
Expand Down
11 changes: 11 additions & 0 deletions .claude/skills/sdk/SKILL.md

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ plugins/*/example/uv.lock
/acceleration/say
/acceleration/transcribe
/examples/voice_agents/swift_demo/backend/backend
/examples/voice_agents/swift_assistant/backend/backend
/examples/voice_agents/swift_demo/configure/configure

/performance_benchmark/out/
Expand Down
14 changes: 14 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@

## Features

### A tool is registered once for the app, and each agent's agent.yaml enables it

Every server SDK's client has a tool registry for the whole app, and one call runs it for every agent: Go `client.Tools().Add(...)` and `client.RunDispatch(ctx)`, Python `client.tools.register(...)` and `await client.run_dispatch()`, JavaScript `client.tools.register(...)` and `await client.runDispatch()`, .NET `client.Tools.Register(...)` and `await client.RunDispatchAsync()`, Ruby `client.tools.register(...)` and `client.run_dispatch`, Rust `client.tools().register(...)` and `client.run_dispatch().await`, PHP `$client->tools->register(...)` and `$client->runDispatch()`. A worker that also answers calls or messages hosts them with `dispatch.host(client)`. A session is offered one of those tools only when a tool group of its agent's `agent.yaml` names it, and a tool of the same name an agent hosts itself wins. A worker asks for this with `every_agent: true` on its `host_tools` frame; one naming neither an agent nor `every_agent` is still refused, so a forgotten agent id never offers tools to every agent.

### Tool stats show how to load each tool, per agent

`GET /v1/stats/agents` takes `agent`, an agent config id, and answers how many sessions took a turn and how many turns they took. Each tool now also has the sessions that called it and their share, the turns a session took before its first call, how it was loaded, and what its definition costs every turn, in full and as a summary: the numbers that decide between `full`, `summary` and `deferred`. A call's token cost and its tool's definition size now survive tool output retention, which used to shrink a redacted call's tokens to its tool name. Calls recorded before this have no definition size.
### The Go SDK connects a user's own accounts

`client.Connections()` creates, authorizes, reads, lists and deletes connections: `Create(ctx, client.ConnectionRequest{Connector: "linear", UserID: "alice"})`, then `Authorize(ctx, id, client.AuthorizeOptions{ReturnURL, UserID})` for the launch URL, handoff token and expiry of the consent, and `Get(ctx, id, client.ConnectionOptions{UserID})`, `List(ctx, client.ConnectionFilter{UserID, Connector})`, `Delete(ctx, id, client.ConnectionOptions{UserID})`. Every call takes the user as `UserID` of its options struct and sends it as both the owner and `X-Stream-User-Id`. An empty user is the app's own connection.
Expand Down Expand Up @@ -629,6 +636,13 @@ Every reply the agent abandons logs one INFO line, `the agent was interrupted`,

## Breaking Changes

### Tools are hosted from the client, not from an agent

An agent handle no longer has tools to host: Go `client.Agent.Tools()`, Python `Agent.register` and `Agent.functions`, JavaScript `AgentHandle.tools`, Rust `AgentRef.tools` and PHP `AgentHandle::$tools` are gone. Register the tools on the client and run them with its `run_dispatch` (see above), and name each one in a tool group of the agents that use it. `Dispatch.host` takes the client in place of an agent in every SDK, and the hosting refusal no longer names an agent: JavaScript's `HostingRefusedError` and PHP's `HostingRefusedException` lose `agentId`, and PHP's `Dispatch::$hosting` is a boolean. A session's own tools stay: Go `SessionOptions.Tools`, Python `SessionOptions(tools=...)`, and the in-process `Agent`'s tools in JavaScript, .NET, Ruby and Go's `agents` package.

### A tool call no longer has update or say

A tool call's update and say are gone from every SDK: Go `tools.Call.Update`/`Say` (and `tools.Line` has only `Hold`), JavaScript `ToolCallContext.update`/`say` (and `ToolLine` has only `hold`), Python `ToolCallContext.update`/`say` (and `ToolLine` has only `hold`), .NET `UpdateAsync`/`SayAsync`, Ruby `update`/`say`, Rust `update`/`say` and PHP `update()`/`say()`. A session's own `say` stays. A tool says nothing while it runs: the agent tells a waiting caller the work is still going, and a tool's `display_title` is what its call shows. The router still takes `tool_update` from an older SDK, so a released app keeps working.
### `agents.DefineSkills` takes the id of the agent config the skills belong to

`agents.DefineSkills(ctx, backend, configID, skills)` stores skills under that config and edits only that config's own skill of each name. Without a config the router refuses a skill, so the old form never worked against it (#2074).
Expand Down
21 changes: 10 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,12 @@ The combination of routing, persistence and memory makes it easy to switch the u
Stay in control of how costs scale.
Start with the frontier models and run your own when it makes sense.

## Skill

The skill enables you to build complex AI apps in hours:

* Ask Claude/Cursor/Lovable to setup Stream, with getstream.io/SKILL.md

## Quickstart

The heavy lifting is done in Go. But you can use the agents in any environment:
Expand Down Expand Up @@ -115,35 +121,28 @@ Full apps with chat, voice and tools, one per client SDK:

## Tool Calling

Any backend SDK can provide tools to the agent. Here's a Python based example:
Any backend SDK can provide tools to the agent. Tools are registered once for the app, and each agent's `agent.yaml` names the ones it uses in a tool group. Here's a Python based example:

```python
import asyncio

from vision_agents.core.llm import ToolCallContext
from vision_agents.plugins import stream

agent = stream.Client().agent("my-agent")
client = stream.Client()


@agent.register()
@client.tools.register()
async def customer_case_lookup(tool_call_context: ToolCallContext) -> list:
"""Look up the user's open support cases."""
user = tool_call_context.user
if not user.id:
raise ValueError("unknown user")
await tool_call_context.update("Checking your open cases")
# pretend this calls your CRM
return await crm.open_cases(user.id)


async def main() -> None:
dispatch = stream.Dispatch()
dispatch.host(agent, tool_timeout=30)
await dispatch.run()


asyncio.run(main())
asyncio.run(client.run_dispatch())
```


Expand Down
Loading
Loading