pub enum ModelOutputProtocol {
Text,
HarmonyGptOss,
}Expand description
Typed wire protocol emitted by the model after prompt rendering.
This is carried per request because output-token policy and response parsing must agree on the exact model protocol. It must be selected from resolved model metadata rather than inferred from a user-facing model name.
Variants§
Text
Ordinary text output with no model-specific control-token protocol.
HarmonyGptOss
OpenAI Harmony output used by GPT-OSS checkpoints.
Implementations§
Source§impl ModelOutputProtocol
impl ModelOutputProtocol
Sourcepub const fn generated_control_token_texts(self) -> &'static [&'static str]
pub const fn generated_control_token_texts(self) -> &'static [&'static str]
Non-terminal control tokens that generation must be able to emit for
this protocol. Terminal <|call|> / <|return|> tokens remain owned
by the model’s typed EOS configuration.
Sourcepub const fn preserved_special_token_texts(self) -> &'static [&'static str]
pub const fn preserved_special_token_texts(self) -> &'static [&'static str]
Special-token text that skip-special decoding must preserve so the product parser can observe the complete protocol envelope.
Trait Implementations§
Source§impl Clone for ModelOutputProtocol
impl Clone for ModelOutputProtocol
Source§fn clone(&self) -> ModelOutputProtocol
fn clone(&self) -> ModelOutputProtocol
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 moreimpl Copy for ModelOutputProtocol
Source§impl Debug for ModelOutputProtocol
impl Debug for ModelOutputProtocol
Source§impl Default for ModelOutputProtocol
impl Default for ModelOutputProtocol
Source§fn default() -> ModelOutputProtocol
fn default() -> ModelOutputProtocol
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for ModelOutputProtocol
impl<'de> Deserialize<'de> for ModelOutputProtocol
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for ModelOutputProtocol
Source§impl PartialEq for ModelOutputProtocol
impl PartialEq for ModelOutputProtocol
Source§impl Serialize for ModelOutputProtocol
impl Serialize for ModelOutputProtocol
impl StructuralPartialEq for ModelOutputProtocol
Auto Trait Implementations§
impl Freeze for ModelOutputProtocol
impl RefUnwindSafe for ModelOutputProtocol
impl Send for ModelOutputProtocol
impl Sync for ModelOutputProtocol
impl Unpin for ModelOutputProtocol
impl UnsafeUnpin for ModelOutputProtocol
impl UnwindSafe for ModelOutputProtocol
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