Skip to main content

RequestPatch

Struct RequestPatch 

Source
pub struct RequestPatch {
    pub preamble: Option<String>,
    pub temperature: Option<f32>,
    pub max_tokens: Option<u32>,
    pub tool_choice: Option<ToolChoice>,
    pub active_tools: Option<Vec<String>>,
    pub extra_params: BTreeMap<String, Value>,
    pub documents: Vec<Message>,
    pub history: Option<Vec<Message>>,
}
Expand description

How a turn’s request differs from the agent’s defaults.

Every field is optional and every field is a this turn only decision. Providers that cannot express a field must say so rather than drop it silently: a patch nobody applied is worse than an error, because the model then looks irrational for reasons nothing records.

Fields§

§preamble: Option<String>

An extra system message, sent ahead of the conversation. Use it for a per-turn reminder; the agent’s own system prompt stays where it is.

§temperature: Option<f32>§max_tokens: Option<u32>§tool_choice: Option<ToolChoice>

What the model may do with tools on this turn.

§active_tools: Option<Vec<String>>

An allow-list of tool names to advertise. Unknown names are dropped, so a hook that names a tool this build does not have narrows the list to what exists rather than failing the turn.

§extra_params: BTreeMap<String, Value>

Merged into the request body, shallow: a key here replaces the same key from the config profile. This is the escape hatch for provider-specific knobs (top_p, min_p, repeat_penalty) without teaching Eclipse every vendor’s spelling.

§documents: Vec<Message>

Extra messages inserted after the system prompt and ahead of the conversation. They are this turn only — they are never stored, so the session reads as if they were not there. Use for a per-turn reference document or a fetched excerpt.

§history: Option<Vec<Message>>

Replaces the assembled conversation (everything after the system prompt) for this turn. The agent’s own system prompt is preserved; the history the loop would have sent is not. Last writer wins, like preamble.

Implementations§

Source§

impl RequestPatch

Source

pub fn is_empty(&self) -> bool

Source

pub fn describe(&self) -> String

Names of the fields this patch sets, for an error or a log line.

Source

pub fn merge(&mut self, later: RequestPatch)

Fold a later hook’s patch into this one: scalars are last-writer-wins, extra_params merge key by key, and two allow-lists intersect.

Intersecting is the only composition that cannot widen what a hook meant to narrow: if hook A permits three tools and hook B permits two, the turn gets the two. Union would let a later hook quietly re-enable what an earlier one forbade.

Trait Implementations§

Source§

impl Clone for RequestPatch

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for RequestPatch

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for RequestPatch

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl PartialEq for RequestPatch

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for RequestPatch

Auto Trait Implementations§

§

impl Forget for RequestPatch

§

impl Freeze for RequestPatch
where *const u8 is !null: Freeze, PhantomData<u8>: Freeze, PhantomData<String>: Freeze, *const LeafNode<String, Value> is !null: Freeze, PhantomData<(Owned, LeafOrInternal)>: Freeze, PhantomData<Box<(String, Value)>>: Freeze, PhantomData<Message>: Freeze,

§

impl Move for RequestPatch

§

impl RefUnwindSafe for RequestPatch

§

impl Send for RequestPatch
where RawVecInner: Send, NodeRef<Owned, String, Value, LeafOrInternal>: Send, BoxRaw<(String, Value)>: Send,

§

impl Sync for RequestPatch
where RawVecInner: Sync, NodeRef<Owned, String, Value, LeafOrInternal>: Sync, BoxRaw<(String, Value)>: Sync,

§

impl Unpin for RequestPatch
where *const u8 is !null: Unpin, *const LeafNode<String, Value> is !null: Unpin, Box<(String, Value)>: Unpin,

§

impl UnsafeUnpin for RequestPatch

§

impl UnwindSafe for RequestPatch
where RawVecInner: UnwindSafe, BTreeMap<String, Value>: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more