pub struct ScoreMatcher { /* private fields */ }Expand description
打分匹配:provider/model_id 必匹配。
分数 = prompt 公共前缀消息数 × 100 + 第一个不同消息的文本 LCP 长度
- temperature 一致 +1。零分(完全不相关)不命中;平局取首个(确定性)。
与 RFC-0015 LCP 同源,适合“相同前缀的请求“命中。
Implementations§
Trait Implementations§
Source§impl ReplayMatcher for ScoreMatcher
impl ReplayMatcher for ScoreMatcher
Source§fn match<'a>(
&self,
options: &CallOptions,
recordings: &'a [Recording],
) -> Result<&'a Recording, AiMuxError>
fn match<'a>( &self, options: &CallOptions, recordings: &'a [Recording], ) -> Result<&'a Recording, AiMuxError>
按输入侧匹配;未命中返回明确错误。 Read more
Auto Trait Implementations§
impl Freeze for ScoreMatcher
impl RefUnwindSafe for ScoreMatcher
impl Send for ScoreMatcher
impl Sync for ScoreMatcher
impl Unpin for ScoreMatcher
impl UnsafeUnpin for ScoreMatcher
impl UnwindSafe for ScoreMatcher
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