Document prepared message content hashes

This commit is contained in:
2026-11-20 04:22:33 +00:00
parent 718cd05043
commit 019e077ba9
8 changed files with 82 additions and 35 deletions

View File

@@ -559,12 +559,17 @@ if err != nil {
defer preparedExecution.Discard()
details := preparedExecution.Details()
messageContentHash := details.MessageContentHash
_ = messageContentHash // An opaque value available before model execution.
// Inspect or persist an application-selected safe subset of details.
result, err := engine.RunPrepared(ctx, preparedExecution)
```
Preparation does not call the model or reserve backend capacity.
`MessageContentHash` compares the ordered message roles and text, whereas
`RenderedPromptHash` also includes the session and cache-control hints. See
the [`PreparedRun` GoDoc](../../types.go) for their contracts and compatibility.
`RunPrepared` executes from the retained snapshot rather than reloading
consumer sources. The handle is opaque in-process state, while `Details`
contains rendered content and remains subject to the application's data