pub enum CodeExtractorStrategy {
MarkdownFence {
language: Option<String>,
},
Regex {
pattern: Regex,
},
Llm {
prompt: String,
judge: Arc<dyn JudgeClient>,
},
}Expand description
Strategy selector for CodeExtractor.
Variants§
MarkdownFence
Match fenced markdown code blocks. When language is Some, only
fences tagged with the given language are returned.
Regex
Arbitrary regex whose first capture group is the extracted code.
Llm
Ask a judge to return the code block most relevant to the response.
The supplied prompt is rendered as-is with the response appended; the
judge’s reason field is returned as the extracted code to keep the
contract free of schema assumptions.
Fields
§
judge: Arc<dyn JudgeClient>Judge client used for the dispatch.
Trait Implementations§
Source§impl Clone for CodeExtractorStrategy
impl Clone for CodeExtractorStrategy
Source§fn clone(&self) -> CodeExtractorStrategy
fn clone(&self) -> CodeExtractorStrategy
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for CodeExtractorStrategy
impl !RefUnwindSafe for CodeExtractorStrategy
impl Send for CodeExtractorStrategy
impl Sync for CodeExtractorStrategy
impl Unpin for CodeExtractorStrategy
impl UnsafeUnpin for CodeExtractorStrategy
impl !UnwindSafe for CodeExtractorStrategy
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