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

Function test_context_variable

tests/integration/test_system_instruction.py:87–106  ·  view source on GitHub ↗
(agent_runner: TestRunner)

Source from the content-addressed store, hash-verified

85 indirect=True,
86)
87def test_context_variable(agent_runner: TestRunner):
88 session = Session(
89 context={
90 "customerId": "1234567890",
91 "customerInt": 30,
92 "customerFloat": 12.34,
93 "customerJson": {"name": "John Doe", "age": 30, "count": 11.1},
94 }
95 )
96 si = UnitFlow()._build_system_instruction(
97 InvocationContext(
98 invocation_id="1234567890", agent=agent_runner.agent, session=session
99 )
100 )
101
102 assert (
103 "Use the echo_info tool to echo 1234567890, 30, 12.34, and {'name': 'John"
104 " Doe', 'age': 30, 'count': 11.1}. Ask for it if you need to."
105 in si
106 )
107
108
109@pytest.mark.parametrize(

Callers

nothing calls this directly

Calls 2

SessionClass · 0.90
InvocationContextClass · 0.90

Tested by

no test coverage detected