Skip to content

Instantly share code, notes, and snippets.

@karljuhlpep
karljuhlpep / dspy_codegen.py
Last active April 24, 2024 04:45
DSPy Module - CodeGen + Debugging
import subprocess
import dspy
### Note this code is not tested, and likely includes errors that need to be refined.
class IterativeCodeRefinement(dspy.Module):
def __init__(self):
super().__init__()
self.generate_pseudocode = dspy.ChainOfThought("task -> pseudocode")