Skip to content

Commit 7acf4c8

Browse files
committed
added a test case to test instructions parsing in ReAct class
1 parent c435a3f commit 7acf4c8

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

tests/predict/test_react.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,3 +154,16 @@ def test_custom_tools():
154154
"Thought 3: Even more thoughts\n\n"
155155
"Action 3: Finish[baz]"
156156
)
157+
158+
159+
def test_signature_instructions():
160+
class ExampleSignature(dspy.Signature):
161+
"""You are going to generate output based on input."""
162+
163+
input = dspy.InputField()
164+
output = dspy.OutputField()
165+
166+
react = dspy.ReAct(ExampleSignature)
167+
168+
assert react.react[0].signature.instructions is not None
169+
assert react.react[0].signature.instructions.startswith("You are going to generate output based on input.")

0 commit comments

Comments
 (0)