Parameter Injection
Experiment parameters flow through request_mapping for both REST and SDK connector endpoints. The same \{\{ params.model \}\} syntax works everywhere.
How it works
When a test run is associated with an experiment, the platform resolves the experiment’s parameter values once at queue time and stores an immutable snapshot on the test run. During execution, the snapshot is injected into the Jinja2 template context as params.
Your request mapping references individual values with dot notation:
This works identically whether the endpoint is REST (HTTP) or SDK connector (WebSocket). The template is rendered before the request is dispatched, so your API or function receives the final resolved values.
REST endpoints
For REST endpoints, the rendered request body is sent as the HTTP payload. See Using Experiment Parameters for full details, including how to use Jinja2 defaults for graceful fallback when no experiment is attached.
SDK connector endpoints
For SDK connector endpoints, the rendered request mapping becomes the function’s keyword arguments. The function signature simply declares the parameters it expects:
During a test run with an experiment, params.model resolves to the experiment’s value (e.g., "gpt-4o"). Without an experiment, the Jinja2 default() filter provides the fallback.
There is no distinction between “test data” and “configuration” at the request mapping level — both are template variables rendered the same way. This keeps the mental model simple: input is the test prompt, params.* are the experiment knobs, and any other platform variables (test_id, session_id, etc.) work as documented in Platform-Managed Variables.
Parameters.get() in production code
The params template variable handles test-time parameter injection. For production traffic (live requests that don’t go through the test runner), your application reads parameters using the Parameters.get() facade:
During a test run, the platform also sets an internal context variable so that Parameters.get() calls inside your function return the experiment’s values without hitting the network. This means production code that calls Parameters.get() will automatically pick up the experiment snapshot during tests — no special branching needed.
See SDK Usage for the full Parameters.get() API.
The Wire Protocol
For those debugging at the protocol level, the ExecuteTestMessage payload sent by the Rhesis platform over the connector includes the full parameter snapshot:
parameters: The resolvedDict[str, Any]of values.parameter_version: The sequential version identifier (e.g.v3) of the version being executed.parameter_experiment_id: The UUID of the experiment.parameter_source: The resolution method used ("environment","experiment_id", or"version"). Older snapshots may still show"label"; treat it as"environment".parameter_source_environment: The environment name when resolution went through an environment (for example"default"). Legacy snapshots may useparameter_source_labelinstead.parameter_schema: The full schema, allowing the SDK to validate the payload locally.
Because the backend dispatcher copies parameter_source and parameter_source_environment from the run snapshot, the ResolvedParameters.source_environment inside your application reflects the environment (for example “via default”) that was targeted at run-queue time.
Worked Example: The Chatbot
The Rhesis chatbot demo application is the canonical reference for parameter management.
The core chat() function is decorated as an @endpoint. Parameters come through the request mapping alongside test data:
The FastAPI route serves production traffic and resolves parameters through the Parameters.get() facade, then calls the same function:
Deprecated: The parameters keyword argument on @endpoint (e.g., parameters=["model", "temperature"]) is deprecated. Use \{\{ params.model \}\} in request_mapping instead. The old kwarg-merging path still works but will be removed in a future release.