Skip to content

Commit 2274c4f

Browse files
google-genai-botcopybara-github
authored andcommitted
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
1 parent 610e219 commit 2274c4f

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/google/adk/evaluation/eval_case.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,10 @@ class Invocation(EvalBaseModel):
108108
"""Details about the App that was used for this invocation."""
109109

110110

111+
SessionState: TypeAlias = dict[str, Any]
112+
"""The state of the session."""
113+
114+
111115
class SessionInput(EvalBaseModel):
112116
"""Values that help initialize a Session."""
113117

@@ -117,7 +121,7 @@ class SessionInput(EvalBaseModel):
117121
user_id: str
118122
"""The user id."""
119123

120-
state: dict[str, Any] = Field(default_factory=dict)
124+
state: SessionState = Field(default_factory=dict)
121125
"""The state of the session."""
122126

123127

@@ -159,6 +163,9 @@ class EvalCase(EvalBaseModel):
159163
)
160164
"""A list of rubrics that are applicable to all the invocations in the conversation of this eval case."""
161165

166+
final_session_state: Optional[SessionState] = Field(default_factory=dict)
167+
"""The expected final session state at the end of the conversation."""
168+
162169
@model_validator(mode="after")
163170
def ensure_conversation_xor_conversation_scenario(self) -> EvalCase:
164171
if (self.conversation is None) == (self.conversation_scenario is None):

0 commit comments

Comments
 (0)