pydantic_ai.models.system_one
For details on how to connect to a decision model over the /v1/systemone API, see model configuration for the System One API.
Bases: DecisionModelSettings
Settings used for a System One API request.
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.
The model name.
Type: SystemOneModelName
The system / model provider.
Type: str
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.
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.
@async
def decide(
request: DecisionRequest,
model_settings: DecisionModelSettings,
) -> DecisionResponse
Send one request to the /v1/systemone endpoint.
DecisionResponse
The name the API serves a model under, such as clm-latest.
Default: str