pub struct Question {
pub action: Action,
pub text: String,
pub item: Option<String>,
pub revision: Option<String>,
pub change: Option<String>,
pub allow_drafts: bool,
pub page: PageContext,
pub history: Vec<(String, String)>,
pub thread: bool,
pub limits: String,
pub files: Vec<String>,
pub origin: Origin,
}Expand description
One request to the assistant.
Fields§
§action: Action§text: StringFree text: the question of Ask, an optional addition otherwise.
item: Option<String>Item number of the page the user is on.
revision: Option<String>Revision code (with item).
change: Option<String>Change number.
allow_drafts: boolOffer the draft tools (only honoured for users who may edit).
page: PageContextThe page the user is on, resolved with their rights (see
services::assistant::resolve_context); empty = no context.
history: Vec<(String, String)>Earlier messages of the conversation (role, text), oldest first. Quoted in the first message as context, never replayed as model turns.
thread: boolThe question belongs to the user’s conversation (thread).
limits: StringResultValues: limits the user states (“upper limit 250 MPa for stress”).
files: Vec<String>ResultValues: names of the report files to read (a hint; empty = all).
origin: OriginWhere the request that asked comes from (client address, session, token): every tool step applies the conditions on membership of need-to-know groups with it, and the read log records the address. Empty in tests and background runs.
Implementations§
Source§impl Question
impl Question
Sourcepub fn new(
action: Option<&str>,
text: Option<&str>,
item: Option<&str>,
revision: Option<&str>,
change: Option<&str>,
allow_drafts: bool,
) -> Result<Question, String>
pub fn new( action: Option<&str>, text: Option<&str>, item: Option<&str>, revision: Option<&str>, change: Option<&str>, allow_drafts: bool, ) -> Result<Question, String>
Validates the raw request fields.
Sourcepub fn instruction(&self) -> String
pub fn instruction(&self) -> String
The first user message: the earlier conversation (if any, quoted as context), then the fixed instruction of the quick action (the MCP prompts) or the free question, plus the page context.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Question
impl RefUnwindSafe for Question
impl Send for Question
impl Sync for Question
impl Unpin for Question
impl UnsafeUnpin for Question
impl UnwindSafe for Question
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,
impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> 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 moreimpl<T> Parallelizable for T
§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
§impl<U, T> ToOwnedObj<U> for Twhere
U: FromObjRef<T>,
impl<U, T> ToOwnedObj<U> for Twhere
U: FromObjRef<T>,
§fn to_owned_obj(&self, data: FontData<'_>) -> U
fn to_owned_obj(&self, data: FontData<'_>) -> U
T, using the provided data to resolve any offsets.