@@ -110,6 +110,14 @@ def gold_and_pred_to_row(gold: Example, pred: Prediction) -> EvaluationRow:
110110
111111 content = pred .get ("answer" , "" )
112112
113+ # Debug: print conversion details (only first few)
114+ import os
115+
116+ if os .environ .get ("EP_DEBUG_GEPA" ):
117+ print ("\n [gold_and_pred_to_row] Converting:" )
118+ print (f" gold.answer type: { type (gt )} , value preview: { str (gt )[:100 ]} ..." )
119+ print (f" pred.answer type: { type (content )} , value preview: { str (content )[:100 ]} ..." )
120+
113121 return EvaluationRow (
114122 messages = [
115123 Message (role = "assistant" , content = str (content ))
@@ -325,6 +333,14 @@ def create_single_turn_program(
325333 module_factory=lambda sig: MyCustomModule(sig)
326334 )
327335 """
336+ print ("\n " + "⚙️" * 20 )
337+ print ("DEBUG [create_single_turn_program] CREATING DSPY MODULE" )
338+ print ("⚙️" * 20 )
339+ print (f" input_field: '{ input_field } '" )
340+ print (f" output_field: '{ output_field } '" )
341+ print (f" module_type: { module_type } " )
342+ print (f" system_prompt (first 200 chars): { (system_prompt or '' )[:200 ]} ..." )
343+
328344 # Create the signature
329345 sig = create_signature (
330346 input_field = input_field ,
@@ -334,8 +350,12 @@ def create_single_turn_program(
334350 output_desc = output_desc ,
335351 )
336352
353+ print (f"\n Created signature: { sig } " )
354+ print (f" Signature instructions (first 200 chars): { (sig .instructions or '' )[:200 ]} ..." )
355+
337356 # Use custom factory if provided
338357 if module_factory is not None :
358+ print (" Using custom module factory" )
339359 return module_factory (sig )
340360
341361 # Convert string to enum if needed
@@ -344,14 +364,22 @@ def create_single_turn_program(
344364
345365 # Create the appropriate module type
346366 if module_type == DSPyModuleType .PREDICT :
347- return dspy .Predict (sig )
367+ program = dspy .Predict (sig )
348368 elif module_type == DSPyModuleType .CHAIN_OF_THOUGHT :
349- return dspy .ChainOfThought (sig )
369+ program = dspy .ChainOfThought (sig )
350370 elif module_type == DSPyModuleType .PROGRAM_OF_THOUGHT :
351- return dspy .ProgramOfThought (sig )
371+ program = dspy .ProgramOfThought (sig )
352372 else :
353373 raise ValueError (f"Unknown module type: { module_type } " )
354374
375+ print (f"\n Created module: { type (program ).__name__ } " )
376+ print (f" Named predictors: { [name for name , _ in program .named_predictors ()]} " )
377+ for name , pred in program .named_predictors ():
378+ print (f" '{ name } ' signature.instructions (first 200 chars): { (pred .signature .instructions or '' )[:200 ]} ..." )
379+ print ("⚙️" * 20 + "\n " )
380+
381+ return program
382+
355383
356384def configure_dspy_lm (ep_params : EPParameters ) -> None :
357385 """
0 commit comments