pub struct ScriptedExtractor { /* private fields */ }Expand description
LLM extractor that pops pre-scripted results in FIFO order and counts
invocations. When the script is exhausted, subsequent calls return an empty
Vec (mirroring a provider that simply finds no facts) rather than
erroring, so tests that do not care about the Nth call still pass.
Records every (content, tool_calls) pair handed to extract_facts via
ScriptedExtractor::inputs — the parity-shaped accessor the NLI/reranker
fakes expose — so tests can assert on the exact input that reached the
extractor (e.g. the "User:/Assistant:" role markup).
Implementations§
Trait Implementations§
Source§impl LlmExtractor for ScriptedExtractor
impl LlmExtractor for ScriptedExtractor
Source§async fn extract_facts(
&self,
content: &str,
tool_calls: &[ToolCall],
) -> Result<Vec<String>, ProviderError>
async fn extract_facts( &self, content: &str, tool_calls: &[ToolCall], ) -> Result<Vec<String>, ProviderError>
Extract zero or more canonical-English fact strings from an assistant
response.
response_content is the combined extraction input (assistant
text + formatted tool calls); tool_calls is the raw structured calls
for adapters that prefer to handle them directly.Auto Trait Implementations§
impl !Freeze for ScriptedExtractor
impl RefUnwindSafe for ScriptedExtractor
impl Send for ScriptedExtractor
impl Sync for ScriptedExtractor
impl Unpin for ScriptedExtractor
impl UnsafeUnpin for ScriptedExtractor
impl UnwindSafe for ScriptedExtractor
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