Skip to main content

synth_ai.sdk.task.contracts

Contracts for Task Apps. Prefer synth_ai.sdk.localapi.contracts moving forward. This module remains for backward compatibility during the naming transition.

Classes

RolloutMode

Mode controls how rollout infrastructure processes inference URLs.

OutputMode

Controls how the policy expects model outputs.
  • TOOL_CALLS: Use function/tool calling (default, current behavior)
  • TEXT: Plain text in message.content
  • STRUCTURED: JSON via response_format (OpenAI json_schema, Groq json_object, Gemini responseSchema)

StructuredOutputConfig

Configuration for structured output mode (OutputMode.STRUCTURED). Defines the JSON schema that the model must conform to when using structured outputs. This is normalized across providers:
  • OpenAI: response_format.json_schema
  • Groq: response_format.json_schema or json_object
  • Gemini: generationConfig.responseSchema

TaskAppEndpoints

Required Task App endpoints used by RL trainers and clients. Task Apps run as lightweight HTTP services (often on Modal) that expose these standard endpoints. Additional endpoints (proxies, debug routes) may be added by individual task apps as needed.

LocalAPIEndpoints

Alias for TaskAppEndpoints with LocalAPI naming.

RolloutEnvSpec

RolloutPolicySpec

RolloutRecordConfig

RolloutSafetyConfig

RolloutRequest

RolloutMetrics

RolloutResponse

Response from a rollout execution (trace-only).

TaskDescriptor

Human-readable task identifiers shown in UIs and logs.

DatasetInfo

Metadata about the prompt/task dataset powering the environment.

RubricCriterion

RubricSection

RubricInfo

Outcome and event scoring definitions used by judges.

InferenceInfo

Recommended defaults for policy model routing.

LimitsInfo

Operational limits the environment enforces.

TaskInfo

Static metadata describing the capabilities of a Task App task.