Skip to main content

Module code_gen

Module code_gen 

Source

Structs§

CodeGenerator
Uses an inference engine to generate Rust source for a CapabilityRequest.
GeneratedTool
The result of one code generation pass.

Functions§

build_prompt
Build the generation prompt from a CapabilityRequest.
extract_code_block
Extract the content of the first ```rust ... ``` block in response. Returns None if no such block exists or the block is empty after trimming. Accepts both rust and Rust language tags and both LF and CRLF endings.
extract_function_name
Find the first pub fn or fn name in the source.