Skip to content

Commit f5ffaec

Browse files
committed
Deployed c864d7d with MkDocs version: 1.6.1
1 parent 3bd19e2 commit f5ffaec

4 files changed

Lines changed: 17 additions & 15 deletions

File tree

quickstart/index.html

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -795,8 +795,9 @@ <h3 id="programmatic-launch">Programmatic launch<a class="headerlink" href="#pro
795795
import sys
796796
from pathlib import Path
797797
from typing import Any
798+
from uuid import uuid4
798799

799-
from acp import spawn_agent_process, text_block
800+
from acp import PROTOCOL_VERSION, spawn_agent_process, text_block
800801
from acp.interfaces import Client
801802

802803

@@ -813,11 +814,12 @@ <h3 id="programmatic-launch">Programmatic launch<a class="headerlink" href="#pro
813814
async def main() -&gt; None:
814815
script = Path(&quot;examples/echo_agent.py&quot;)
815816
async with spawn_agent_process(SimpleClient(), sys.executable, str(script)) as (conn, _proc):
816-
await conn.initialize(protocol_version=1)
817+
await conn.initialize(protocol_version=PROTOCOL_VERSION)
817818
session = await conn.new_session(cwd=str(script.parent), mcp_servers=[])
818819
await conn.prompt(
819820
session_id=session.session_id,
820821
prompt=[text_block(&quot;Hello from spawn!&quot;)],
822+
message_id=str(uuid4()),
821823
)
822824

823825
asyncio.run(main())
@@ -830,16 +832,16 @@ <h2 id="step-4-extend-the-agent">Step 4 — Extend the agent<a class="headerlink
830832

831833

832834
class MyAgent(Agent):
833-
async def prompt(self, prompt, session_id, **kwargs) -&gt; PromptResponse:
835+
async def prompt(self, prompt, session_id, message_id=None, **kwargs) -&gt; PromptResponse:
834836
# inspect prompt, stream updates, then finish the turn
835-
return PromptResponse(stop_reason=&quot;end_turn&quot;)
837+
return PromptResponse(stop_reason=&quot;end_turn&quot;, user_message_id=message_id)
836838
</code></pre>
837839
<p>Run it with <code>run_agent()</code> inside an async entrypoint and wire it to your client. Refer to:</p>
838840
<ul>
839841
<li><a href="https://github.com/agentclientprotocol/python-sdk/blob/main/examples/echo_agent.py"><code>examples/echo_agent.py</code></a> for the smallest streaming agent</li>
840842
<li><a href="https://github.com/agentclientprotocol/python-sdk/blob/main/examples/agent.py"><code>examples/agent.py</code></a> for an implementation that negotiates capabilities and streams richer updates</li>
841843
<li><a href="https://github.com/agentclientprotocol/python-sdk/blob/main/examples/duet.py"><code>examples/duet.py</code></a> to see <code>spawn_agent_process</code> in action alongside the interactive client</li>
842-
<li><a href="https://github.com/agentclientprotocol/python-sdk/blob/main/examples/gemini.py"><code>examples/gemini.py</code></a> to drive the Gemini CLI (<code>--experimental-acp</code>) directly from Python</li>
844+
<li><a href="https://github.com/agentclientprotocol/python-sdk/blob/main/examples/gemini.py"><code>examples/gemini.py</code></a> to drive the Gemini CLI (<code>--acp</code>) directly from Python</li>
843845
</ul>
844846
<p>Need builders for common payloads? <code>acp.helpers</code> mirrors the Go/TS helper APIs:</p>
845847
<pre><code class="language-python">from acp import start_tool_call, update_tool_call, text_block, tool_content
@@ -855,8 +857,8 @@ <h2 id="step-4-extend-the-agent">Step 4 — Extend the agent<a class="headerlink
855857
<h2 id="optional-talk-to-the-gemini-cli">Optional — Talk to the Gemini CLI<a class="headerlink" href="#optional-talk-to-the-gemini-cli" title="Permanent link">&para;</a></h2>
856858
<p><em>Have the Gemini CLI installed? Run the bridge to exercise permission flows.</em></p>
857859
<p>If you have the Gemini CLI installed and authenticated:</p>
858-
<pre><code class="language-bash">python examples/gemini.py --yolo # auto-approve permission prompts
859-
python examples/gemini.py --sandbox --model gemini-1.5-pro
860+
<pre><code class="language-bash">python examples/gemini.py --skip-trust --yolo # auto-approve permission prompts
861+
python examples/gemini.py --skip-trust --sandbox --model gemini-1.5-pro
860862
</code></pre>
861863
<p>Environment helpers:</p>
862864
<ul>

0 commit comments

Comments
 (0)