Skip to content

Services

The service definitions here are based on the Protobuf files available at https://protos.trustworthy.ai.

TrustworthySearch Services

The main trustworthy search API.

Services

  • StartJob starts a job using a JobRequest object and returns a Job object (unary RPC)
  • OpenSimStream takes Job as an argument and creates a stream with which a client can receive simulations to run until the job is finished (server streaming RPC)
  • UploadSimResult is the way a client uploads a SimReult from jobs asynchronously (unary RPC)
  • KillJob takes a Job as an argument and lets you stop a job before it is finished (unary RPC)
  • GetJobResult takes a Job object as an argument and gets analysis from a finished job as a JobResult (server streaming RPC)
  • EstimateRiskBudget estimates the budget needed for a RISK job based on a BudgetRequest object and returns a Budget (unary RPC)

Definition

service TrustworthySearch {
  rpc StartJob(JobRequest) returns (Job);

  rpc OpenSimStream(Job) returns (stream SimParams);

  rpc UploadSimResult(SimResult) returns (Empty);

  rpc KillJob(Job) returns (Empty);

  rpc GetJobResults(Job) returns (stream JobResult);

  rpc EstimateRiskBudget(BudgetRequest) returns (Budget);
}

Simulator Services

A simulator worker can run multiple jobs being sent to it by multiple brokers (each of which is uniquely defined by its port). It is not necessary to use the Simulator service for managing your simulation workers. This implementation is provided in order to demonstrate TrustworthySearch on several example problems

Services

  • Simulate simulates a rollout using a BrokerSimParams object (unary RPC)
  • BatchSimulate simulates a batch of rollouts using a BatchBrokerSimParams object (unary RPC)
  • RegisterBroker ties a worker to a specific broker using the BrokerPort (unary RPC)
  • DeregisterBroker decouples a worker from a specific broker using the BrokerPort (unary RPC)

Definition

service Simulator {
  rpc Simulate(BrokerSimParams) returns (Empty);

  rpc BatchSimulate(BatchBrokerSimParams) returns (Empty);

  rpc RegisterBroker(BrokerPort) returns (Empty);

  rpc DeregisterBroker(BrokerPort) returns (Empty);
}

Example

See the next section, Simulation, for more details on our example implementation of the broker/worker distributed simulation scheme.