File tree Expand file tree Collapse file tree
contributing/samples/nested_state_agent Expand file tree Collapse file tree Original file line number Diff line number Diff line change 77
88
99def inject_nested_state (callback_context : CallbackContext ):
10- callback_context .state ["user" ] = {
11- # "name": "Jainish",
12- # "profile": {"age": 24, "role": "Software Engineer"},
13- }
14- logging .info ("State populated with nested user object." )
10+ callback_context .state ["user" ] = {
11+ # "name": "Jainish",
12+ # "profile": {"age": 24, "role": "Software Engineer"},
13+ }
14+ logging .info ("State populated with nested user object." )
1515
1616
1717async def build_instruction (readonly_context : ReadonlyContext ) -> str :
18- print (readonly_context .state )
19- template = (
20- "Current user is {{user?.name?}} and {{user?.profile?.role?}}. Please greet "
21- " them by name and designation."
22- )
23- return await inject_session_state (template , readonly_context )
18+ print (readonly_context .state )
19+ template = (
20+ "Current user is {{user?.name?}} and {{user?.profile?.role?}}. Please"
21+ " greet them by name and designation."
22+ )
23+ return await inject_session_state (template , readonly_context )
2424
2525
2626agent = Agent (
You can’t perform that action at this time.
0 commit comments