Skip to main content
These Adapt-1 templates cover how to set up a Domain, what to log, and which part of the response to use. Use the Python smoke tests below to exercise the same request sequence against a deployment before sending live observations.

Run a template

  1. Choose a fresh Domain ID. Send POST /domains with the template object under learning.transition. In schema, declare the signal names from the template’s input and target paths without the values. prefix, and declare "outcome" in event_types.
  2. Send completed observations to POST /domains/{id}/events, with event_type: "outcome" and the input and target values under values. Keep the same authentication and session for every request. Check learner_eligibility to confirm admission and count the applicable observations before running a query.
  3. Send POST /domains/{id}/query with the pre-outcome inputs under context.values. Request decision_id and transition_prediction for a forecast or decision_id and transition_plan for a plan. Put the outcome’s identifier in context.metadata.future_id if you intend to revise or resolve it.
  4. When the outcome becomes available, post one event with the pre-outcome inputs, the measured targets, and the returned decision_id and future_id in metadata. For a plan, also record the executed action in values. Inspect learning and troubleshoot.
For example, wrap the transition object for the first template in this Domain body. Fill in learning.transition with that object before sending the request.

Forecast joint demand and generation

Forecast site load and wind generation for the next hour. The numeric levels can move with weather and time of day. Use linear_residual to transport the numeric levels and keep the residual outcomes joint.
For each observed hour, record the earlier readings and calendar features along with load and generation measured at the next hour. This event’s values contain the earlier readings and both measured outcomes.
Query with the same five input fields. Check which targets appear in numeric_transport.target_paths, then read joint atoms to estimate events such as high load with low generation. If the cost of reserving capacity is already known, compute the expected cost of each permitted capacity in your application using the forecast probabilities. Read the joint atoms.

Pool sites for cold-start forecasts

Reuse this declaration for sites with compatible dynamics. Divide load and generation by an available site-specific scale, such as rated capacity, and name the resulting paths according to their units. Apply the same transform to past inputs and outcome records. Keep site IDs in your application trace and give each outcome a unique future_id. Leave site identity out of the learner’s inputs and grouping. Hold out one site when checking how well shared history serves a first forecast there, then restore its physical units when applying capacity rules.

Forecast near-zero joint deviations

For regional generation forecast errors, compute deviations from the baseline forecast issued at the same time. If those deviations have little conditional mean structure, start with numeric_transport: "none". The distribution can still change shape as weather conditions change.
Log the three errors at their common target horizon and on comparable scales. To get the probability that all three regions underproduce together, sum probability over joint atoms where all three observed-minus-baseline errors are below your chosen thresholds. Compare prior and conditional on the same realized errors to check whether evidence improves the joint forecast.

Revise when a feed arrives late

Reuse the joint demand and generation template. Start with conditioning: "kernel". For a wider deployment with many observed masks, size max_calibration_groups for the mask, group, and action combinations you want to track. For example, 1024 is the supported upper bound. Size max_pending_forecasts for the maximum number of unresolved revisions across open outcomes. The first query can use only the load and calendar fields. If the weather feed arrives later, include the new fields alongside the earlier ones. Send these as the context in separate queries, preserving the future_id.
When both measured targets are available, send the completed observation with one returned decision_id and the same future_id. Inspect the observed paths at each issue time and the number of revisions resolved. Issue and revise a forecast.

Plan one dispatch step under a reserve limit

Choose among three storage commands using current reserve and expected demand. Set the modeled risk limit for leaving the interval below 20% reserve to 10%. Use the objective scale in percentage points.
Each completed observation pairs reserve_pct and demand_mw with the executed action and measured next_reserve_pct. Collect observations for all three actions across the states you expect to query. For a plan, send only the current reserve and demand. Read transition_plan.selected_action after confirming status: "planned" and failure_probability_upper within the configured limit. Use your application’s fallback during warmup and abstention.

Plan two storage intervals

Use this template when current dispatch changes the reserve you can draw on next interval. Here the state is a reserve band. The observed step payoff is a relative utility score between -2 and 2, so a scale of 4 covers any difference between successive rewards without clipping.
These rows illustrate the fields to send from a recorded or simulated transition. Collect enough actual or simulated observations per reachable state and action, including projected reward input values. Start a new plan at the measured reserve band with step_reward: 0.0. With this two-step objective, a plan earning rewards 2 and -1 scores better on the objective term than one earning 0 and -1, before constraints. Inspect candidate_sequences to verify that ordering on known transitions. Include and refresh valid transitions for the absorbing below_floor state if it can appear in projected rollouts. Execute the first selected action only, then query again with the actual state. Plan across multiple steps.

Run the Python smoke tests

Set the API base to your authorized deployment and supply its key. The base must include /api/v1.
Save the Python code below as futures_example.py. It uses the standard library. Choose a case and run it from a writable directory.
Each case creates a fresh Domain, sends synthetic observations and prints a PASS line for each successful check. The multi-step case sends 72 transitions and queries between observations. Requests, responses and checks are saved under futures-... in the working directory. The trace excludes authentication headers. After inspecting the results, delete and verify the disposable Domains using their IDs in the requests trace.