trinity.explorer.proxy.service module#

class trinity.explorer.proxy.service.ExplorerService(explorer: Explorer, listen_address: str = 'localhost', port: int = 8010)[source]#

Bases: object

Manages the lifecycle and operations of the Explorer API service.

__init__(explorer: Explorer, listen_address: str = 'localhost', port: int = 8010)[source]#
async serve() None[source]#
async model_weights_sync_loop() None[source]#
set_latest_model_version(version: int) None[source]#
async allocate_model(increase_count: bool = True) Tuple[str, int][source]#

Allocate a model for handling a request.

Returns:

A tuple of (model_api_address, model_version).

collect_metrics() Dict[source]#
async record_experience(response, model_version: int) None[source]#
async submit_experiences() None[source]#
async record_feedback(reward: float, msg_ids: List[str], task_id: str, run_id: int)[source]#
async shutdown()[source]#