SAMBudget
SAM model of the Budget kind, generated from the Smarter platform’s JSON Schema.
Do not edit: run scripts/generate_sam_models.py. See smarter.models.sam.
- class smarter.models.sam.budget.SAMBudgetMetadata(*, annotations: None | list[dict[str, str | int | float | bool | date | datetime | UUID | bytes | list | dict[str, Any]]] = None, description: str | None, name: str, tags: list[str] | None = None, version: str | None, **extra_data: Any)[source]
Bases:
SAMModelSmarter API Budget Manifest - Metadata class.
- annotations: None | list[dict[str, str | int | float | bool | date | datetime | UUID | bytes | list | dict[str, Any]]]
The manifest annotations.
- Used for storing arbitrary metadata as
key-value pairs. Example: [{‘smarter.sh/test-manifest/project-name’: ‘Scooby dooby do’}]. The key should be a valid url-friendly string. The value accepts multi-line string values (YAML block scalars) and various scalar types including str, int, float, bool, datetime.date, datetime.datetime, decimal.Decimal, uuid.UUID, bytes, list, dict.
- tags: list[str] | None
The tags of the manifest.
Used for generic resource categorization and search. Example: [‘tag1’, ‘tag2’]
- model_config = {'extra': 'allow', 'populate_by_name': True, 'protected_namespaces': (), 'regex_engine': 'python-re', 'use_attribute_docstrings': True}
Configuration for the model, should be a dictionary conforming to [`ConfigDict`][pydantic.config.ConfigDict].
- class smarter.models.sam.budget.Action(*values)[source]
Bases:
EnumBudget.spec.config.action: block further charges when a limit is reached, or only warn.
- class smarter.models.sam.budget.Period(*values)[source]
Bases:
EnumBudget.spec.config.period: the billing period of periodicLimit and duration.
- class smarter.models.sam.budget.Unit(*values)[source]
Bases:
EnumBudget.spec.config.unit: what the limits measure: cost in USD, or total tokens.
- class smarter.models.sam.budget.SAMBudgetSpecConfig(*, absoluteLimit: Annotated[float, None, Interval(gt=None, ge=0.0, lt=None, le=None), None, None] | str | None = '0', action: Action | None = 'block', duration: Annotated[int, None, Interval(gt=None, ge=0, lt=None, le=None), None] | None = 0, message: Annotated[str, StringConstraints(strip_whitespace=None, to_upper=None, to_lower=None, strict=None, min_length=None, max_length=1000, pattern=None, ascii_only=None)] | None = None, period: Period | None = 'month', periodicLimit: Annotated[float, None, Interval(gt=None, ge=0.0, lt=None, le=None), None, None] | str | None = '0', unit: Unit | None = 'cost', warningThreshold: Annotated[int, None, Interval(gt=None, ge=0, lt=None, le=100), None] | None = 80, **extra_data: Any)[source]
Bases:
SAMModelSmarter API Budget Manifest Budget.spec.config: the budget’s limits.
- absoluteLimit: confloat(ge=0.0) | str | None
Budget.spec.config.absoluteLimit: the most that may be spent in total, from when the budget is attached.
0 means no limit.
- action: Action | None
Budget.spec.config.action: block further charges when a limit is reached, or only warn.
- duration: conint(ge=0) | None
Budget.spec.config.duration: the billing periods, from when the budget is attached, after which it no longer applies.
0 means never.
- message: constr(max_length=1000) | None
Budget.spec.config.message: what people are told when the budget blocks their request.
Defaults to a description of the limit that was reached.
- periodicLimit: confloat(ge=0.0) | str | None
Budget.spec.config.periodicLimit: the most that may be spent in a billing period.
0 means no limit.
- warningThreshold: conint(ge=0, le=100) | None
Budget.spec.config.warningThreshold: the percentage of a limit at which a warning is sent.
0 means never.
- model_config = {'extra': 'allow', 'populate_by_name': True, 'protected_namespaces': (), 'regex_engine': 'python-re', 'use_attribute_docstrings': True}
Configuration for the model, should be a dictionary conforming to [`ConfigDict`][pydantic.config.ConfigDict].
- class smarter.models.sam.budget.Kind(*values)[source]
Bases:
EnumBudget.spec.resources.kind: the resource’s manifest kind, e.g. LLMClient.
- class smarter.models.sam.budget.SAMBudgetSpecResource(*, accountNumber: str | None = None, kind: Kind | None = None, name: str | None = None, recordLocator: str | None = None, **extra_data: Any)[source]
Bases:
SAMModelSmarter API Budget Manifest Budget.spec.resources[]: a resource that the budget is enforced on.
Either kind and name, with an optional accountNumber, or a recordLocator.
- accountNumber: str | None
Budget.spec.resources.accountNumber: the account that the resource belongs to.
Defaults to your own.
- name: str | None
Budget.spec.resources.name: the resource’s name.
For an Account, its account number; for a User, the username.
- recordLocator: str | None
Budget.spec.resources.recordLocator: any resource’s record locator, e.g. llmclient-rc2x, in place of kind and name.
- model_config = {'extra': 'allow', 'populate_by_name': True, 'protected_namespaces': (), 'regex_engine': 'python-re', 'use_attribute_docstrings': True}
Configuration for the model, should be a dictionary conforming to [`ConfigDict`][pydantic.config.ConfigDict].
- class smarter.models.sam.budget.SAMBudgetStatusResource(*, absoluteActual: float | str, absolutePercent: float | None = None, expiresAt: datetime | None = None, isActive: bool, isLocked: bool, lockReason: str | None = None, periodicActual: float | str, periodicPercent: float | None = None, recordLocator: str, startDate: datetime, **extra_data: Any)[source]
Bases:
SAMModelThe budget versus the actual spending of one of the budget’s resources.
Read only.
- absolutePercent: float | None
Budget.status.resources.absolutePercent: absoluteActual, as a percentage of the limit.
- model_config = {'extra': 'allow', 'populate_by_name': True, 'protected_namespaces': (), 'regex_engine': 'python-re', 'use_attribute_docstrings': True}
Configuration for the model, should be a dictionary conforming to [`ConfigDict`][pydantic.config.ConfigDict].
- periodicPercent: float | None
Budget.status.resources.periodicPercent: periodicActual, as a percentage of the limit.
- startDate: datetime
Budget.status.resources.startDate: when the budget was attached.
- class smarter.models.sam.budget.SAMDependency(*, kind: str, name: str, **extra_data: Any)[source]
Bases:
SAMModelA resource that depends on the resource that a manifest describes.
- model_config = {'extra': 'allow', 'populate_by_name': True, 'protected_namespaces': (), 'regex_engine': 'python-re', 'use_attribute_docstrings': True}
Configuration for the model, should be a dictionary conforming to [`ConfigDict`][pydantic.config.ConfigDict].
- class smarter.models.sam.budget.SAMBudgetSpec(*, config: SAMBudgetSpecConfig, resources: Annotated[list[SAMBudgetSpecResource] | None, MaxLen(max_length=1000)] = None, **extra_data: Any)[source]
Bases:
SAMModelSmarter API Budget Manifest Budget.spec.
- model_config = {'extra': 'allow', 'populate_by_name': True, 'protected_namespaces': (), 'regex_engine': 'python-re', 'use_attribute_docstrings': True}
Configuration for the model, should be a dictionary conforming to [`ConfigDict`][pydantic.config.ConfigDict].
- config: SAMBudgetSpecConfig
Budget.spec.config[object].
The limits of the Budget.
- resources: list[SAMBudgetSpecResource] | None
Budget.spec.resources[list].
The resources that the Budget is enforced on. Resources that are removed from the list are detached.
- class smarter.models.sam.budget.SAMBudgetStatus(*, created: datetime, dependencies: list[SAMDependency] | None = None, modified: datetime, recordLocator: str, resources: list[SAMBudgetStatusResource] | None = None, **extra_data: Any)[source]
Bases:
SAMModelSmarter API Budget Manifest - Status class.
Read only.
- model_config = {'extra': 'allow', 'populate_by_name': True, 'protected_namespaces': (), 'regex_engine': 'python-re', 'use_attribute_docstrings': True}
Configuration for the model, should be a dictionary conforming to [`ConfigDict`][pydantic.config.ConfigDict].
- created: datetime
The date in which this resource was created.
Read only.
- dependencies: list[SAMDependency] | None
Dependencies[List]: The resources that depend on this resource, and that must be deleted, or stop referring to it, before it can be deleted.
Lists only the resources that you can read. Read only.
- modified: datetime
The date in which this resource was most recently changed.
Read only.
- recordLocator: str
RecordLocator[String]: An optional identifier used to locate the resource record associated with this manifest.
Read only.
- resources: list[SAMBudgetStatusResource] | None
Budget.status.resources: the budget versus the actual spending of each resource.
Read only.
- class smarter.models.sam.budget.SAMBudget(*, apiVersion: str, kind: str, metadata: SAMBudgetMetadata, spec: SAMBudgetSpec, status: SAMBudgetStatus | None = None, **extra_data: Any)[source]
Bases:
SAMModelSmarter API Manifest - Budget.
- model_config = {'extra': 'allow', 'populate_by_name': True, 'protected_namespaces': (), 'regex_engine': 'python-re', 'use_attribute_docstrings': True}
Configuration for the model, should be a dictionary conforming to [`ConfigDict`][pydantic.config.ConfigDict].
- metadata: SAMBudgetMetadata
Budget.metadata[obj]: Required, the Budget metadata.
- spec: SAMBudgetSpec
Budget.spec[obj]: Required, the Budget specification.
- status: SAMBudgetStatus | None
Budget.status[obj]: Optional, Read-only.
Stateful status information about the Budget.