pub struct ContextQueryResult {
pub frames: Vec<ContextFrame>,
pub truncated: bool,
pub dropped_estimate: Option<u32>,
}Expand description
The response to a context/query call.
Fields§
§frames: Vec<ContextFrame>§truncated: boolTrue if the provider had more candidates than fit the budget.
dropped_estimate: Option<u32>Implementations§
Source§impl ContextQueryResult
impl ContextQueryResult
Sourcepub fn total_token_cost(&self) -> u64
pub fn total_token_cost(&self) -> u64
Sum of token_cost across returned frames — must never exceed the
query’s max_tokens for a conforming provider (checked in
ocp-conformance, phase 3; this is the cheap client-side sanity
check any host can run today).
pub fn respects_budget(&self, max_tokens: u32) -> bool
Trait Implementations§
Source§impl Clone for ContextQueryResult
impl Clone for ContextQueryResult
Source§impl Debug for ContextQueryResult
impl Debug for ContextQueryResult
Source§impl<'de> Deserialize<'de> for ContextQueryResult
impl<'de> Deserialize<'de> for ContextQueryResult
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for ContextQueryResult
impl PartialEq for ContextQueryResult
Source§impl Serialize for ContextQueryResult
impl Serialize for ContextQueryResult
impl StructuralPartialEq for ContextQueryResult
Auto Trait Implementations§
impl Freeze for ContextQueryResult
impl RefUnwindSafe for ContextQueryResult
impl Send for ContextQueryResult
impl Sync for ContextQueryResult
impl Unpin for ContextQueryResult
impl UnsafeUnpin for ContextQueryResult
impl UnwindSafe for ContextQueryResult
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
Mutably borrows from an owned value. Read more