Skip to content

UsageUpdate

Base classes

Name Children Inherits
AnnotatedObject
aclientp.schema.base
Base class for generated models.

⋔ Inheritance diagram

graph TD
  95970848371072["session_updates.UsageUpdate"]
  95970862258240["base.AnnotatedObject"]
  95970862254416["base.Schema"]
  95970851503232["main.BaseModel"]
  125067848591872["builtins.object"]
  95970862258240 --> 95970848371072
  95970862254416 --> 95970862258240
  95970851503232 --> 95970862254416
  125067848591872 --> 95970851503232

🛈 DocStrings

Bases: AnnotatedObject

Context window and cost update for a session.

Source code in src/aclientp/schema/session_updates.py
class UsageUpdate(AnnotatedObject):
    """Context window and cost update for a session."""

    session_update: Literal["usage_update"] = Field(default="usage_update", init=False)

    used: int = Field(ge=0)
    """Tokens currently in context."""

    size: int = Field(ge=0)
    """Total context window size in tokens."""

    cost: Cost | None = None
    """Cumulative session cost (optional)."""

cost class-attribute instance-attribute

cost: Cost | None = None

Cumulative session cost (optional).

size class-attribute instance-attribute

size: int = Field(ge=0)

Total context window size in tokens.

used class-attribute instance-attribute

used: int = Field(ge=0)

Tokens currently in context.

:fa-brands-github: Show source on GitHub