pub struct ValidationPolicy {
pub allow_system_anywhere: bool,
pub require_user_first: bool,
pub allow_repeated_roles: bool,
pub enforce_tool_response_order: bool,
pub allow_unknown_tool_response: bool,
pub allow_duplicate_tool_response: bool,
pub allow_developer_and_function: bool,
pub enforce_contiguous_tool_responses: bool,
pub require_user_present: bool,
pub allow_dangling_tool_calls: bool,
}Expand description
Configuration controlling which rules are enforced.
Fields§
§allow_system_anywhere: boolAllow system messages to appear anywhere (not only before first non-system).
require_user_first: boolRequire the first non-system message to be user.
allow_repeated_roles: boolAllow repeated adjacent roles (no error on runs like user→user).
enforce_tool_response_order: boolEnforce that tool responses follow the exact declared order of tool_calls.
allow_unknown_tool_response: boolAllow tool responses with unknown tool_call_id (no matching assistant tool_call).
allow_duplicate_tool_response: boolAllow multiple tool responses for the same tool_call_id.
allow_developer_and_function: boolAllow Developer/Function message kinds.
enforce_contiguous_tool_responses: boolEnforce that tool responses are immediately contiguous after the assistant.
require_user_present: boolRequire at least one user message to be present in the conversation.
allow_dangling_tool_calls: boolAllow assistant tool_calls to be dangling (missing corresponding tool responses) at boundaries/end.
Trait Implementations§
Source§impl Clone for ValidationPolicy
impl Clone for ValidationPolicy
Source§fn clone(&self) -> ValidationPolicy
fn clone(&self) -> ValidationPolicy
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ValidationPolicy
impl Debug for ValidationPolicy
Auto Trait Implementations§
impl Freeze for ValidationPolicy
impl RefUnwindSafe for ValidationPolicy
impl Send for ValidationPolicy
impl Sync for ValidationPolicy
impl Unpin for ValidationPolicy
impl UnsafeUnpin for ValidationPolicy
impl UnwindSafe for ValidationPolicy
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<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