I have a scenario where I've read all the documents of ADK, but I still don't know how to write it. I want to build such an agent:
- First, according to the input, call the analysis_page_agent to analyze the user's needs, specify the output_key as page_analysis, store it in JSON format, and reply to the user with the current analysis content in the form of a Markdown table.
- Then, according to the content of page_analysis, call the write_code_agent to generate the UI code, and reply to the user with the current UI code in the form of a Markdown table.
Attempted Solution One: LlmAgent + subAgents
I've tried using LlmAgent + subAgents. I found that this method will only call the first one: the analysis_page_agent, and what is replied to the user is just a JSON, and the subsequent steps won't be executed.
Attempted Solution Two: SequentialAgent
I've tried using SequentialAgent. This method will execute according to the first and second steps. However, there is still the old problem. In the first step, only the result of the analysis_page_agent is returned to the user, and there is no interval between the information returned in the second step and that in the first step. It seems that a team manager is missing to handle the output.
Attempted Solution Three: Using Tools
- Register both the analysis_page_agent and the write_code_agent as tools, and then call the render_agent to execute.
But with this method, it seems that the final summary and HTML output are only returned after the tools are executed, and the experience is not so good.
Is there a better way for me to:
- When executing the first step, be able to output the summary result and tell the user, and at the same time store the JSON information in the state?
- And be able to execute the second step according to the instructions and generate the HTML code?
I have a scenario where I've read all the documents of ADK, but I still don't know how to write it. I want to build such an agent:
Attempted Solution One: LlmAgent + subAgents
I've tried using LlmAgent + subAgents. I found that this method will only call the first one: the analysis_page_agent, and what is replied to the user is just a JSON, and the subsequent steps won't be executed.
Attempted Solution Two: SequentialAgent
I've tried using SequentialAgent. This method will execute according to the first and second steps. However, there is still the old problem. In the first step, only the result of the analysis_page_agent is returned to the user, and there is no interval between the information returned in the second step and that in the first step. It seems that a team manager is missing to handle the output.
Attempted Solution Three: Using Tools
But with this method, it seems that the final summary and HTML output are only returned after the tools are executed, and the experience is not so good.
Is there a better way for me to: