pub struct ExampleGenerator { /* private fields */ }Expand description
AI-powered example generator
Implementations§
Source§impl ExampleGenerator
impl ExampleGenerator
Sourcepub fn new(llm: Arc<dyn LlmProvider>, config: GeneratorConfig) -> Self
pub fn new(llm: Arc<dyn LlmProvider>, config: GeneratorConfig) -> Self
Create a new example generator
Sourcepub fn from_config(
llm: Arc<dyn LlmProvider>,
config: &AiIngestionConfig,
) -> Self
pub fn from_config( llm: Arc<dyn LlmProvider>, config: &AiIngestionConfig, ) -> Self
Create from AI ingestion config
Sourcepub async fn generate(
&self,
tool: &ToolDocumentation,
) -> Result<Vec<GeneratedExample>>
pub async fn generate( &self, tool: &ToolDocumentation, ) -> Result<Vec<GeneratedExample>>
Generate examples for a tool (non-streaming)
Sourcepub async fn generate_batch(
&self,
tools: &[ToolDocumentation],
) -> Result<Vec<(String, Vec<GeneratedExample>)>>
pub async fn generate_batch( &self, tools: &[ToolDocumentation], ) -> Result<Vec<(String, Vec<GeneratedExample>)>>
Generate examples for multiple tools (non-streaming)
Sourcepub fn generate_stream<'a>(
&'a self,
tool: &'a ToolDocumentation,
current_index: usize,
total_tools: usize,
) -> impl Stream<Item = GenerationEvent> + 'a
pub fn generate_stream<'a>( &'a self, tool: &'a ToolDocumentation, current_index: usize, total_tools: usize, ) -> impl Stream<Item = GenerationEvent> + 'a
Generate examples with streaming events
Sourcepub fn provider_name(&self) -> &str
pub fn provider_name(&self) -> &str
Get the LLM provider name
Sourcepub fn model_name(&self) -> &str
pub fn model_name(&self) -> &str
Get the model name
Auto Trait Implementations§
impl Freeze for ExampleGenerator
impl !RefUnwindSafe for ExampleGenerator
impl Send for ExampleGenerator
impl Sync for ExampleGenerator
impl Unpin for ExampleGenerator
impl !UnwindSafe for ExampleGenerator
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> GetSetFdFlags for T
impl<T> GetSetFdFlags for T
Source§fn get_fd_flags(&self) -> Result<FdFlags, Error>where
T: AsFilelike,
fn get_fd_flags(&self) -> Result<FdFlags, Error>where
T: AsFilelike,
Query the “status” flags for the
self file descriptor.Source§fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where
T: AsFilelike,
fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where
T: AsFilelike,
Source§fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where
T: AsFilelike,
fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where
T: AsFilelike,
Set the “status” flags for the
self file descriptor. Read moreSource§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> 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