confident-ai/deepeval

Feat request: optional user-defined prompt builder for synthesizer

Aperta

#2396 aperta il 26 dic 2025

 (15 commenti) (0 reazioni) (0 assegnatari)Python (1677 fork)auto 404
enhancementhelp wanted

Metriche repository

Star
 (16.939 stelle)
Metriche merge PR
 (Metriche PR in attesa)

Descrizione

It could be useful to give users flexibility over the user prompt used to generate the goldens in the synthesizer.

generate_goldens_from_contexts and a_generate_goldens_from_contexts may be overridden when inheriting from the Synthesizer class and rely on predefined prompt templates composed from specific arguments context, max_goldens_per_context, scenario, task, input_format

https://github.com/confident-ai/deepeval/blob/a740ca31d6c32d130e93fc1fe0c90d4795a93dc0/deepeval/synthesizer/synthesizer.py#L661-L667

which are passed into the synthetic inputs. Does it make sense to add an optional prompt builder argument and allow the user to construct the prompt for golden generation?

prompt_builder: Optional[Callable[..., str | Prompt]]

Guida contributor