SystemOneBinding

@ApiStatus.Experimental
interface SystemOneBinding

How an endpoint exposes System One over HTTP. The protocol's own layout is STANDARD: decisions at /v1/systemone, the model name sent as given, the response body as the System One response, and models listed at /v1/models. A hosting API that puts the model in the path or wraps responses in its own envelope overrides the methods that differ.

Types

Link copied to clipboard
object Companion

Functions

Link copied to clipboard
open fun check(model: String, request: DecisionRequest)

Checks a request before the key is read or anything is sent. The standard binding accepts every request.

Link copied to clipboard
open fun decisionRequest(model: String, request: DecisionRequest): ByteArray

Returns the request body for a model's question set. The standard body is the System One request with the model name as given.

Link copied to clipboard

Returns the System One response inside a successful response body.

Link copied to clipboard
open fun decisionUri(endpoint: SystemOneEndpoint, model: String): URI

Returns where to send a model's question sets.

Link copied to clipboard
open fun modelNames(body: ByteArray): List<String>

Reads the model names from a successful listing body.

Link copied to clipboard
open fun modelsUri(endpoint: SystemOneEndpoint): URI

Returns where the endpoint lists its models.

Link copied to clipboard
open fun validateModel(model: String)

Checks a model name when a service is built for it, so a name the endpoint can never serve fails at once. The standard binding accepts every name and lets the endpoint decide.