Skip to content

Commit cdbd456

Browse files
authored
Merge pull request #13 from tinyhumansai/runtime-comparison
Runtime comparison
2 parents 24e17cb + ad6571c commit cdbd456

2 files changed

Lines changed: 14 additions & 4 deletions

File tree

‎crates/tinytools/src/result/types.rs‎

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,17 @@ pub struct ToolResult {
5353
/// it reads this field directly and decides how to place it on the wire.
5454
#[serde(default, skip_serializing_if = "Vec::is_empty")]
5555
pub follow_up: Vec<ToolContent>,
56-
/// Host-only metadata: never shown to the model, but available to the host
57-
/// for events, persistence, or telemetry.
56+
/// Host-only metadata: available to the host for events, persistence, or
57+
/// telemetry, but never *included in the model-facing rendering*
58+
/// ([`Self::text`], [`Self::output`], [`Self::output_for_llm`]).
59+
///
60+
/// This field still round-trips through [`Serialize`]/[`Deserialize`],
61+
/// the same as every other field, because that is what lets a host
62+
/// persist the complete `ToolResult` to a transcript, RPC reply, or JSONL
63+
/// session record. A host that builds a model-facing message must use
64+
/// one of the rendering methods above (or otherwise construct the
65+
/// message deliberately) rather than serializing this struct wholesale
66+
/// and sending the JSON to the model, or it will leak this field.
5867
#[serde(default, skip_serializing_if = "Option::is_none")]
5968
pub metadata: Option<serde_json::Value>,
6069
/// Loop-control hints a harness may honour, such as ending the loop

‎docs/specs/tinytools-vocabulary.md‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -149,8 +149,9 @@ this section specifies the additions below. All are additive to the wire shape
149149
see "Versioning" — so they shipped as a `0.2.0` → `0.3.0` minor bump.
150150

151151
- **`ToolContent::Image` / `ToolContent::File`** extend the block-list result
152-
with image and file blocks (`ImageData` / `FileData`, each `Base64`, `Url`,
153-
or `Path`), alongside the existing `Text` and `Json` blocks.
152+
with image and file blocks (`ImageData` supports `Base64` and `Url`, while
153+
`FileData` also supports `Path`), alongside the existing `Text` and `Json`
154+
blocks.
154155
- **`ToolResult::follow_up: Vec<ToolContent>`** carries content a caller should
155156
present to the model as a *separate* message after the tool result — a
156157
screenshot or document the next turn should read — rather than folding it

0 commit comments

Comments
 (0)