Skip to content

IdleStateUpdate

Base classes

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

⋔ Inheritance diagram

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

🛈 DocStrings

Bases: AnnotatedObject

UNSTABLE: The child is ready to process another prompt.

Source code in src/aclientp/schema/session_updates.py
class IdleStateUpdate(AnnotatedObject):
    """**UNSTABLE**: The child is ready to process another prompt."""

    state: Literal["idle"] = Field(default="idle", init=False)

    stop_reason: (
        Literal["end_turn", "max_tokens", "max_turn_requests", "refusal", "cancelled", "error"]
        | str
        | None
    ) = None
    """Why foreground work stopped. Omitted when there is no stop reason."""

    error: Error | None = None
    """For ``stop_reason: "error"``: the failure, as a JSON-RPC error object."""

    usage: Usage | None = None
    """Token usage for completed foreground work."""

error class-attribute instance-attribute

error: Error | None = None

For stop_reason: "error": the failure, as a JSON-RPC error object.

stop_reason class-attribute instance-attribute

stop_reason: (
    Literal["end_turn", "max_tokens", "max_turn_requests", "refusal", "cancelled", "error"]
    | str
    | None
) = None

Why foreground work stopped. Omitted when there is no stop reason.

usage class-attribute instance-attribute

usage: Usage | None = None

Token usage for completed foreground work.

:fa-brands-github: Show source on GitHub