how do agents implicitly use states? #477
mohammad-passage
started this conversation in
General
Replies: 2 comments 2 replies
-
I don't think it would work, as if you don't refer to the state like |
Beta Was this translation helpful? Give feedback.
2 replies
-
The code in loop agent part of the documentation says it does # Conceptual Example: Using output_key and reading state
from google.adk.agents import LlmAgent, SequentialAgent
agent_A = LlmAgent(name="AgentA", instruction="Find the capital of France.", output_key="capital_city")
agent_B = LlmAgent(name="AgentB", instruction="Tell me about the city stored in state key 'capital_city'.")
pipeline = SequentialAgent(name="CityInfo", sub_agents=[agent_A, agent_B])
# AgentA runs, saves "Paris" to state['capital_city'].
# AgentB runs, its instruction processor reads state['capital_city'] to get "Paris". |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I have a question and am too lazy to look at the code for that.
Say you have a state like {"first_name": "Alex"} and the query to agent is "What is the first name? You can look at state's first_name key".
q1: Does the agent answer this? Based on my test it does.
q2: How does this happen? There should be somewhere that we put the state values in the prompt/instruction. who does it?
Beta Was this translation helpful? Give feedback.
All reactions