Process the request asynchronously. Subclasses MUST override this method. Args: request_data: The parsed JSON request data (dictionary). Returns: A dictionary representing the successful JSON response payload. Raises: Co
(self, request_data: dict)
| 56 | return self.models |
| 57 | |
| 58 | async def handle_request(self, request_data: dict) -> dict: |
| 59 | """ |
| 60 | Process the request asynchronously. |
| 61 | Subclasses MUST override this method. |
| 62 | |
| 63 | Args: |
| 64 | request_data: The parsed JSON request data (dictionary). |
| 65 | |
| 66 | Returns: |
| 67 | A dictionary representing the successful JSON response payload. |
| 68 | |
| 69 | Raises: |
| 70 | ConfigError: If configuration (like API key) is missing. |
| 71 | BackendAPIError: If the downstream API call fails. |
| 72 | ValueError: If the request_data is invalid. |
| 73 | NotImplementedError: If the subclass doesn't implement this. |
| 74 | Exception: For other unexpected errors. |
| 75 | """ |
| 76 | raise NotImplementedError(f"Handler '{self.name}' must implement handle_request") |
| 77 | |
| 78 | # NOTE: log_conversation() method removed - now handled centrally in compute.py |
| 79 | # This eliminates disk I/O during requests and ensures consistent logging across all handlers |
no outgoing calls
no test coverage detected