nemo_evaluator.adapters.server
#
Main server which serves on a local port and holds chain of interceptors
Module Contents#
Classes#
Adapter server with registry-based interceptor support |
|
Functions#
Check if the given port is open on the host. |
|
Wait for server to be ready with timeout. |
Data#
API#
- class nemo_evaluator.adapters.server.AdapterServer(
- api_url: str,
- output_dir: str,
- adapter_config: nemo_evaluator.adapters.adapter_config.AdapterConfig,
- port: int = DEFAULT_ADAPTER_PORT,
Adapter server with registry-based interceptor support
Initialization
Initialize the adapter server.
Args: api_url: The upstream API URL to forward requests to output_dir: Directory for output files adapter_config: Adapter configuration including interceptors and discovery
- DEFAULT_ADAPTER_HOST: str#
‘localhost’
- DEFAULT_ADAPTER_PORT: int#
3825
- class nemo_evaluator.adapters.server.AdapterServerProcess(
- evaluation: nemo_evaluator.api.api_dataclasses.Evaluation,
Initialization
- nemo_evaluator.adapters.server.is_port_open(host: str, port: int, timeout: float = 0.5) bool [source]#
Check if the given port is open on the host.
Args: host: The host to check port: The port to check timeout: Socket timeout in seconds
Returns: bool: True if port is open, False otherwise
- nemo_evaluator.adapters.server.logger#
‘get_logger(…)’
- nemo_evaluator.adapters.server.wait_for_server(
- host: str,
- port: int,
- max_wait: float = 300,
- interval: float = 0.2,
Wait for server to be ready with timeout.
Args: host: The host to check port: The port to check max_wait: Maximum time to wait in seconds (default: 10) interval: Time between checks in seconds (default: 0.2)
Returns: bool: True if server is ready, False if timeout exceeded