pub struct ResponsesContinuationStore { /* private fields */ }Expand description
Session-scoped store of provider continuation chains.
One owner for the chain key, response-id, and history semantics so the interactive runloop and the headless runner cannot drift apart.
Implementations§
Source§impl ResponsesContinuationStore
impl ResponsesContinuationStore
Sourcepub fn get(
&self,
provider: &str,
model: &str,
) -> Option<&ResponsesContinuationState>
pub fn get( &self, provider: &str, model: &str, ) -> Option<&ResponsesContinuationState>
The recorded chain for a provider and model, if any.
Sourcepub fn set(
&mut self,
provider: &str,
model: &str,
response_id: Option<&str>,
messages: Arc<Vec<Message>>,
)
pub fn set( &mut self, provider: &str, model: &str, response_id: Option<&str>, messages: Arc<Vec<Message>>, )
Record a chain, or drop the existing one when the response id is empty.
Sourcepub fn clear_for(&mut self, provider: &str, model: &str)
pub fn clear_for(&mut self, provider: &str, model: &str)
Drop the chain recorded for one provider and model.
Sourcepub fn prepare_request_messages<'a>(
&mut self,
provider_name: &str,
provider_supports_responses_compaction: bool,
model: &str,
messages: &'a [Message],
) -> (Cow<'a, [Message]>, Option<String>)
pub fn prepare_request_messages<'a>( &mut self, provider_name: &str, provider_supports_responses_compaction: bool, model: &str, messages: &'a [Message], ) -> (Cow<'a, [Message]>, Option<String>)
Prepare request messages for a continuation-aware provider.
A stale chain that the provider rejects is dropped here so the next request starts from the full history.
Trait Implementations§
Source§impl Clone for ResponsesContinuationStore
impl Clone for ResponsesContinuationStore
Source§impl Debug for ResponsesContinuationStore
impl Debug for ResponsesContinuationStore
Auto Trait Implementations§
impl Freeze for ResponsesContinuationStore
impl RefUnwindSafe for ResponsesContinuationStore
impl Send for ResponsesContinuationStore
impl Sync for ResponsesContinuationStore
impl Unpin for ResponsesContinuationStore
impl UnsafeUnpin for ResponsesContinuationStore
impl UnwindSafe for ResponsesContinuationStore
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
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<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
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> 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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more