File size: 441 Bytes
43e31bb
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
# example.py
from generation_fast import CodeGenerator

generator = CodeGenerator()

nl_inputs = [
    "Write a Python function to calculate the sum of two numbers.",
    "Generate Python code to check if a number is prime.",
    "Create a Python class for a simple calculator.",
]

for nl_input in nl_inputs:
    generated_code = generator.generate_code(nl_input)
    print(f"Input: {nl_input}\nGenerated Code:\n{generated_code}\n{'-'*40}")