pub enum NormalizeAction {
Show 16 variants
DowngradedDeveloper,
DowngradedCustomRole {
role: String,
},
AssignedToolCallId {
name: String,
id: String,
},
FilledToolResultId {
name: String,
id: String,
},
ReconciledToolResultId {
name: String,
from: String,
to: String,
},
FlattenedToolCallIntoText {
name: String,
},
FlattenedToolResultIntoText {
name: String,
},
DroppedOrphanToolResult {
name: String,
},
SynthesizedMissingToolResult {
call_id: String,
name: String,
},
DroppedUnpairedToolCall {
call_id: String,
name: String,
},
DroppedForeignReasoning {
format: ProviderStateFormat,
expected: ProviderStateFormat,
},
DroppedForeignToolState {
format: ProviderStateFormat,
expected: ProviderStateFormat,
},
DroppedForeignTextState {
format: ProviderStateFormat,
expected: ProviderStateFormat,
},
DroppedForeignProviderItem {
format: ProviderStateFormat,
expected: ProviderStateFormat,
},
DroppedReasoningFromNonAssistant {
role: ExternalRole,
},
MergedAdjacent {
role: ExternalRole,
},
}Expand description
A human-readable trace of every repair made at the boundary.
Variants§
DowngradedDeveloper
A Developer role message was downgraded to System or User.
DowngradedCustomRole
A custom role was downgraded to a provider-safe role.
AssignedToolCallId
A tool call arrived without an id and was assigned a generated one.
FilledToolResultId
A tool result was missing a call id, which was filled in from the matching pending tool call.
Fields
ReconciledToolResultId
A tool result carried a call id that did not match the call it was paired with, so the id was rewritten to the pending call’s id. This only happens when the call’s id was generated by this normalization run.
Fields
FlattenedToolCallIntoText
A tool call stored on a non-tool message was rendered as literal text. The structured call is gone; only the text survives to the provider.
FlattenedToolResultIntoText
A tool result stored on a non-tool message was rendered as literal text inside that message, keeping the message’s original role.
DroppedOrphanToolResult
A tool result had no matching assistant tool call and was handled
according to OrphanToolResultPolicy (dropped or downgraded).
SynthesizedMissingToolResult
An assistant tool call never received a result, so an error result
was synthesized per MissingToolResultPolicy::Synthesize.
DroppedUnpairedToolCall
An assistant tool call never received a result, so the call itself
was removed per MissingToolResultPolicy::DropToolCall.
DroppedForeignReasoning
Reasoning state produced by a different protocol was dropped. See
NormalizeOptions::preserve_foreign_reasoning.
Fields
format: ProviderStateFormatFormat of the state that was dropped.
expected: ProviderStateFormatFormat expected by the target protocol.
DroppedForeignToolState
A tool call carrying provider state from a different protocol had that state cleared.
Fields
format: ProviderStateFormatFormat of the state that was dropped.
expected: ProviderStateFormatFormat expected by the target protocol.
DroppedForeignTextState
A text part carrying provider state from a different protocol had that state cleared.
Fields
format: ProviderStateFormatFormat of the state that was dropped.
expected: ProviderStateFormatFormat expected by the target protocol.
DroppedForeignProviderItem
A provider-specific item from a different protocol was dropped.
Fields
format: ProviderStateFormatFormat of the item that was dropped.
expected: ProviderStateFormatFormat expected by the target protocol.
DroppedReasoningFromNonAssistant
Reasoning was dropped because only assistant messages may carry it.
Fields
role: ExternalRoleThe role of the message that contained the reasoning.
MergedAdjacent
Two adjacent messages with the same role were merged into one.
Fields
role: ExternalRoleThe role of the merged messages.
Trait Implementations§
Source§impl Clone for NormalizeAction
impl Clone for NormalizeAction
Source§impl Debug for NormalizeAction
impl Debug for NormalizeAction
impl Eq for NormalizeAction
Source§impl PartialEq for NormalizeAction
impl PartialEq for NormalizeAction
impl StructuralPartialEq for NormalizeAction
Auto Trait Implementations§
impl Freeze for NormalizeAction
impl RefUnwindSafe for NormalizeAction
impl Send for NormalizeAction
impl Sync for NormalizeAction
impl Unpin for NormalizeAction
impl UnsafeUnpin for NormalizeAction
impl UnwindSafe for NormalizeAction
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.