Unreleased
Generated from the docstrings of Tau 0.16.0-dev (commit c439c401) by scripts/api_docs.py in the Tau repository. Not the 0.15 API.
Events¶
What a client's stream yields.
Names: Appended, CallArgs, CallNamed, CursorGone, CursorView, CutOff, Delta, Event, HookFailure, Labels, Live, LiveDelta, Notice, OpenQuestion, Retrying, TextDelta, ThinkingDelta, ToolProgress
Appended¶
@dataclass(frozen=True)
class Appended
nodes: tuple[Node, ...]
Nodes added to the tree, in id order, bodies included.
CallArgs¶
@dataclass(frozen=True)
class CallArgs
index: int
text: str
More of call index's argument text (args_raw).
CallNamed¶
@dataclass(frozen=True)
class CallNamed
index: int
id: str
tool: str
A call begins forming: call number index in this reply, with its id and tool.
CursorGone¶
@dataclass(frozen=True)
class CursorGone
cursor: int
at: int
Cursor cursor is closed (D17): a client drops its view of it. at is the node it was
last at, for restarting (reopen). A cursor has one state event at a time: its CursorView
while open, this after it closes. Labels may still name it: they are its restart record.
CursorView¶
@dataclass(frozen=True)
class CursorView
cursor: int
at: int
busy: bool
auto: bool
questions: tuple[OpenQuestion, ...]
items: tuple[Item, ...]
ending: Ending | None
hook_error: HookFailure | None
model: str | None
shown: tuple[tuple[str, str], ...]
One cursor as a client sees it, whole: where it is (at), whether a step is running
(busy), auto-step, its open questions (oldest first), its pending items (an
ItemData.Input says who wrote it: its by), and how its last step ended (ending) with the
hook_error that ended it, if a cursor hook failed in
it. Both are None from the start of a step until it ends, and after a reload. model is the
qualified name of the model the cursor's branch is on (what its next sample uses), None if
no Config on the branch names one or one is unreadable (a sample says which). shown is
what each extension shows on the cursor (Cursor.show), as (extension, text) pairs in
extension-name order; it is not in the log, so it is empty after a reload.
CutOff¶
class CutOff(ConnectionError)
The stream of a client that fell too far behind ended: its Appended and Notice backlog
passed the buffer. Like every stream that ends in error, it is a ConnectionError: connect
again for a fresh snapshot.
Delta¶
Delta = TextDelta | ThinkingDelta | CallNamed | CallArgs | Retrying
What a provider yields while a part is still arriving, and Retrying while it waits to try
again.
Event¶
Event = Live | CursorView | CursorGone | Labels | Appended | Notice
Everything a Client's stream yields: a live event (never saved) or one of the saved ones.
HookFailure¶
@dataclass(frozen=True)
class HookFailure
extension: str
point: str
error: str
A cursor hook of extension raised, or broke its contract, at hook point
("pre_step", "post_step", ...). error is "Type: msg", the text a post_step hook
sees in Ending.Failed.
Labels¶
@dataclass(frozen=True)
class Labels
labels: tuple[tuple[str, int], ...]
Every label and the cursor it is on, in label order.
Live¶
@dataclass(frozen=True)
class Live
cursor: int
delta: LiveDelta
A delta, on the cursor whose sample or tool call produced it. Never in the tree: a client draws it as a layer over the cursor. Only a client watching the cursor hears it.
LiveDelta¶
LiveDelta = Delta | ToolProgress
What a Live carries: a provider's delta, or a tool's progress.
Notice¶
@dataclass(frozen=True)
class Notice
text: str
A message for one client, or for all of them: cursor.tell (to every client unless it
names one), or an input a hook refused (to its author).
OpenQuestion¶
@dataclass(frozen=True)
class OpenQuestion
id: int
to: str | None
extension: str
text: str
schema: Json
A question an extension asked and nobody has answered: id (what answer names), whom
it is for (to: a client id, None for anyone), the extension that asked, what it asks,
and the JSON Schema of the answer.
Retrying¶
@dataclass(frozen=True)
class Retrying
attempt: int
attempts: int
seconds: float
reason: str
A provider is waiting to try the sample again (D24 section 4): this is retry attempt of
attempts, after seconds, because the last try failed with reason. It is no part of the
reply and is never replayed to a client that starts watching later: it says what the sample
is doing now, and the next delta (or the end of the sample) replaces it.
TextDelta¶
@dataclass(frozen=True)
class TextDelta
text: str
Text of the reply arriving.
ThinkingDelta¶
@dataclass(frozen=True)
class ThinkingDelta
text: str
Thinking text arriving.
ToolProgress¶
@dataclass(frozen=True)
class ToolProgress
node: int
call_id: str
text: str
A running call showing partial output: text is new output since the last
ToolProgress of the same call, not the whole so far. The call is named by node, the
batch's node (the Assistant node holding the call), and call_id: a server may reuse
ids across batches, so the id alone does not say which call. Only the driver makes one (a
tool calls its progress); a provider cannot yield one. What the call saves is its
Outcome, never this.