MCPcopy Index your code
hub / github.com/google/adk-python / before_tool_agent

Function before_tool_agent

tests/unittests/tools/test_agent_tool.py:319–324  ·  view source on GitHub ↗
(callback_context: CallbackContext)

Source from the content-addressed store, hash-verified

317 """The agent tool can read and write artifacts."""
318
319 async def before_tool_agent(callback_context: CallbackContext):
320 # Artifact 1 should be available in the tool agent.
321 artifact = await callback_context.load_artifact('artifact_1')
322 await callback_context.save_artifact(
323 'artifact_2', Part.from_text(text=artifact.text + ' 2')
324 )
325
326 tool_agent = SequentialAgent(
327 name='tool_agent',

Callers

nothing calls this directly

Calls 2

load_artifactMethod · 0.45
save_artifactMethod · 0.45

Tested by

no test coverage detected