Skip to content

pydantic_ai.models.system_one

Setup

For details on how to connect to a decision model over the /v1/systemone API, see model configuration for the System One API.

SystemOneModelSettings

Bases: DecisionModelSettings

Settings used for a System One API request.

SystemOneModel

Bases: AsyncClient]

The model class for decision models served over the /v1/systemone API.

Decision models such as Contrastive Language Models and Laya are available over this API, and an agent whose job is to decide something runs on one like on any other model, with the output_type as the questions:

from pydantic import BaseModel, Field

from pydantic_ai import Agent


class Handling(BaseModel):
    irreversible: bool = Field(description='Would running this destroy data or leak secrets?')


agent = Agent('system-one:clm-latest', output_type=Handling)
...

See Decision models for how an agent’s output type and tools become questions, and System One API for connecting to one.

Apart from __init__, all methods are private or match those of the base class.

Attributes

model_name

The model name.

Type: SystemOneModelName

system

The system / model provider.

Type: str

Methods

__init__
def __init__(
    model_name: SystemOneModelName,
    *,
    provider: Literal['system-one'] | SystemOneProvider = 'system-one',
    profile: ModelProfileSpec | None = None,
    settings: ModelSettings | None = None,
)

Initialize a System One model.

Parameters

model_name : SystemOneModelName

The name the API serves the model under, such as clm-latest.

provider : Literal[‘system-one’] | SystemOneProvider Default: 'system-one'

The provider to use for the API’s URL and key.

profile : ModelProfileSpec | None Default: None

The model profile to use. Defaults to one selected by the provider.

settings : ModelSettings | None Default: None

Model-specific settings used as defaults for this model.

decide

@async

def decide(
    request: DecisionRequest,
    model_settings: DecisionModelSettings,
) -> DecisionResponse

Send one request to the /v1/systemone endpoint.

Returns

DecisionResponse

SystemOneModelName

The name the API serves a model under, such as clm-latest.

Default: str