(no commit message)

This commit is contained in:
2025-10-29 20:23:58 -04:00
parent ce4d656800
commit 4d757a6394
3 changed files with 100 additions and 54 deletions

View File

@@ -1,4 +1,3 @@
from .modules import SignatureGenerator
from .metrics import validate_signature_with_feedback
__all__ = ["SignatureGenerator", "validate_signature_with_feedback"]
__all__ = ["SignatureGenerator"]

View File

@@ -1,31 +0,0 @@
import dspy
def validate_signature_with_feedback(
args, pred, feedback=None, satisfied_with_score=True
):
"""Validation function for dspy.Refine that asks user for feedback"""
# Display the generated signature
print("\n" + "=" * 60)
print("🔍 Review Generated Signature")
print("=" * 60)
# Show the signature name and description
print(f"Signature Name: {pred.signature_name}")
print(f"Description: {pred.task_description}")
# Show the fields in a simple format
print(f"\nFields ({len(pred.signature_fields)}):")
for i, field in enumerate(pred.signature_fields, 1):
role_emoji = "📥" if field.role.value == "input" else "📤"
print(
f" {i}. {role_emoji} {field.name} ({field.type.value}) - {field.description}"
)
if satisfied_with_score:
print("✓ Signature approved!")
return 1.0
else:
print(f"📝 Feedback recorded: {feedback}")
return dspy.Prediction(score=0.0, feedback=feedback)