@@ -482,17 +482,12 @@ func (w *Worker) runKnowledgePrecheck(lab string, labDiffOutput []string, modelN
482
482
w .logger .Error ("Invalid seed example format in knowledge YAML file" )
483
483
continue
484
484
}
485
- context , ok := example ["context" ].(string )
485
+ originalContext , ok := example ["context" ].(string )
486
486
if ! ok {
487
487
w .logger .Error ("Context not found or not a string in seed example of knowledge" )
488
488
continue
489
489
}
490
490
491
- originalContext := context
492
-
493
- // Escape sequences of two or more hyphens in the question to avoid ilab seeing a flag request
494
- // context = escapeHyphens(context)
495
-
496
491
qnaPairs , hasQnAPairs := example ["questions_and_answers" ].([]interface {})
497
492
498
493
if ! hasQnAPairs {
@@ -508,7 +503,7 @@ func (w *Worker) runKnowledgePrecheck(lab string, labDiffOutput []string, modelN
508
503
w .logger .Errorf ("Invalid question and answer format in knowledge seed example %d" , seIndex )
509
504
continue
510
505
}
511
- question , ok := qna ["question" ].(string )
506
+ originalQuestion , ok := qna ["question" ].(string )
512
507
if ! ok {
513
508
w .logger .Errorf ("Question not found or not a string in knowledge seed example %d" , seIndex )
514
509
continue
@@ -521,9 +516,8 @@ func (w *Worker) runKnowledgePrecheck(lab string, labDiffOutput []string, modelN
521
516
}
522
517
523
518
// Escape sequences of two or more hyphens in the question to avoid ilab seeing a flag request
524
- originalQuestion := question
525
- question = escapeHyphens (question )
526
- // Append the context to the question with a specific format
519
+ question := escapeHyphens (originalQuestion )
520
+
527
521
// In case of knowledge, it doesn't make sense to provide the context with the question
528
522
// Commenting out the context appending in case we need to revert back
529
523
// question = fmt.Sprintf("%s %s %s.", question, ctxPrompt, context)
@@ -636,7 +630,7 @@ func (w *Worker) runSkillPrecheck(lab string, labDiffOutput []string, modelName
636
630
w .logger .Error ("Invalid seed example format in the skill" )
637
631
continue
638
632
}
639
- question , ok := example ["question" ].(string )
633
+ originalQuestion , ok := example ["question" ].(string )
640
634
if ! ok {
641
635
w .logger .Error ("Question not found or not a string in the skill" )
642
636
continue
@@ -647,14 +641,14 @@ func (w *Worker) runSkillPrecheck(lab string, labDiffOutput []string, modelName
647
641
continue
648
642
}
649
643
650
- context , hasContext := example ["context" ].(string )
651
- originalQuestion := question
644
+ originalContext , hasContext := example ["context" ].(string )
652
645
653
646
// Escape sequences of two or more hyphens in the question to avoid ilab seeing a flag request
654
- question = escapeHyphens (question )
647
+ question : = escapeHyphens (originalQuestion )
655
648
656
649
// Slicing args breaks ilab chat for context, use Sprintf to control spacing
657
650
if hasContext {
651
+ context := escapeHyphens (originalContext )
658
652
// Append the context to the question with a specific format
659
653
question = fmt .Sprintf ("%s %s %s." , question , ctxPrompt , context )
660
654
}
@@ -694,7 +688,7 @@ func (w *Worker) runSkillPrecheck(lab string, labDiffOutput []string, modelName
694
688
}
695
689
696
690
if hasContext {
697
- logData ["context" ] = context
691
+ logData ["context" ] = originalContext
698
692
}
699
693
700
694
logYAML , err := yaml .Marshal (logData )
0 commit comments