sim_platform.models.providers.rehearsal

A deterministic stand-in for a model, to rehearse an Agent without model calls or cost.

Rehearsal checks an Agent’s plumbing (roles, tools, data, orders, journal, Replay) before paying for a real model. It answers each request from the tools offered, like a diligent but trivial model: it reads one data tool, then ends the role with its finishing tool. A trader (offered order tools) optionally buys one share at market, writes a journal note and finishes. Its choices carry no investment meaning; never evaluate its results.

Use it in place of a provider: app.configure_experiment_model(experiment, profile, provider=RehearsalProvider('AAPL')). It runs inside the Agent process, so it imports only the standard library.

class sim_platform.models.providers.rehearsal.RehearsalProvider(symbol, *, trade=True)[source]

Bases: object

Scripted replies in the Responses format; one instance per experiment.

Parameters:
  • symbol (str)

  • trade (bool)

choose(payload)[source]

The next tool call for this request; pure apart from the call counter.

Parameters:

payload (Dict[str, Any])

Return type:

Dict[str, Any]

async request(profile, payload, secret)[source]

Return one function call with token counts estimated from the request size.

Parameters:
  • profile (Any)

  • payload (Dict[str, Any])

  • secret (str)

Return type:

Dict[str, Any]