You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 713cbc1
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: docs/index.md
+2-3Lines changed: 2 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -24,9 +24,8 @@ Next steps live in the [Quickstart](quickstart.md): launch the echo agent, wire
24
24
25
25
## SDK building blocks
26
26
27
-
-`acp.schema`: generated Pydantic models that validate every payload against the canonical specification.
27
+
-`acp.schema`: generated Pydantic models with defaults for protocol discriminator fields.
28
28
-`acp.agent` / `acp.client`: async base classes, JSON-RPC supervision, and lifecycle orchestration.
29
-
-`acp.helpers`: builders for content blocks, tool calls, permissions, and notifications.
30
29
-`acp.contrib`: experimental utilities (session accumulators, permission brokers, tool call trackers) harvested from production deployments.
31
30
-`examples/`: runnable agents, clients, duet demos, and the Gemini CLI bridge.
32
31
@@ -44,7 +43,7 @@ Next steps live in the [Quickstart](quickstart.md): launch the echo agent, wire
44
43
## Choose a path
45
44
46
45
-**Just exploring?** Skim [use-cases.md](use-cases.md) to see how kimi-cli, agent-client-kernel, and others use the SDK.
47
-
-**Building agents?** Copy `examples/echo_agent.py` or `examples/agent.py`, then layer in `acp.helpers` for tool calls and permissions.
46
+
-**Building agents?** Copy `examples/echo_agent.py` or `examples/agent.py`, then use the generated models directly. Use `acp.contrib` for permission workflows and other stateful patterns.
48
47
-**Embedding clients?** Start with `examples/client.py` or the `spawn_agent_process` / `spawn_client_process` helpers in the [Quickstart](quickstart.md#programmatic-launch).
prompt=[TextContentBlock(text="Hello from spawn!")],
118
119
)
119
120
120
121
asyncio.run(main())
@@ -145,21 +146,17 @@ Run it with `run_agent()` inside an async entrypoint and wire it to your client.
145
146
-[`examples/duet.py`](https://github.com/agentclientprotocol/python-sdk/blob/main/examples/duet.py) to see `spawn_agent_process` in action alongside the interactive client
146
147
-[`examples/gemini.py`](https://github.com/agentclientprotocol/python-sdk/blob/main/examples/gemini.py) to drive the Gemini CLI (`--acp`; use `--experimental-acp` for older versions) directly from Python
147
148
148
-
Need builders for common payloads? `acp.helpers` mirrors the Go/TS helper APIs:
149
+
Generated models provide defaults for discriminator fields such as `type` and
150
+
`sessionUpdate`, so they can be constructed directly:
149
151
150
152
```python
151
-
from acp importstart_tool_call, update_tool_call, text_block, tool_content
153
+
from acp.schemaimportAgentMessageChunk, TextContentBlock
Each helper wraps the generated Pydantic models in `acp.schema`, so the right discriminator fields (`type`, `sessionUpdate`, and friends) are always populated. That keeps examples readable while maintaining the same validation guarantees as constructing the models directly. Golden fixtures in `tests/test_golden.py` ensure the helpers stay in sync with future schema revisions.
162
-
163
160
## Optional — Talk to the Gemini CLI
164
161
165
162
_Have the Gemini CLI installed? Run the bridge to exercise permission flows._
0 commit comments