pub struct ContextQuery {
pub goal: String,
pub query_text: Option<String>,
pub embedding: Option<Vec<f32>>,
pub kinds: Vec<FrameKind>,
pub anchors: Vec<String>,
pub max_frames: u32,
pub max_tokens: u32,
pub as_of: Option<String>,
pub representation_preferences: Vec<Representation>,
}Expand description
A request to a CGP provider for context frames relevant to a goal.
Fields§
§goal: StringThe task/turn goal driving retrieval.
query_text: Option<String>§embedding: Option<Vec<f32>>§kinds: Vec<FrameKind>§anchors: Vec<String>Anchor URIs (open files, mentioned symbols) used for graph-proximity scoring.
max_frames: u32§max_tokens: u32§as_of: Option<String>Pin retrieval to a point in time for bi-temporal facts.
representation_preferences: Vec<Representation>Ordered frame representation preference. The provider
returns the first supported representation it can satisfy. Empty on the
wire ⇒ the default [full], so pre-representation hosts are unchanged.
Implementations§
Source§impl ContextQuery
impl ContextQuery
Sourcepub fn preferred_representations(&self) -> Vec<Representation>
pub fn preferred_representations(&self) -> Vec<Representation>
The effective ordered representation preference, defaulting to [full]
when the host stated none (the legacy behavior).
Sourcepub fn select_representation(
&self,
supported: &[Representation],
) -> Option<Representation>
pub fn select_representation( &self, supported: &[Representation], ) -> Option<Representation>
The representation a provider should return: the first
preferred one it supports. None ⇒
none of the requested representations is supported and the provider must
answer unsupported_representation.
Trait Implementations§
Source§impl Clone for ContextQuery
impl Clone for ContextQuery
Source§fn clone(&self) -> ContextQuery
fn clone(&self) -> ContextQuery
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ContextQuery
impl Debug for ContextQuery
Source§impl<'de> Deserialize<'de> for ContextQuery
impl<'de> Deserialize<'de> for ContextQuery
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 ContextQuery
impl PartialEq for ContextQuery
Source§impl Serialize for ContextQuery
impl Serialize for ContextQuery
impl StructuralPartialEq for ContextQuery
Auto Trait Implementations§
impl Freeze for ContextQuery
impl RefUnwindSafe for ContextQuery
impl Send for ContextQuery
impl Sync for ContextQuery
impl Unpin for ContextQuery
impl UnsafeUnpin for ContextQuery
impl UnwindSafe for ContextQuery
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