pub struct NlConfigGenerator;Expand description
Generates YAML configuration from natural language descriptions.
The generator uses a two-phase approach:
- Parse the natural language description into a structured
ConfigIntent. - Map the intent to a YAML configuration string using preset templates.
Implementations§
Source§impl NlConfigGenerator
impl NlConfigGenerator
Sourcepub fn generate(
description: &str,
provider: &dyn LlmProvider,
) -> Result<String, SynthError>
pub fn generate( description: &str, provider: &dyn LlmProvider, ) -> Result<String, SynthError>
Generate a YAML configuration from a natural language description.
Uses the provided LLM provider to help parse the description, with keyword-based fallback parsing for reliability.
§Errors
Returns SynthError::GenerationError if the description cannot be parsed
or the resulting configuration is invalid.
Sourcepub fn parse_intent(
description: &str,
provider: &dyn LlmProvider,
) -> Result<ConfigIntent, SynthError>
pub fn parse_intent( description: &str, provider: &dyn LlmProvider, ) -> Result<ConfigIntent, SynthError>
Parse a natural language description into a structured ConfigIntent.
Attempts to use the LLM provider first, then falls back to keyword-based extraction for reliability.
Sourcepub fn intent_to_yaml(intent: &ConfigIntent) -> Result<String, SynthError>
pub fn intent_to_yaml(intent: &ConfigIntent) -> Result<String, SynthError>
Map a ConfigIntent to a YAML configuration string.
Auto Trait Implementations§
impl Freeze for NlConfigGenerator
impl RefUnwindSafe for NlConfigGenerator
impl Send for NlConfigGenerator
impl Sync for NlConfigGenerator
impl Unpin for NlConfigGenerator
impl UnsafeUnpin for NlConfigGenerator
impl UnwindSafe for NlConfigGenerator
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