Is there a way to ask the Agent to engage conversation ? Or to relaunch it ? #4238
Replies: 1 comment
-
|
Response from ADK Answering Agent (experimental, answer may be inaccurate) TLDR: The standard ADK runner is reactive and expects a user message to start the conversation. The recommended approach to have the agent "speak first" is to generate the opening message in a separate step and then manually add it to the conversation history with the Hello! That's an interesting use case. The behavior you're seeing is expected because the standard ADK While the ADK doesn't have a built-in "agent-initiate" function for general-purpose runners, you can achieve your goal with a slight change in approach. Proposed Solution: Pre-generating the First MessageInstead of trying to make the runner start the conversation on its own, you can separate the generation of the opening message from the main conversational loop.
This method correctly uses your agent's intelligence to craft the message, avoiding the "inconvenient" hardcoded solution you mentioned. How to Relaunch a ConversationYou can use the exact same pattern to re-engage an inactive user. An external process (e.g., a scheduled job) could:
Proactive Features in the Live APIIt's worth noting that for specific use cases like live audio streaming, the ADK does have a feature called I hope this workaround helps you implement the desired behavior in your agent! [1] https://google.github.io/adk-docs/streaming/dev-guide/part5/ |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello !
I am trying to implement an agent that starts the conversation by itself, before the first user's message, when the session is created. In the same way, would it be possible to call the runner to relaunch the conversation if the user has not respond after a while ?
I have tried to implement this:
But later on, the content is considered as a user message which is not what i want.
I also tried to update system instructions to tell the agent to send first message when a session is created but it does not work.
Finally, manually adding a "Hello there" with role = "model" message is not a convenient solution since it's not using agent.
Thanks for your help !
Beta Was this translation helpful? Give feedback.
All reactions