pub struct PromptCacheKey {
pub schema_version: String,
pub dialect: SqlDialect,
pub policy_hash: u64,
pub table_hash: u64,
}Expand description
Key used to identify a cached system prompt.
The key captures the schema version, the SQL dialect, a hash of
the policy configuration, and a hash of the relevant table set.
Two PromptBuilder instances with the same key produce the same
prompt string.
Fields§
§schema_version: StringSchema version string (e.g. "v1.2.3").
dialect: SqlDialectTarget SQL dialect.
policy_hash: u6464-bit hash of the policy configuration.
table_hash: u6464-bit hash of the relevant table names selected for this question.
Implementations§
Source§impl PromptCacheKey
impl PromptCacheKey
Sourcepub fn new(
schema_version: &str,
dialect: &DialectProfile,
policy_hash: u64,
table_hash: u64,
) -> Self
pub fn new( schema_version: &str, dialect: &DialectProfile, policy_hash: u64, table_hash: u64, ) -> Self
Creates a new key from the builder’s parameters.
policy_hash should be computed with hash_policy so that any
change to the policy (table allowlists, denied columns, row filters)
produces a different key. table_hash captures which tables are
relevant to the user question, so different questions that match
different table sets produce different cache entries.
Trait Implementations§
Source§impl Clone for PromptCacheKey
impl Clone for PromptCacheKey
Source§fn clone(&self) -> PromptCacheKey
fn clone(&self) -> PromptCacheKey
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for PromptCacheKey
impl Debug for PromptCacheKey
impl Eq for PromptCacheKey
Source§impl Hash for PromptCacheKey
impl Hash for PromptCacheKey
Source§impl PartialEq for PromptCacheKey
impl PartialEq for PromptCacheKey
impl StructuralPartialEq for PromptCacheKey
Auto Trait Implementations§
impl Freeze for PromptCacheKey
impl RefUnwindSafe for PromptCacheKey
impl Send for PromptCacheKey
impl Sync for PromptCacheKey
impl Unpin for PromptCacheKey
impl UnsafeUnpin for PromptCacheKey
impl UnwindSafe for PromptCacheKey
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request