Skip to content

Commit 4dd944e

Browse files
committed
Apply in-scope subset of PR CopilotKit#4038
1 parent 94e5b5f commit 4dd944e

3 files changed

Lines changed: 9 additions & 8 deletions

File tree

docs/content/docs/integrations/aws-strands/generative-ui/state-rendering.mdx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ is a situation where a user and an agent are working together to solve a problem
3939
Configure your Strands agent to maintain state. Here's an example that tracks searches:
4040

4141
```python title="agent/main.py"
42+
import os
4243
import json
4344
from ag_ui_strands import StrandsAgent, StrandsAgentConfig, ToolBehavior, create_strands_app
4445
from strands import Agent, tool
@@ -89,7 +90,7 @@ is a situation where a user and an agent are working together to solve a problem
8990

9091
agui_agent = StrandsAgent(
9192
agent=strands_agent,
92-
name="searchAgent",
93+
name="strands_agent",
9394
description="A helpful assistant for storing searches",
9495
config=config,
9596
)
@@ -122,7 +123,7 @@ is a situation where a user and an agent are working together to solve a problem
122123
// [!code highlight:13]
123124
// styles omitted for brevity
124125
useAgent({
125-
agentId: "searchAgent",
126+
agentId: "strands_agent",
126127
render: ({ state }) => (
127128
<div>
128129
{state.searches?.map((search, index) => (
@@ -168,7 +169,7 @@ is a situation where a user and an agent are working together to solve a problem
168169

169170
// [!code highlight:3]
170171
const { agent } = useAgent({
171-
agentId: "searchAgent",
172+
agentId: "strands_agent",
172173
})
173174

174175
// ...

docs/content/docs/integrations/aws-strands/shared-state/in-app-agent-read.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ state updates, you can reflect these updates natively in your application.
9696
function YourMainContent() {
9797
// [!code highlight:5]
9898
const { agent } = useAgent({
99-
agentId: "languageAgent",
99+
agentId: "strands_agent",
100100
// optionally provide a type-safe initial state
101101
initialState: { language: "spanish" }
102102
});
@@ -143,7 +143,7 @@ function YourMainContent() {
143143
// ...
144144
// [!code highlight:7]
145145
useAgent({
146-
agentId: "languageAgent",
146+
agentId: "strands_agent",
147147
render: ({ state }) => {
148148
if (!state.language) return null;
149149
return <div>Language: {state.language}</div>;

docs/content/docs/integrations/built-in-agent/shared-state.mdx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ import { useAgent } from "@copilotkit/react-core/v2"; // [!code highlight]
2626
function TaskBoard() {
2727
// [!code highlight:3]
2828
const { agent } = useAgent({
29-
agentId: "assistant",
29+
agentId: "default",
3030
});
3131

3232
// Read state set by the agent // [!code highlight]
@@ -60,7 +60,7 @@ import { useAgent } from "@copilotkit/react-core/v2";
6060

6161
function SettingsPanel() {
6262
const { agent } = useAgent({
63-
agentId: "assistant",
63+
agentId: "default",
6464
});
6565

6666
const handleThemeChange = (theme: string) => {
@@ -99,7 +99,7 @@ import { useAgent } from "@copilotkit/react-core/v2";
9999

100100
function TodoApp() {
101101
const { agent } = useAgent({
102-
agentId: "assistant",
102+
agentId: "default",
103103
});
104104

105105
const todos = (agent.state.todos as any[]) ?? [];

0 commit comments

Comments
 (0)