pub struct CodeGenerator<'e> { /* private fields */ }Expand description
Uses an inference engine to generate Rust source for a CapabilityRequest.
Implementations§
Source§impl<'e> CodeGenerator<'e>
impl<'e> CodeGenerator<'e>
pub fn new(engine: &'e dyn InferenceEngine, soul: &'e Soul) -> Self
Sourcepub async fn generate(
&self,
req: &CapabilityRequest,
) -> Result<GeneratedTool, String>
pub async fn generate( &self, req: &CapabilityRequest, ) -> Result<GeneratedTool, String>
Generate Rust source code for req.
Returns Err if the model call fails or no code block is present in
the response. Static analysis violations do NOT cause an Err — they
are reported inside GeneratedTool.
Auto Trait Implementations§
impl<'e> !RefUnwindSafe for CodeGenerator<'e>
impl<'e> !UnwindSafe for CodeGenerator<'e>
impl<'e> Freeze for CodeGenerator<'e>
impl<'e> Send for CodeGenerator<'e>
impl<'e> Sync for CodeGenerator<'e>
impl<'e> Unpin for CodeGenerator<'e>
impl<'e> UnsafeUnpin for CodeGenerator<'e>
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