You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Document and code comment are inconsistent for is_final_response() usage #4016
answered[Status] This issue has been answered by the maintainerdocumentation[Component] This issue is related to documentation, it will be transferred to adk-docsneeds review[Status] The PR/issue is awaiting review from the maintainerquestion[Component] This issue is asking a question or clarification
Use is_final_response(): Rely on this helper method in your application/UI layer to identify complete, user-facing text responses. Avoid manually replicating its logic.
The document recommends to use is_final_response() method.
NOTE: This method is ONLY for use by Agent Development Kit.
This implies the method is internal and should not be used by application developers.
It looks inconsistent.
It is unclear whether this method is intended to be a public API for developers or strictly for internal use within the ADK.
To Reproduce
N/A
Expected behavior
Please clarify the intended usage of is_final_response().
If it is for public use (as per docs), the code comment "ONLY for use by Agent Development Kit" should be removed or rephrased.
Screenshots
N/A
Desktop (please complete the following information):
N/A
The is_final_response() method on an event indicates whether that event represents the concluding output from the agent that authored it for that specific stage of the process.
It is important to note that in a multi-agent conversation (e.g., Agent A calls Agent B):
*Agent B will emit an event with is_final_response() == True when it has completed its task.
*Agent A will later emit its own event with is_final_response() == True when it has finished its processing, potentially after receiving the response from Agent B.
So, you can see multiple events where is_final_response() is True within a single user turn, one for each agent that finishes its part of the workflow. It does not just mean the end of the entire turn, but the end of an individual agent's contribution at that point.
@llalitkumarrr, thank you for the detailed breakdown of how the method works.
To follow up on @tosi29's point and get this issue resolved: since the documentation currently encourages developers to use this method, should we consider it Public API?
@llalitkumarrr thank you for the clarification!
Since you confirmed that users can utilize this method to build robust applications, the current code comment, which says 'ONLY for use by Agent Development Kit', is a bit too restrictive and misleading for developers.
I'd like to submit a PR to update that comment to something more accurate, such as:
'Primarily for internal framework use, but can be utilized by applications to identify concluding agent outputs.'
This is primarily intended as framework internal concept, hence the comment in the code. And developers could use this experimentation and exploration with while building applications.
I completely understand that it is a framework-internal concept at its core.
My concern is specifically with the word 'ONLY' in the current comment (ONLY for use by Agent Development Kit). For a developer, the word 'ONLY' implies that using the method is unsupported or might lead to breaking changes, which contradicts the 'experimentation and exploration' you mentioned.
If the intended usage is indeed for "experimentation and exploration" as you mentioned, I am concerned that the current documentation is misleading.
It is currently listed under "Best Practices", and explicitly says "Rely on this helper method" and "Avoid manually replicating its logic", which strongly implies it is production-ready and stable.
To avoid confusion and potential risks in production, I suggest updating both the documentation and the code comment to clearly state:
"This method is experimental only, and not for production use."
This would resolve the inconsistency by clarifying the stability level for developers.
answered[Status] This issue has been answered by the maintainerdocumentation[Component] This issue is related to documentation, it will be transferred to adk-docsneeds review[Status] The PR/issue is awaiting review from the maintainerquestion[Component] This issue is asking a question or clarification
Activity
Akshat8510 commentedon Jan 6, 2026
I'd like to work on this! It seems like a simple comment update to align the code with the public documentation. Please assign it to me.
llalitkumarrr commentedon Jan 6, 2026
Hello @tosi29 ,
The
is_final_response()method on an event indicates whether that event represents the concluding output from the agent that authored it for that specific stage of the process.It is important to note that in a multi-agent conversation (e.g., Agent A calls Agent B):
*Agent B will emit an event with
is_final_response() == Truewhen it has completed its task.*Agent A will later emit its own event with
is_final_response() == Truewhen it has finished its processing, potentially after receiving the response from Agent B.So, you can see multiple events where
is_final_response()is True within a single user turn, one for each agent that finishes its part of the workflow. It does not just mean the end of the entire turn, but the end of an individual agent's contribution at that point.This issue also discuss the same.
tosi29 commentedon Jan 7, 2026
@llalitkumarrr
Thank you for the explanation, I understood the behavior.
However, my question is about the intended usage policy.
Since the document and code comment contradict each other, which one should we follow?
Is this method intended to be public or internal?
Akshat8510 commentedon Jan 7, 2026
@llalitkumarrr, thank you for the detailed breakdown of how the method works.
To follow up on @tosi29's point and get this issue resolved: since the documentation currently encourages developers to use this method, should we consider it Public API?
llalitkumarrr commentedon Jan 8, 2026
Hello @tosi29 and @Akshat8510 ,
This is primarily intended as framework internal concept but users can utilize this to examine various aspects of Events to build robust applications.
Akshat8510 commentedon Jan 8, 2026
@llalitkumarrr thank you for the clarification!
Since you confirmed that users can utilize this method to build robust applications, the current code comment, which says 'ONLY for use by Agent Development Kit', is a bit too restrictive and misleading for developers.
Akshat8510 commentedon Jan 8, 2026
I'd like to submit a PR to update that comment to something more accurate, such as:
'Primarily for internal framework use, but can be utilized by applications to identify concluding agent outputs.'
Akshat8510 commentedon Jan 8, 2026
This would align the code with both your explanation and the public documentation. May I be assigned to make this update?
llalitkumarrr commentedon Jan 8, 2026
This is primarily intended as framework internal concept, hence the comment in the code. And developers could use this experimentation and exploration with while building applications.
Akshat8510 commentedon Jan 8, 2026
I completely understand that it is a framework-internal concept at its core.
My concern is specifically with the word 'ONLY' in the current comment (ONLY for use by Agent Development Kit). For a developer, the word 'ONLY' implies that using the method is unsupported or might lead to breaking changes, which contradicts the 'experimentation and exploration' you mentioned.
tosi29 commentedon Jan 12, 2026
@llalitkumarrr
Thank you for the clarification.
If the intended usage is indeed for "experimentation and exploration" as you mentioned, I am concerned that the current documentation is misleading.
It is currently listed under "Best Practices", and explicitly says "Rely on this helper method" and "Avoid manually replicating its logic", which strongly implies it is production-ready and stable.
To avoid confusion and potential risks in production, I suggest updating both the documentation and the code comment to clearly state:
"This method is experimental only, and not for production use."
This would resolve the inconsistency by clarifying the stability level for developers.
llalitkumarrr commentedon Jan 14, 2026
Hello,
We understand this might be confusing. Please be assured that we will do the needful to clear this up.
docs: clarify is_final_response() is a public helper
docs: clarify is_final_response() is a public helper