trinity.explorer.proxy.service module#

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

基类:object

Manages the lifecycle and operations of the Explorer API service.

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

Allocate a model for handling a request.

返回:

A tuple of (model_api_address, model_version).

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