pub struct GroundTruthGenerator { /* private fields */ }Expand description
Generator for synthetic ground truth
Implementations§
Source§impl GroundTruthGenerator
impl GroundTruthGenerator
Sourcepub fn new(
client: AnthropicClient,
model: &str,
sample_size: usize,
seed: u64,
) -> Self
pub fn new( client: AnthropicClient, model: &str, sample_size: usize, seed: u64, ) -> Self
Create a new generator
Sourcepub fn sample_chunks(&self, chunks: &[IndexChunk]) -> Vec<SampledChunk>
pub fn sample_chunks(&self, chunks: &[IndexChunk]) -> Vec<SampledChunk>
Sample chunks using stratified sampling by course directory
Sourcepub async fn generate_question(
&self,
content: &str,
) -> Result<Option<String>, String>
pub async fn generate_question( &self, content: &str, ) -> Result<Option<String>, String>
Generate a question for a single chunk
Sourcepub async fn generate(
&self,
chunks: &[IndexChunk],
) -> Result<Vec<GroundTruthEntry>, String>
pub async fn generate( &self, chunks: &[IndexChunk], ) -> Result<Vec<GroundTruthEntry>, String>
Generate ground truth for all sampled chunks
Auto Trait Implementations§
impl Freeze for GroundTruthGenerator
impl !RefUnwindSafe for GroundTruthGenerator
impl Send for GroundTruthGenerator
impl Sync for GroundTruthGenerator
impl Unpin for GroundTruthGenerator
impl UnsafeUnpin for GroundTruthGenerator
impl !UnwindSafe for GroundTruthGenerator
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> 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