Thanks to visit codestin.com
Credit goes to github.com

Skip to content

loop_agent gives non-deterministic responses #1806

@SaketMVS

Description

@SaketMVS

** Please make sure you read the contribution guide and file the issues in the right place. **
Contribution guide.

Describe the bug
Loop Agent:
I have an agent which classifies given customer feedback into positive, negative or neutral. I used a loop agent iterates over this agent multiple times and I am expecting it to return the same response all the time.

But To my surprise, On the first iteration, I was able to get the response as positive and for all the subsequent iterations, agent is asking me to provide the input again

To Reproduce
agent1 = LlmAgent(
name="agent1",
model=GEMINI_MODEL,
include_contents='none',
instruction="Classify the given customer feedback into positive, negative or neutral",
description="Classify the given customer feedback into positive, negative or neutral",
output_key="agent1_output"
)

loop_agent1 = LoopAgent(
name="loop_agent1",
sub_agents=[agent1],
max_iterations=3
)

root_agent = loop_agent1

Expected behavior
I expected loop agent should return the same response in all the iterations

Screenshots

Image

Desktop (please complete the following information):

  • Python version(python -V): 3.11.2
  • ADK version(pip show google-adk): 1.5.0

Metadata

Metadata

Assignees

Labels

bot triaged[Bot] This issue is triaged by ADK botcore[Component] This issue is related to the core interface and implementation

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions