From 2274c4f3040b20da3690aa03272155776ca330c1 Mon Sep 17 00:00:00 2001 From: Google Team Member Date: Thu, 30 Oct 2025 13:37:42 -0700 Subject: [PATCH] feat: Add "final_session_state" to the EvalCase data model This will allow setting a golden expectation on the session state for agents that will modify the states. PiperOrigin-RevId: 826166904 --- src/google/adk/evaluation/eval_case.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/google/adk/evaluation/eval_case.py b/src/google/adk/evaluation/eval_case.py index 9d338901..065681b1 100644 --- a/src/google/adk/evaluation/eval_case.py +++ b/src/google/adk/evaluation/eval_case.py @@ -108,6 +108,10 @@ class Invocation(EvalBaseModel): """Details about the App that was used for this invocation.""" +SessionState: TypeAlias = dict[str, Any] +"""The state of the session.""" + + class SessionInput(EvalBaseModel): """Values that help initialize a Session.""" @@ -117,7 +121,7 @@ class SessionInput(EvalBaseModel): user_id: str """The user id.""" - state: dict[str, Any] = Field(default_factory=dict) + state: SessionState = Field(default_factory=dict) """The state of the session.""" @@ -159,6 +163,9 @@ class EvalCase(EvalBaseModel): ) """A list of rubrics that are applicable to all the invocations in the conversation of this eval case.""" + final_session_state: Optional[SessionState] = Field(default_factory=dict) + """The expected final session state at the end of the conversation.""" + @model_validator(mode="after") def ensure_conversation_xor_conversation_scenario(self) -> EvalCase: if (self.conversation is None) == (self.conversation_scenario is None):