pub struct PrefixFingerprint {
pub system_sha256: String,
pub tools_sha256: String,
pub combined_sha256: String,
}Expand description
A snapshot of the immutable prefix’s fingerprint.
Matching hashes show stable system text and the normalized OpenAI-style tool catalog. They do not measure provider cache hits or fingerprint every provider-specific wire transformation; request replay tests cover those.
Fields§
§system_sha256: StringSHA-256 of the system prompt text.
tools_sha256: StringSHA-256 of the full tool catalog JSON (names, descriptions, schemas).
combined_sha256: StringSHA-256 of system_sha256 ++ tools_sha256 (combined).
Implementations§
Source§impl PrefixFingerprint
impl PrefixFingerprint
Sourcepub fn compute_with_tool_cache(
system_text: &str,
tools: Option<&[Tool]>,
cache: &mut ToolCatalogCache,
) -> Self
pub fn compute_with_tool_cache( system_text: &str, tools: Option<&[Tool]>, cache: &mut ToolCatalogCache, ) -> Self
Compute a fingerprint while reusing a ToolCatalogCache for the
tool-side work. The cache holds the joined+SHA-256’d catalog
under a content-derived identity so the per-tool JSON serialization
and the join only run on the first call for a given tool set.
On a cache hit this function avoids the entire tool serialization path, which can be 100+ microseconds for a 60-tool catalog.
Trait Implementations§
Source§impl Clone for PrefixFingerprint
impl Clone for PrefixFingerprint
Source§fn clone(&self) -> PrefixFingerprint
fn clone(&self) -> PrefixFingerprint
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more