MCPcopy Create free account
hub / github.com/Roy3838/Observer / handle_request

Method handle_request

api/api_handlers.py:74–92  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

72 return self.models
73
74 async def handle_request(self, request_data: dict) -> dict:
75 """
76 Process the request asynchronously.
77 Subclasses MUST override this method.
78
79 Args:
80 request_data: The parsed JSON request data (dictionary).
81
82 Returns:
83 A dictionary representing the successful JSON response payload.
84
85 Raises:
86 ConfigError: If configuration (like API key) is missing.
87 BackendAPIError: If the downstream API call fails.
88 ValueError: If the request_data is invalid.
89 NotImplementedError: If the subclass doesn't implement this.
90 Exception: For other unexpected errors.
91 """
92 raise NotImplementedError(f"Handler '{self.name}' must implement handle_request")
93
94 # NOTE: log_conversation() method removed - now handled centrally in compute.py
95 # This eliminates disk I/O during requests and ensures consistent logging across all handlers

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected