pub struct NativeChatOutputProjector { /* private fields */ }Expand description
Holds uncertain framing and exposes only an irrevocable ordinary-text prefix. Calls and their arguments are withheld until the original terminal contract permits them. Unknown generation state and other output protocols opt out.
Implementations§
Source§impl NativeChatOutputProjector
impl NativeChatOutputProjector
pub fn for_request(request: &InferenceRequest) -> Option<Self>
pub fn new( request: &ApiChatRequest, protocol: ModelOutputProtocol, started_in_think: bool, ) -> Option<Self>
pub fn push(&mut self, text: &str)
Sourcepub fn visible_prefix(&self) -> &str
pub fn visible_prefix(&self) -> &str
A cumulative prefix, suitable for the existing sent-length bookkeeping. Whitespace alone remains pending because a tools-only result drops it.
Sourcepub fn reasoning_prefix(&self) -> Option<&str>
pub fn reasoning_prefix(&self) -> Option<&str>
The completed initial reasoning channel can precede an irrevocable body. A block with unresolved tool intent remains held until completion.
pub fn finish(self, finish_reason: FinishReason) -> NativeChatOutputProjection
Auto Trait Implementations§
impl Freeze for NativeChatOutputProjector
impl RefUnwindSafe for NativeChatOutputProjector
impl Send for NativeChatOutputProjector
impl Sync for NativeChatOutputProjector
impl Unpin for NativeChatOutputProjector
impl UnsafeUnpin for NativeChatOutputProjector
impl UnwindSafe for NativeChatOutputProjector
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