pub struct TurnContext {
pub sent: Option<Instant>,
pub attachments: usize,
pub delta_received: bool,
pub model: Option<String>,
pub effort: Option<String>,
pub submitted: Arc<Vec<String>>,
}Expand description
What the runtime knows about the turn that is running, or about the chat when no turn runs.
Fields§
§sent: Option<Instant>When the turn was sent; None while no turn runs.
attachments: usizeContext references and images sent with the turn, steering included.
delta_received: boolWhether any reply or reasoning text arrived.
model: Option<String>§effort: Option<String>§submitted: Arc<Vec<String>>The texts the turn sent: the message and each context item. They are kept only to remove them from what a failure shows or logs.
Implementations§
Source§impl TurnContext
impl TurnContext
Sourcepub fn begin(&mut self, attachments: usize, submitted: Vec<String>)
pub fn begin(&mut self, attachments: usize, submitted: Vec<String>)
A new turn. The chat’s model and effort carry over.
Sourcepub fn steer(&mut self, attachments: usize, submitted: Vec<String>)
pub fn steer(&mut self, attachments: usize, submitted: Vec<String>)
A steering message joins the running turn with its attachments.
Sourcepub fn resume(&mut self)
pub fn resume(&mut self)
The runtime went on with a turn the watchdog had ended: the same message, timed from now.
Sourcepub fn observe(&mut self, event: &Value)
pub fn observe(&mut self, event: &Value)
Takes what one SDK event says about the turn: whether text arrived, and the model and effort Copilot used or switched to.
Trait Implementations§
Source§impl Clone for TurnContext
impl Clone for TurnContext
Source§impl Debug for TurnContext
impl Debug for TurnContext
Source§impl Default for TurnContext
impl Default for TurnContext
impl Eq for TurnContext
Source§impl PartialEq for TurnContext
impl PartialEq for TurnContext
impl StructuralPartialEq for TurnContext
Auto Trait Implementations§
impl Forget for TurnContext
impl Freeze for TurnContext
impl Move for TurnContext
impl RefUnwindSafe for TurnContext
impl Send for TurnContext
impl Sync for TurnContext
impl Unpin for TurnContext
impl UnsafeUnpin for TurnContext
impl UnwindSafe for TurnContext
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
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
Compare self to
key and return true if they are equal.