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
Copy file name to clipboardExpand all lines: AGENTS.md
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -17,6 +17,7 @@
17
17
- Target Python 3.10+ with four-space indentation and type hints on public APIs.
18
18
- Ruff enforces formatting and lint rules (`uv run ruff check`, `uv run ruff format`); keep both clean before publishing.
19
19
- Prefer dataclasses or generated Pydantic models from `acp.schema` over ad-hoc dicts. Place shared utilities in `_`-prefixed internal modules.
20
+
- When constructing ACP payloads, use the builders in `acp.helpers` (for example `text_block`, `start_tool_call`). These helpers keep the generated Pydantic models authoritative while hiding required literal fields, and the golden tests (`tests/test_golden.py`) ensure they always match the schema.
20
21
21
22
## Testing Guidelines
22
23
- Tests live in `tests/` and must be named `test_*.py`. Use `pytest.mark.asyncio` for coroutine coverage.
Copy file name to clipboardExpand all lines: docs/quickstart.md
+16-3Lines changed: 16 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -57,9 +57,9 @@ import asyncio
57
57
import sys
58
58
from pathlib import Path
59
59
60
-
from acp import spawn_agent_process
60
+
from acp import spawn_agent_process, text_block
61
61
from acp.interfaces import Client
62
-
from acp.schema import InitializeRequest, NewSessionRequest, PromptRequest, SessionNotification, TextContentBlock
62
+
from acp.schema import InitializeRequest, NewSessionRequest, PromptRequest, SessionNotification
63
63
64
64
65
65
classSimpleClient(Client):
@@ -78,7 +78,7 @@ async def main() -> None:
78
78
await conn.prompt(
79
79
PromptRequest(
80
80
sessionId=session.sessionId,
81
-
prompt=[TextContentBlock(type="text", text="Hello from spawn!")],
81
+
prompt=[text_block("Hello from spawn!")],
82
82
)
83
83
)
84
84
@@ -108,6 +108,19 @@ Hook it up with `AgentSideConnection` inside an async entrypoint and wire it to
108
108
-[`examples/duet.py`](https://github.com/psiace/agent-client-protocol-python/blob/main/examples/duet.py) to see `spawn_agent_process` in action alongside the interactive client
109
109
-[`examples/gemini.py`](https://github.com/psiace/agent-client-protocol-python/blob/main/examples/gemini.py) to drive the Gemini CLI (`--experimental-acp`) directly from Python
110
110
111
+
Need builders for common payloads? `acp.helpers` mirrors the Go/TS helper APIs:
112
+
113
+
```python
114
+
from acp import start_tool_call, update_tool_call, text_block, tool_content
0 commit comments