SAMBudget
smarter.models.sam.budget
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
Bases:
smarter.models.sam.base.SAMModelSmarter API Budget Manifest - Metadata class.
- annotations: None | list[dict[str, str | int | float | bool | datetime.date | datetime.datetime | Annotated[str, StringConstraints(strip_whitespace=None, to_upper=None, to_lower=None, strict=None, min_length=None, max_length=None, pattern='^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$')] | uuid.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.
- class smarter.models.sam.budget.Action
Bases:
enum.EnumBudget.spec.config.action: block further charges when a limit is reached, or only warn.
- class smarter.models.sam.budget.Period
Bases:
enum.EnumBudget.spec.config.period: the billing period of periodicLimit and duration.
- class smarter.models.sam.budget.Unit
Bases:
enum.EnumBudget.spec.config.unit: what the limits measure: cost in USD, or total tokens.
- class smarter.models.sam.budget.SAMBudgetSpecConfig
Bases:
smarter.models.sam.base.SAMModelSmarter API Budget Manifest Budget.spec.config: the budget’s limits.
- absoluteLimit: Union
Budget.spec.config.absoluteLimit: the most that may be spent in total, from when the budget is attached.
0 means no limit.
- action: smarter.models.sam.budget.Action | None
Budget.spec.config.action: block further charges when a limit is reached, or only warn.
- duration: Optional
Budget.spec.config.duration: the billing periods, from when the budget is attached, after which it no longer applies.
0 means never.
- message: Optional
Budget.spec.config.message: what people are told when the budget blocks their request.
Defaults to a description of the limit that was reached.
- period: smarter.models.sam.budget.Period | None
Budget.spec.config.period: the billing period of periodicLimit and duration.
- periodicLimit: Union
Budget.spec.config.periodicLimit: the most that may be spent in a billing period.
0 means no limit.
- unit: smarter.models.sam.budget.Unit | None
Budget.spec.config.unit: what the limits measure: cost in USD, or total tokens.
- warningThreshold: Optional
Budget.spec.config.warningThreshold: the percentage of a limit at which a warning is sent.
0 means never.
- class smarter.models.sam.budget.Kind
Bases:
enum.EnumBudget.spec.resources.kind: the resource’s manifest kind, e.g. LLMClient.
- class smarter.models.sam.budget.SAMBudgetSpecResource
Bases:
smarter.models.sam.base.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.
- kind: smarter.models.sam.budget.Kind | None
Budget.spec.resources.kind: the resource’s manifest kind, e.g. LLMClient.
- class smarter.models.sam.budget.SAMBudgetStatusResource
Bases:
smarter.models.sam.base.SAMModelThe budget versus the actual spending of one of the budget’s resources.
Read only.
- absoluteActual: Union
Budget.status.resources.absoluteActual: spending since startDate.
- absolutePercent: float | None
Budget.status.resources.absolutePercent: absoluteActual, as a percentage of the limit.
- expiresAt: datetime.datetime | None
Budget.status.resources.expiresAt: when the budget’s duration ends.
- periodicActual: Union
Budget.status.resources.periodicActual: spending this billing period.
- 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
Bases:
smarter.models.sam.base.SAMModelA resource that depends on the resource that a manifest describes.
- class smarter.models.sam.budget.SAMBudgetSpec
Bases:
smarter.models.sam.base.SAMModelSmarter API Budget Manifest Budget.spec.
- config: SAMBudgetSpecConfig
Budget.spec.config[object].
The limits of the Budget.
- resources: list[smarter.models.sam.budget.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
Bases:
smarter.models.sam.base.SAMModelSmarter API Budget Manifest - Status class.
Read only.
- created: datetime
The date in which this resource was created.
Read only.
- dependencies: list[smarter.models.sam.budget.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[smarter.models.sam.budget.SAMBudgetStatusResource] | None
Budget.status.resources: the budget versus the actual spending of each resource.
Read only.
- class smarter.models.sam.budget.SAMBudget
Bases:
smarter.models.sam.base.SAMModelSmarter API Manifest - Budget.
- metadata: SAMBudgetMetadata
Budget.metadata[obj]: Required, the Budget metadata.
- spec: SAMBudgetSpec
Budget.spec[obj]: Required, the Budget specification.
- status: smarter.models.sam.budget.SAMBudgetStatus | None
Budget.status[obj]: Optional, Read-only.
Stateful status information about the Budget.