An eval case.
| 133 | |
| 134 | |
| 135 | class EvalCase(EvalBaseModel): |
| 136 | """An eval case.""" |
| 137 | |
| 138 | model_config = pydantic.ConfigDict(extra="allow") |
| 139 | |
| 140 | eval_id: str |
| 141 | """Unique identifier for the evaluation case.""" |
| 142 | |
| 143 | conversation: Optional[StaticConversation] = None |
| 144 | """A static conversation between the user and the Agent. |
| 145 | |
| 146 | While creating an eval case you should specify either a `conversation` or a |
| 147 | `conversation_scenario`, but not both. |
| 148 | """ |
| 149 | |
| 150 | conversation_scenario: Optional[ConversationScenario] = None |
| 151 | """A conversation scenario that should be used by a UserSimulator. |
| 152 | |
| 153 | While creating an eval case you should specify either a `conversation` or a |
| 154 | `conversation_scenario`, but not both. |
| 155 | """ |
| 156 | |
| 157 | session_input: Optional[SessionInput] = None |
| 158 | """Session input that will be passed on to the Agent during eval. |
| 159 | It is common for Agents state to be initialized to some initial/default value, |
| 160 | for example, your agent may need to know today's date. |
| 161 | """ |
| 162 | |
| 163 | creation_timestamp: float = 0.0 |
| 164 | """The time at which this eval case was created.""" |
| 165 | |
| 166 | rubrics: Optional[list[Rubric]] = Field( |
| 167 | default=None, |
| 168 | ) |
| 169 | """A list of rubrics that are applicable to all the invocations in the conversation of this eval case.""" |
| 170 | |
| 171 | final_session_state: Optional[SessionState] = Field(default_factory=dict) |
| 172 | """The expected final session state at the end of the conversation.""" |
| 173 | |
| 174 | @model_validator(mode="after") |
| 175 | def ensure_conversation_xor_conversation_scenario(self) -> EvalCase: |
| 176 | if (self.conversation is None) == (self.conversation_scenario is None): |
| 177 | raise ValueError( |
| 178 | "Exactly one of conversation and conversation_scenario must be" |
| 179 | " provided in an EvalCase." |
| 180 | ) |
| 181 | return self |
| 182 | |
| 183 | |
| 184 | def get_all_tool_calls( |
no outgoing calls