Skip to content

Commit a826e20

Browse files
committed
fix: udpate short term memory sample
1 parent b552d02 commit a826e20

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

docs/docs/memory/short-term-memory.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,15 +211,23 @@ VeADK 中,您可以使用如下短期记忆后端服务来初始化您的短
211211
```python
212212
from google.adk.apps.app import App
213213
from google.adk.apps.app import EventsCompactionConfig
214+
from veadk.agent import Agent
215+
216+
root_agent = Agent(
217+
description="hello world agent",
218+
instruction="""你是一个智能助手,擅长用中文礼貌回复用户的问题。""",
219+
)
214220

215221
app = App(
216-
name='my-agent',
222+
name='my_agent',
217223
root_agent=root_agent,
218224
events_compaction_config=EventsCompactionConfig(
219225
compaction_interval=3, # 每 3 次新调用触发一次压缩。
220226
overlap_size=1 # 包含前一个窗口的最后一次事件重叠。
221227
),
222228
)
229+
230+
root_agent = agent
223231
```
224232

225233
### 定义压缩器

0 commit comments

Comments
 (0)