Skip to content

Commit df5d94b

Browse files
committed
Refactor output rule and test generation messages for improved clarity; remove ellipses and enhance prompt details in test generation
1 parent 9469f8c commit df5d94b

1 file changed

Lines changed: 6 additions & 5 deletions

File tree

cmd/generate/pipeline.go

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ Input Specification:`, RenderMessagesToString(context.Prompt.Messages))
148148

149149
// generateOutputRules generates output rules for the prompt
150150
func (h *generateCommandHandler) generateOutputRules(context *PromptPexContext) error {
151-
h.WriteStartBox("Output rules...")
151+
h.WriteStartBox("Output rules")
152152
if len(context.Rules) == 0 {
153153
system := `Analyze the following prompt and generate a list of output rules.
154154
These rules should describe what makes a valid output from this prompt.
@@ -191,7 +191,7 @@ Output Rules:`, RenderMessagesToString(context.Prompt.Messages))
191191

192192
// generateInverseRules generates inverse rules (what makes an invalid output)
193193
func (h *generateCommandHandler) generateInverseRules(context *PromptPexContext) error {
194-
h.WriteStartBox("Inverse output rules...")
194+
h.WriteStartBox("Inverse output rules")
195195
if len(context.InverseRules) == 0 {
196196

197197
system := `Based on the following <output_rules>, generate inverse rules that describe what would make an INVALID output.
@@ -232,7 +232,7 @@ Inverse Output Rules:`, strings.Join(context.Rules, "\n"))
232232

233233
// generateTests generates test cases for the prompt
234234
func (h *generateCommandHandler) generateTests(context *PromptPexContext) error {
235-
h.WriteStartBox("Tests...")
235+
h.WriteStartBox(fmt.Sprintf("Tests (%d rules x %d tests per rule)", len(context.Rules)+len(context.InverseRules), *h.options.TestsPerRule))
236236
if len(context.Tests) == 0 {
237237
testsPerRule := 3
238238
if h.options.TestsPerRule != nil {
@@ -244,7 +244,7 @@ func (h *generateCommandHandler) generateTests(context *PromptPexContext) error
244244
nTests := testsPerRule * len(context.Rules)
245245
// Build dynamic prompt based on the actual content (like TypeScript reference)
246246
system := `Response in JSON format only.`
247-
prompt := fmt.Sprintf(`Generate %d test cases for the following prompt based on the intent, input specification, and output rules.
247+
prompt := fmt.Sprintf(`Generate %d test cases for the following prompt based on the intent, input specification, and output rules. Generate %d tests per rule.
248248
249249
<intent>
250250
%s
@@ -279,6 +279,7 @@ Return only a JSON array with this exact format:
279279
]
280280
281281
Generate exactly %d diverse test cases:`, nTests,
282+
testsPerRule,
282283
*context.Intent,
283284
*context.InputSpec,
284285
strings.Join(allRules, "\n"),
@@ -378,7 +379,7 @@ func (h *generateCommandHandler) runSingleTestWithContext(input, modelName strin
378379
// generateGroundtruth generates groundtruth outputs using the specified model
379380
func (h *generateCommandHandler) generateGroundtruth(context *PromptPexContext) error {
380381
groundtruthModel := h.options.Models.Groundtruth
381-
h.cfg.WriteToOut("Generating groundtruth...")
382+
h.cfg.WriteToOut("Groundtruth")
382383

383384
for i := range context.Tests {
384385
test := &context.Tests[i]

0 commit comments

Comments
 (0)