JsonCommandBatch class

Gói lệnh AI → Client (§5.1 protocol).

Constructors

JsonCommandBatch({String version = kProtocolVersion, Map<String, String>? componentVersions, required String responseTo, int round = 1, String aiMessage = '', OnErrorStrategy onError = OnErrorStrategy.abort, required List<MapAction> actions, BatchOrigin? origin, bool contextResync = false, List<Map<String, dynamic>> citations = const [], AgentSession? session, Map<String, dynamic>? usage})
const
JsonCommandBatch.fromJson(Map<String, dynamic> json)
factory

Properties

actions → List<MapAction>
final
aiMessage → String
final
citations → List<Map<String, dynamic>>
Nguồn dẫn trong aiMessage ({sourceId, featureId, label} hoặc {componentIds, label}) — giữ nguyên.
final
componentVersions → Map<String, String>?
componentVersions của gói (components doc 5.6) — version của các loại component command này dùng, theo bản bên soạn viết. null = gói không khai (hợp lệ khi không có action component.*). Chỉ khai báo — engine không rẽ nhánh theo nó; khung chỉ kiểm hình dạng + có mặt (schema).
final
contextResync → bool
true = agent không có inventory cho contextHash vừa nhận (§3.5): client trả [3] cùng round, results: [], meta.inventory: "full", không chạy action nào.
final
effectiveOrigin → BatchOrigin
origin engine sẽ dùng: khai thì theo khai, thiếu thì app.
no setter
hashCode → int
The hash code for this object.
no setterinherited
onError → OnErrorStrategy
final
origin → BatchOrigin?
Batch đến từ đâu (§5.1.1). null = không khai → engine coi là kDefaultBatchOrigin (app). Đường nhận lệnh của AI ghi đè bằng withOrigin — giá trị trong gói chỉ là lời khai của bên gửi.
final
responseTo → String
final
round → int
Vòng thứ mấy của lượt (§9.1.1): 1 cho batch trả lời 1, tăng 1 mỗi 3. Cùng responseTo làm khoá cache idempotency (§9.2). Thiếu = 1.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
session → AgentSession?
Phiên do agent ở xa cấp (§3.6), hoặc null.
final
usage → Map<String, dynamic>?
Token & chi phí của gói này (§4.12) — chỉ đọc để hiển thị, giữ nguyên văn. Sai hình dạng thì bỏ, không bao giờ từ chối batch vì nó (§9.10).
final
version → String
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() → Map<String, dynamic>
toString() → String
A string representation of this object.
inherited
withOrigin(BatchOrigin origin) → JsonCommandBatch
Bản sao với origin ghi đè (§5.1.1 luật 1) — không phải "điền nếu thiếu".

Operators

operator ==(Object other) → bool
The equality operator.
inherited