pub struct SpeculativeStreamInterceptor { /* private fields */ }Expand description
投機的ストリーム検証インターセプター。
Implementations§
Source§impl SpeculativeStreamInterceptor
impl SpeculativeStreamInterceptor
Sourcepub fn new(config: StreamingVerifierConfig, state_context: String) -> Self
pub fn new(config: StreamingVerifierConfig, state_context: String) -> Self
新規インターセプターを構築する。
Sourcepub fn verify_sentence(
&self,
sentence: &str,
mock_nli_logits: Option<[f64; 3]>,
) -> HallucinationVerificationResult
pub fn verify_sentence( &self, sentence: &str, mock_nli_logits: Option<[f64; 3]>, ) -> HallucinationVerificationResult
文がハルシネーションであるかを同期または投機的に検査する。
Sourcepub fn build_error_event_bytes(&self, reason: &str) -> Bytes
pub fn build_error_event_bytes(&self, reason: &str) -> Bytes
遮断用 SSE エラーチャンクバイト列を構築する。
Sourcepub fn config(&self) -> &StreamingVerifierConfig
pub fn config(&self) -> &StreamingVerifierConfig
設定への参照を取得する。
Sourcepub fn state_context(&self) -> &str
pub fn state_context(&self) -> &str
前提コンテキスト文字列への参照を取得する。
Auto Trait Implementations§
impl Freeze for SpeculativeStreamInterceptor
impl RefUnwindSafe for SpeculativeStreamInterceptor
impl Send for SpeculativeStreamInterceptor
impl Sync for SpeculativeStreamInterceptor
impl Unpin for SpeculativeStreamInterceptor
impl UnsafeUnpin for SpeculativeStreamInterceptor
impl UnwindSafe for SpeculativeStreamInterceptor
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> 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