You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When adding type annotations to some of the output fields, the final parsed field orders are wrong:
classExampleSignature(dspy.Signature):
"""Evaluate the text as "good" or "bad"."""text=dspy.InputField(desc="The text to evaluate.")
output=dspy.OutputField(desc="The evaluation of the text.")
pass_evaluation: bool=dspy.OutputField(desc="The evaluation result, True if the text is good, False otherwise.")
print(ExampleSignature.fields)
In the output, the orders of two output fields are swapped:
{'text': FieldInfo(annotation=str, required=True, json_schema_extra={'desc': 'The text to evaluate.', '__dspy_field_type': 'input', 'prefix': 'Text:'}),
'pass_evaluation': FieldInfo(annotation=bool, required=True, json_schema_extra={'desc': 'The evaluation result, True if the text is good, False otherwise.', '__dspy_field_type': 'output', 'prefix': 'Pass Evaluation:'}),
'output': FieldInfo(annotation=str, required=True, json_schema_extra={'desc': 'The evaluation of the text.', '__dspy_field_type': 'output', 'prefix': 'Output:'})}
This only happens when output fields are partially typed. If all output fields are typed, the order is correct.
Steps to reproduce
See above.
DSPy version
2.6.0
The text was updated successfully, but these errors were encountered:
What happened?
When adding type annotations to some of the output fields, the final parsed field orders are wrong:
In the output, the orders of two output fields are swapped:
This only happens when output fields are partially typed. If all output fields are typed, the order is correct.
Steps to reproduce
See above.
DSPy version
2.6.0
The text was updated successfully, but these errors were encountered: