pub enum RagCommand {
Ask {
id: RequestId,
prompt: String,
retrieval: Option<String>,
attachments: Vec<PendingAttachment>,
},
Stop {
id: RequestId,
},
NewSession,
LoadSession {
id: String,
},
RefreshSessions,
RefreshLibrary,
SyncCorpus {
id: RequestId,
name: String,
folder: PathBuf,
},
StopSync {
id: RequestId,
},
Apply {
setup: Box<RagSetup>,
},
}Expand description
Work sent from the UI to the Ragrig worker.
Variants§
Ask
Ask one question, with one-shot context attachments.
Fields
id: RequestIdCorrelates RagEvent::Started, chunks, and the final event.
retrieval: Option<String>Text prepended to prompt before it is embedded and searched.
This is how a host “enriches” a question with the passage the
author marked: retrieval then runs on both the passage and the
question. The worker also sends the combined text to the model, so
it sees the passage; the host transcript keeps echoing only
prompt.
attachments: Vec<PendingAttachment>Context that is merged into this prompt only.
Stop
Stop a running generation. The partial answer is kept.
NewSession
Start an empty conversation.
LoadSession
Continue a saved conversation.
Fields
id: StringSession id from RagEvent::Sessions.
RefreshSessions
Re-read the session store.
RefreshLibrary
Re-read the vector store’s document list.
SyncCorpus
Incrementally index a folder as a named corpus.
Fields
StopSync
Stop a running ingestion.
Apply
Rebuild the agent with new configuration.
Trait Implementations§
Source§impl Clone for RagCommand
impl Clone for RagCommand
Auto Trait Implementations§
impl Freeze for RagCommand
impl RefUnwindSafe for RagCommand
impl Send for RagCommand
impl Sync for RagCommand
impl Unpin for RagCommand
impl UnsafeUnpin for RagCommand
impl UnwindSafe for RagCommand
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<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>
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>
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)
&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)
&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> 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> ⓘ
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> ⓘ
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