Function generate_code_solution

Source
pub async fn generate_code_solution(
    generator: &CodeSolutionGenerator,
    statement: &str,
    input_format: &str,
    constraints: &str,
) -> Result<(String, LanguageName), PromptError>
Expand description

Generates a code solution from the given statement, input format, and constraints.

§Arguments

  • generator - A reference to the CodeSolutionGenerator instance
  • statement - A string describing the problem statement in natural language
  • input_format - A string describing the input format in natural language
  • constraints - A string specifying the constraints on input values

§Returns

  • Result<String, PromptError> - A Result containing either the generated code solution or a Google API error