Skip to content

Commit 094830c

Browse files
authored
fix: resolve sidebar issues and bring in framework specific guides (CopilotKit#5057)
## Summary - Unify authored and generated shell-docs navigation so the sidebar keeps the same structure across framework modes. - Restore setup-content bundling from integration-owned docs and wire shell-docs to consume the generated bundle at runtime. - Audit and fix the LangGraph TypeScript and Google ADK code regions so the generated snippets are more useful and accurate. - Tighten docs/build routing and workflow triggers so shell-docs rebuilds when the relevant integration docs inputs change. ## Testing - Shell-docs unit tests passed. - Shell-docs typecheck passed. - Shell-docs lint passed with existing repository warnings only. - Setup-content bundle generation passed. - Python integration files compiled successfully. - Workflow YAML parsed successfully.
2 parents 619ed16 + bf9ac27 commit 094830c

57 files changed

Lines changed: 1428 additions & 1009 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/showcase_build.yml

Lines changed: 46 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ on:
1515
branches: [main]
1616
paths:
1717
- "showcase/**"
18+
- ".github/workflows/showcase_build.yml"
19+
- ".github/workflows/showcase_build_check.yml"
1820
workflow_dispatch:
1921
inputs:
2022
service:
@@ -83,6 +85,9 @@ jobs:
8385
# single-line strings, but mixing styles (list vs. string)
8486
# in the same filters block is easy to misread during review.
8587
filters: |
88+
workflow_config:
89+
- '.github/workflows/showcase_build.yml'
90+
- '.github/workflows/showcase_build_check.yml'
8691
shell:
8792
- 'showcase/shell/**'
8893
- 'showcase/shared/**'
@@ -141,6 +146,9 @@ jobs:
141146
- 'showcase/shared/**'
142147
- 'showcase/scripts/**'
143148
- 'showcase/integrations/*/manifest.yaml'
149+
- 'showcase/integrations/*/docs-links.json'
150+
- 'showcase/integrations/*/docs/setup/**'
151+
- 'showcase/integrations/*/src/**'
144152
showcase_harness:
145153
- 'showcase/harness/**'
146154
- 'showcase/shared/**'
@@ -187,16 +195,11 @@ jobs:
187195
{"dispatch_name":"built-in-agent","filter_key":"built_in_agent","context":"showcase/integrations/built-in-agent","image":"showcase-built-in-agent","railway_id":"f4f8371a-bc46-45b2-b6d4-9c9af608bdbf","timeout":15,"lfs":false,"build_args":"","dockerfile":"","health_path":"/api/health"},
188196
{"dispatch_name":"shell-dojo","filter_key":"shell_dojo","context":".","image":"showcase-shell-dojo","railway_id":"7ad1ece7-2228-49cd-8a78-bddf30322907","timeout":10,"lfs":false,"build_args":"","dockerfile":"showcase/shell-dojo/Dockerfile","health_path":"/"},
189197
{"dispatch_name":"shell-dashboard","filter_key":"shell_dashboard","context":".","image":"showcase-shell-dashboard","railway_id":"4d5dfd74-be61-40b2-8564-b53b7dd4c15b","timeout":10,"lfs":true,"build_args_sha":"__GH_SHA__","build_args_branch":"__GH_REF_NAME__","build_args_pb_url":"https://showcase-pocketbase-production.up.railway.app","build_args_shell_url":"https://showcase.copilotkit.ai","build_args_ops_url":"https://showcase-harness-production.up.railway.app","dockerfile":"showcase/shell-dashboard/Dockerfile","health_path":"/"},
190-
{"dispatch_name":"shell-docs","filter_key":"shell_docs","context":".","image":"showcase-shell-docs","railway_id":"7badfb8d-4228-414c-9145-b4026803714f","timeout":10,"lfs":true,"build_args_sha":"__GH_SHA__","build_args_branch":"__GH_REF_NAME__","build_args_analytics":"yes","dockerfile":"showcase/shell-docs/Dockerfile","health_path":"/"},
198+
{"dispatch_name":"shell-docs","filter_key":"shell_docs","context":".","image":"showcase-shell-docs","railway_id":"7badfb8d-4228-414c-9145-b4026803714f","timeout":10,"lfs":true,"build_args_sha":"__GH_SHA__","build_args_branch":"__GH_REF_NAME__","build_args_base_url":"https://docs.copilotkit.ai","build_args_shell_url":"https://showcase.copilotkit.ai","build_args_analytics":"yes","dockerfile":"showcase/shell-docs/Dockerfile","health_path":"/"},
191199
{"dispatch_name":"showcase-harness","filter_key":"showcase_harness","context":".","image":"showcase-harness","railway_id":"3a14bfed-0537-4d71-897b-7c593dca161d","timeout":20,"lfs":false,"build_args":"","dockerfile":"showcase/harness/Dockerfile","health_path":"/health"},
192200
{"dispatch_name":"showcase-aimock","filter_key":"showcase_aimock","context":"showcase/aimock","image":"showcase-aimock","railway_id":"0fa0435d-8a66-46f0-84fd-e4250b580013","timeout":5,"lfs":false,"build_args":"","dockerfile":"showcase/aimock/Dockerfile","health_path":"/health"}
193201
]'
194202
195-
# Substitute trusted git context (sha, ref_name) into JSON placeholders.
196-
# Routed through env: above to satisfy zizmor template-injection check.
197-
ALL_SERVICES="${ALL_SERVICES//__GH_SHA__/$GITHUB_SHA_ENV}"
198-
ALL_SERVICES="${ALL_SERVICES//__GH_REF_NAME__/$GITHUB_REF_NAME_ENV}"
199-
200203
DISPATCH="$DISPATCH_SERVICE"
201204
CHANGES="${FILTER_CHANGES:-[]}"
202205
@@ -211,11 +214,14 @@ jobs:
211214
# dispatch == <specific service>: narrow to that service only (skips paths-filter so
212215
# drift-rebuild and manual single-service dispatches work regardless of $changes).
213216
# dispatch == "": push event — include services whose filter_key appears in paths-filter CHANGES.
214-
MATRIX=$(echo "$ALL_SERVICES" | jq -c --arg dispatch "$DISPATCH" --argjson changes "$CHANGES" '
215-
[.[] | (.filter_key as $fk | select(
217+
MATRIX=$(echo "$ALL_SERVICES" | jq -c --arg dispatch "$DISPATCH" --argjson changes "$CHANGES" --arg sha "$GITHUB_SHA_ENV" --arg ref "$GITHUB_REF_NAME_ENV" '
218+
[.[] |
219+
if .build_args_sha == "__GH_SHA__" then .build_args_sha = $sha else . end |
220+
if .build_args_branch == "__GH_REF_NAME__" then .build_args_branch = $ref else . end |
221+
(.filter_key as $fk | select(
216222
$dispatch == "all" or
217223
($dispatch != "" and $dispatch != "all" and $dispatch == .dispatch_name) or
218-
($dispatch == "" and ($changes | index($fk) != null))
224+
($dispatch == "" and (($changes | index("workflow_config") != null) or ($changes | index($fk) != null)))
219225
))]
220226
')
221227
@@ -310,33 +316,49 @@ jobs:
310316

311317
- name: Prepare build args
312318
id: build-args
319+
env:
320+
BUILD_ARGS_SHA: ${{ matrix.service.build_args_sha }}
321+
BUILD_ARGS_BRANCH: ${{ matrix.service.build_args_branch }}
322+
BUILD_ARGS_PB_URL: ${{ matrix.service.build_args_pb_url }}
323+
BUILD_ARGS_BASE_URL: ${{ matrix.service.build_args_base_url }}
324+
BUILD_ARGS_SHELL_URL: ${{ matrix.service.build_args_shell_url }}
325+
BUILD_ARGS_OPS_URL: ${{ matrix.service.build_args_ops_url }}
326+
BUILD_ARGS_ANALYTICS: ${{ matrix.service.build_args_analytics }}
327+
NEXT_PUBLIC_POSTHOG_KEY: ${{ secrets.POSTHOG_PROJECT_KEY }}
328+
NEXT_PUBLIC_REB2B_KEY: ${{ secrets.REB2B_KEY }}
329+
NEXT_PUBLIC_SCARF_PIXEL_ID: ${{ secrets.SCARF_PIXEL_ID }}
330+
NEXT_PUBLIC_REO_KEY: ${{ secrets.REO_PROJECT_KEY }}
331+
NEXT_PUBLIC_GOOGLE_ANALYTICS_TRACKING_ID: ${{ secrets.GOOGLE_ANALYTICS_TRACKING_ID }}
313332
run: |
314333
ARGS=""
315-
if [ -n "${{ matrix.service.build_args_sha }}" ]; then
316-
ARGS="COMMIT_SHA=${{ matrix.service.build_args_sha }}"
317-
ARGS="${ARGS}"$'\n'"BRANCH=${{ matrix.service.build_args_branch }}"
334+
if [ -n "$BUILD_ARGS_SHA" ]; then
335+
ARGS="COMMIT_SHA=${BUILD_ARGS_SHA}"
336+
ARGS="${ARGS}"$'\n'"BRANCH=${BUILD_ARGS_BRANCH}"
337+
fi
338+
if [ -n "$BUILD_ARGS_PB_URL" ]; then
339+
ARGS="${ARGS:+${ARGS}$'\n'}NEXT_PUBLIC_POCKETBASE_URL=${BUILD_ARGS_PB_URL}"
318340
fi
319-
if [ -n "${{ matrix.service.build_args_pb_url }}" ]; then
320-
ARGS="${ARGS:+${ARGS}$'\n'}NEXT_PUBLIC_POCKETBASE_URL=${{ matrix.service.build_args_pb_url }}"
341+
if [ -n "$BUILD_ARGS_BASE_URL" ]; then
342+
ARGS="${ARGS:+${ARGS}$'\n'}NEXT_PUBLIC_BASE_URL=${BUILD_ARGS_BASE_URL}"
321343
fi
322-
if [ -n "${{ matrix.service.build_args_shell_url }}" ]; then
323-
ARGS="${ARGS:+${ARGS}$'\n'}NEXT_PUBLIC_SHELL_URL=${{ matrix.service.build_args_shell_url }}"
344+
if [ -n "$BUILD_ARGS_SHELL_URL" ]; then
345+
ARGS="${ARGS:+${ARGS}$'\n'}NEXT_PUBLIC_SHELL_URL=${BUILD_ARGS_SHELL_URL}"
324346
fi
325-
if [ -n "${{ matrix.service.build_args_ops_url }}" ]; then
347+
if [ -n "$BUILD_ARGS_OPS_URL" ]; then
326348
# OPS_BASE_URL is required at build time by shell-dashboard's
327349
# next.config.ts rewrites() — without it `next build` aborts.
328-
ARGS="${ARGS:+${ARGS}$'\n'}OPS_BASE_URL=${{ matrix.service.build_args_ops_url }}"
350+
ARGS="${ARGS:+${ARGS}$'\n'}OPS_BASE_URL=${BUILD_ARGS_OPS_URL}"
329351
fi
330-
if [ "${{ matrix.service.build_args_analytics }}" = "yes" ]; then
352+
if [ "$BUILD_ARGS_ANALYTICS" = "yes" ]; then
331353
# Client-side analytics keys for the shell-docs bundle.
332354
# NEXT_PUBLIC_* values must reach `next build` so they get
333355
# inlined into client JS chunks. Sourced from repo secrets;
334356
# Railway runtime env doesn't reach this build step.
335-
ARGS="${ARGS:+${ARGS}$'\n'}NEXT_PUBLIC_POSTHOG_KEY=${{ secrets.POSTHOG_PROJECT_KEY }}"
336-
ARGS="${ARGS:+${ARGS}$'\n'}NEXT_PUBLIC_REB2B_KEY=${{ secrets.REB2B_KEY }}"
337-
ARGS="${ARGS:+${ARGS}$'\n'}NEXT_PUBLIC_SCARF_PIXEL_ID=${{ secrets.SCARF_PIXEL_ID }}"
338-
ARGS="${ARGS:+${ARGS}$'\n'}NEXT_PUBLIC_REO_KEY=${{ secrets.REO_PROJECT_KEY }}"
339-
ARGS="${ARGS:+${ARGS}$'\n'}NEXT_PUBLIC_GOOGLE_ANALYTICS_TRACKING_ID=${{ secrets.GOOGLE_ANALYTICS_TRACKING_ID }}"
357+
ARGS="${ARGS:+${ARGS}$'\n'}NEXT_PUBLIC_POSTHOG_KEY=${NEXT_PUBLIC_POSTHOG_KEY}"
358+
ARGS="${ARGS:+${ARGS}$'\n'}NEXT_PUBLIC_REB2B_KEY=${NEXT_PUBLIC_REB2B_KEY}"
359+
ARGS="${ARGS:+${ARGS}$'\n'}NEXT_PUBLIC_SCARF_PIXEL_ID=${NEXT_PUBLIC_SCARF_PIXEL_ID}"
360+
ARGS="${ARGS:+${ARGS}$'\n'}NEXT_PUBLIC_REO_KEY=${NEXT_PUBLIC_REO_KEY}"
361+
ARGS="${ARGS:+${ARGS}$'\n'}NEXT_PUBLIC_GOOGLE_ANALYTICS_TRACKING_ID=${NEXT_PUBLIC_GOOGLE_ANALYTICS_TRACKING_ID}"
340362
fi
341363
# Use delimiter to safely pass multiline value
342364
echo "args<<BUILDARGS_EOF" >> $GITHUB_OUTPUT

.github/workflows/showcase_build_check.yml

Lines changed: 46 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,11 @@ on:
99
pull_request:
1010
paths:
1111
- "showcase/**"
12+
- ".github/workflows/showcase_build.yml"
13+
- ".github/workflows/showcase_build_check.yml"
1214

1315
concurrency:
14-
group: showcase-build-check-${{ github.head_ref }}
16+
group: showcase-build-check-${{ github.event.pull_request.number }}
1517
cancel-in-progress: true
1618

1719
permissions:
@@ -36,6 +38,9 @@ jobs:
3638
id: filter
3739
with:
3840
filters: |
41+
workflow_config:
42+
- '.github/workflows/showcase_build.yml'
43+
- '.github/workflows/showcase_build_check.yml'
3944
shell:
4045
- 'showcase/shell/**'
4146
- 'showcase/shared/**'
@@ -94,6 +99,9 @@ jobs:
9499
- 'showcase/shared/**'
95100
- 'showcase/scripts/**'
96101
- 'showcase/integrations/*/manifest.yaml'
102+
- 'showcase/integrations/*/docs-links.json'
103+
- 'showcase/integrations/*/docs/setup/**'
104+
- 'showcase/integrations/*/src/**'
97105
showcase_harness:
98106
- 'showcase/harness/**'
99107
- 'showcase/shared/**'
@@ -140,23 +148,22 @@ jobs:
140148
{"dispatch_name":"built-in-agent","filter_key":"built_in_agent","context":"showcase/integrations/built-in-agent","image":"showcase-built-in-agent","timeout":15,"lfs":false,"build_args":"","dockerfile":""},
141149
{"dispatch_name":"shell-dojo","filter_key":"shell_dojo","context":".","image":"showcase-shell-dojo","timeout":10,"lfs":false,"build_args":"","dockerfile":"showcase/shell-dojo/Dockerfile"},
142150
{"dispatch_name":"shell-dashboard","filter_key":"shell_dashboard","context":".","image":"showcase-shell-dashboard","timeout":10,"lfs":true,"build_args_sha":"__GH_SHA__","build_args_branch":"__GH_REF_NAME__","build_args_pb_url":"https://showcase-pocketbase-production.up.railway.app","build_args_shell_url":"https://showcase.copilotkit.ai","build_args_ops_url":"https://showcase-harness-production.up.railway.app","dockerfile":"showcase/shell-dashboard/Dockerfile"},
143-
{"dispatch_name":"shell-docs","filter_key":"shell_docs","context":".","image":"showcase-shell-docs","timeout":10,"lfs":true,"build_args_sha":"__GH_SHA__","build_args_branch":"__GH_REF_NAME__","dockerfile":"showcase/shell-docs/Dockerfile"},
151+
{"dispatch_name":"shell-docs","filter_key":"shell_docs","context":".","image":"showcase-shell-docs","timeout":10,"lfs":true,"build_args_sha":"__GH_SHA__","build_args_branch":"__GH_REF_NAME__","build_args_base_url":"https://docs.copilotkit.ai","build_args_shell_url":"https://showcase.copilotkit.ai","build_args_analytics":"yes","dockerfile":"showcase/shell-docs/Dockerfile"},
144152
{"dispatch_name":"showcase-harness","filter_key":"showcase_harness","context":".","image":"showcase-harness","timeout":20,"lfs":false,"build_args":"","dockerfile":"showcase/harness/Dockerfile"},
145153
{"dispatch_name":"showcase-aimock","filter_key":"showcase_aimock","context":"showcase/aimock","image":"showcase-aimock","timeout":5,"lfs":false,"build_args":"","dockerfile":"showcase/aimock/Dockerfile"}
146154
]'
147155
148-
# Substitute trusted PR head sha/ref into JSON placeholders.
149-
# Routed through env: above to satisfy zizmor template-injection check.
150-
# Note: PR_HEAD_REF is attacker-controllable (fork branch name) but is only
151-
# consumed as a Docker build-arg label inside the isolated build context.
152-
ALL_SERVICES="${ALL_SERVICES//__GH_SHA__/$PR_HEAD_SHA}"
153-
ALL_SERVICES="${ALL_SERVICES//__GH_REF_NAME__/$PR_HEAD_REF}"
154-
155156
CHANGES="${FILTER_CHANGES:-[]}"
156157
157-
# PR event only — filter to changed services
158-
MATRIX=$(echo "$ALL_SERVICES" | jq -c --argjson changes "$CHANGES" '
159-
[.[] | (.filter_key as $fk | select(
158+
# PR event only — filter to changed services. Use jq --arg for
159+
# untrusted PR metadata so branch names are encoded as JSON data,
160+
# not interpolated into shell source.
161+
MATRIX=$(echo "$ALL_SERVICES" | jq -c --argjson changes "$CHANGES" --arg sha "$PR_HEAD_SHA" --arg ref "$PR_HEAD_REF" '
162+
[.[] |
163+
if .build_args_sha == "__GH_SHA__" then .build_args_sha = $sha else . end |
164+
if .build_args_branch == "__GH_REF_NAME__" then .build_args_branch = $ref else . end |
165+
(.filter_key as $fk | select(
166+
($changes | index("workflow_config") != null) or
160167
($changes | index($fk) != null)
161168
))]
162169
')
@@ -193,20 +200,38 @@ jobs:
193200

194201
- name: Prepare build args
195202
id: build-args
203+
env:
204+
BUILD_ARGS_SHA: ${{ matrix.service.build_args_sha }}
205+
BUILD_ARGS_BRANCH: ${{ matrix.service.build_args_branch }}
206+
BUILD_ARGS_PB_URL: ${{ matrix.service.build_args_pb_url }}
207+
BUILD_ARGS_BASE_URL: ${{ matrix.service.build_args_base_url }}
208+
BUILD_ARGS_SHELL_URL: ${{ matrix.service.build_args_shell_url }}
209+
BUILD_ARGS_OPS_URL: ${{ matrix.service.build_args_ops_url }}
210+
BUILD_ARGS_ANALYTICS: ${{ matrix.service.build_args_analytics }}
196211
run: |
197212
ARGS=""
198-
if [ -n "${{ matrix.service.build_args_sha }}" ]; then
199-
ARGS="COMMIT_SHA=${{ matrix.service.build_args_sha }}"
200-
ARGS="${ARGS}"$'\n'"BRANCH=${{ matrix.service.build_args_branch }}"
213+
if [ -n "$BUILD_ARGS_SHA" ]; then
214+
ARGS="COMMIT_SHA=${BUILD_ARGS_SHA}"
215+
ARGS="${ARGS}"$'\n'"BRANCH=${BUILD_ARGS_BRANCH}"
216+
fi
217+
if [ -n "$BUILD_ARGS_PB_URL" ]; then
218+
ARGS="${ARGS:+${ARGS}$'\n'}NEXT_PUBLIC_POCKETBASE_URL=${BUILD_ARGS_PB_URL}"
219+
fi
220+
if [ -n "$BUILD_ARGS_BASE_URL" ]; then
221+
ARGS="${ARGS:+${ARGS}$'\n'}NEXT_PUBLIC_BASE_URL=${BUILD_ARGS_BASE_URL}"
201222
fi
202-
if [ -n "${{ matrix.service.build_args_pb_url }}" ]; then
203-
ARGS="${ARGS:+${ARGS}$'\n'}NEXT_PUBLIC_POCKETBASE_URL=${{ matrix.service.build_args_pb_url }}"
223+
if [ -n "$BUILD_ARGS_SHELL_URL" ]; then
224+
ARGS="${ARGS:+${ARGS}$'\n'}NEXT_PUBLIC_SHELL_URL=${BUILD_ARGS_SHELL_URL}"
204225
fi
205-
if [ -n "${{ matrix.service.build_args_shell_url }}" ]; then
206-
ARGS="${ARGS:+${ARGS}$'\n'}NEXT_PUBLIC_SHELL_URL=${{ matrix.service.build_args_shell_url }}"
226+
if [ -n "$BUILD_ARGS_OPS_URL" ]; then
227+
ARGS="${ARGS:+${ARGS}$'\n'}OPS_BASE_URL=${BUILD_ARGS_OPS_URL}"
207228
fi
208-
if [ -n "${{ matrix.service.build_args_ops_url }}" ]; then
209-
ARGS="${ARGS:+${ARGS}$'\n'}OPS_BASE_URL=${{ matrix.service.build_args_ops_url }}"
229+
if [ "$BUILD_ARGS_ANALYTICS" = "yes" ]; then
230+
ARGS="${ARGS:+${ARGS}$'\n'}NEXT_PUBLIC_POSTHOG_KEY=pr-build"
231+
ARGS="${ARGS:+${ARGS}$'\n'}NEXT_PUBLIC_REB2B_KEY=pr-build"
232+
ARGS="${ARGS:+${ARGS}$'\n'}NEXT_PUBLIC_SCARF_PIXEL_ID=pr-build"
233+
ARGS="${ARGS:+${ARGS}$'\n'}NEXT_PUBLIC_REO_KEY=pr-build"
234+
ARGS="${ARGS:+${ARGS}$'\n'}NEXT_PUBLIC_GOOGLE_ANALYTICS_TRACKING_ID=G-PRBUILD"
210235
fi
211236
# Use delimiter to safely pass multiline value
212237
echo "args<<BUILDARGS_EOF" >> $GITHUB_OUTPUT

showcase/integrations/google-adk/docs/setup/agent-config-setup.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
available in session state on every turn — read it inside a
1616
`before_model_callback` to inject preferences into the system prompt.
1717

18-
<DemoCode file="src/agents/hitl_in_chat_agent.py" region="setup" />
18+
<DemoCode file="src/agents/agent_config_agent.py" region="agent-config-setup" />
1919

2020
</Step>
2121
</Steps>
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<Steps>
2+
<Step>
3+
### Install the ADK + AG-UI bridge
4+
5+
```bash
6+
pip install ag-ui-adk
7+
```
8+
9+
</Step>
10+
<Step>
11+
### Read CopilotKit context before each model call
12+
13+
`useAgentContext` entries arrive in ADK session state under
14+
`state["copilotkit"]["context"]`. Add `AGUIToolset()` to the agent and
15+
use a `before_model_callback` to inject those read-only values into the
16+
system instruction.
17+
18+
<DemoCode file="src/agents/readonly_state_agent_context_agent.py" region="agent-context-setup" />
19+
20+
</Step>
21+
</Steps>

showcase/integrations/google-adk/docs/setup/shared-state-setup.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
it directly and the runtime forwards updates to the UI. Wire your
1515
`LlmAgent` with `AGUIToolset()` and CopilotKit takes care of the rest.
1616

17-
<DemoCode file="src/agents/hitl_in_chat_agent.py" region="setup" />
17+
<DemoCode file="src/agents/shared_state_read_write_agent.py" region="shared-state-setup" />
1818

1919
See `src/agents/shared_state_read_write_agent.py` for the bidirectional
2020
pattern: a before-model callback reads UI-authored preferences out of
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<Steps>
2+
<Step>
3+
### Install the ADK + AG-UI bridge
4+
5+
```bash
6+
pip install ag-ui-adk
7+
```
8+
9+
</Step>
10+
<Step>
11+
### Declare the predicted state mapping
12+
13+
ADK state streaming uses `PredictStateMapping` to map the streaming
14+
`write_document` tool argument into `state["document"]`. Add
15+
`AGUIToolset()` to the agent so CopilotKit can forward the state deltas to
16+
the UI.
17+
18+
<DemoCode file="src/agents/shared_state_streaming_agent.py" region="state-streaming-middleware" />
19+
20+
</Step>
21+
</Steps>

showcase/integrations/google-adk/docs/setup/subagents-setup.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
delegation. Delegation events are written to `tool_context.state` and
1717
flow back to the UI through CopilotKit's shared-state channel.
1818

19-
<DemoCode file="src/agents/hitl_in_chat_agent.py" region="setup" />
19+
<DemoCode file="src/agents/subagents_agent.py" region="subagent-setup" />
2020

2121
See `src/agents/subagents_agent.py` for the supervisor + three
2222
sub-agents pattern with a live delegation log.

0 commit comments

Comments
 (0)