8000 chore: Update plugins in hello_world_app · codenamenam/adk-python@4cb07ba · GitHub
[go: up one dir, main page]

Skip to content

Commit 4cb07ba

Browse files
hangfeicopybara-github
authored andcommitted
chore: Update plugins in hello_world_app
Corrected `CountInvocationPlugin` to be a class reference and added `ContextFilterPlugin` to limit the number of tool invocations kept in the context to 3. PiperOrigin-RevId: 808591608
1 parent cee365a commit 4cb07ba

File tree

1 file changed

+5
-1
lines changed
  • contributing/samples/hello_world_app

1 file changed

+5
-1
lines changed

contributing/samples/hello_world_app/agent.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
from google.adk.apps import App
2121
from google.adk.models.llm_request import LlmRequest
2222
from google.adk.plugins.base_plugin import BasePlugin
23+
from google.adk.plugins.context_filter_plugin import ContextFilterPlugin
2324
from google.adk.tools.tool_context import ToolContext
2425
from google.genai import types
2526

@@ -141,5 +142,8 @@ async def before_model_callback(
141142
app = App(
142143
name='hello_world_app',
143144
root_agent=root_agent,
144-
plugins=[CountInvocationPlugin()],
145+
plugins=[
146+
CountInvocationPlugin(),
147+
ContextFilterPlugin(num_invocations_to_keep=3),
148+
],
145149
)

0 commit comments

Comments
 (0)
0