Regenerate option #1645
|
What is the right way to implement the "regenerate" option — for the latest response or for one of the previous ones in the conversation? |
Replies: 5 comments 1 reply
|
Hi @pashna , what do you mean by "regenerate option"? Do you mean in ADK web we provide an option for user to reset output of the previous invocation and rerun the query? |
|
Response from ADK Answering Agent (experimental, answer may be inaccurate) TLDR: ADK does not have a built-in "regenerate" feature, so you need to implement it at the application level by managing the conversation history. For the latest response, remove the last agent message from the session history and re-run the agent. For a previous response, truncate the history to that point and then re-run the agent. Here's a more detailed explanation of how you can implement the "regenerate" functionality in your application using ADK: ADK manages conversations using a Regenerating the Latest ResponseThis is the more straightforward scenario. The process would be:
Regenerating a Previous ResponseRegenerating an earlier response in the conversation is more complex because it requires you to decide what to do with the part of the conversation that came after it. The simplest approach is to "roll back" the conversation to that point.
In both cases, the key is to use your application logic to manage the [1] publicly accessible HTTPS URL of the document: https://google.github.io/adk-docs/get-started/about/ |
|
ADK runner now supports rewind_async() which allow you to rewind to a previous invocation, you can rewind and then resend the user query. See: adk-python/src/google/adk/runners.py Line 446 in aa77834 |
|
Hoping this issue is resolved, marking it as closed. Please feel free reach out for any further issue. |
ADK runner now supports rewind_async() which allow you to rewind to a previous invocation, you can rewind and then resend the user query. See:
adk-python/src/google/adk/runners.py
Line 446 in aa77834