| 354 | |
| 355 | @dataclass |
| 356 | class SelfReflectionResult: |
| 357 | image_records: list[dict[str, Any]] |
| 358 | image_paths: list[str] |
| 359 | final_user_text: str |
| 360 | final_system_msg: str |
| 361 | final_response: str |
| 362 | predicted_label: int | None # 1 success, 0 failure, None unparsed |
| 363 | model: str = "" |
| 364 | endpoint: str = "" |
| 365 | |
| 366 | def to_dict(self) -> dict[str, Any]: |
| 367 | return { |
| 368 | "model": self.model, |
| 369 | "endpoint": self.endpoint, |
| 370 | "predicted_label": self.predicted_label, |
| 371 | "final_response": self.final_response, |
| 372 | "final_user_text": self.final_user_text, |
| 373 | "final_system_msg": self.final_system_msg, |
| 374 | "image_paths": self.image_paths, |
| 375 | "image_records": self.image_records, |
| 376 | } |
| 377 | |
| 378 | |
| 379 | async def run_self_reflection_async( |
no outgoing calls
no test coverage detected