Skip to content

Commit 110feb9

Browse files
updated dspy.ReAct input fields descriptions
1 parent 18087a3 commit 110feb9

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

dspy/predict/react.py

+12-3
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,18 @@ def __init__(self, signature, tools: list[Callable], max_iters=5):
5252
react_signature = (
5353
dspy.Signature({**signature.input_fields}, "\n".join(instr))
5454
.append("trajectory", dspy.InputField(), type_=str)
55-
.append("next_thought", dspy.OutputField(), type_=str)
56-
.append("next_tool_name", dspy.OutputField(), type_=Literal[tuple(tools.keys())])
57-
.append("next_tool_args", dspy.OutputField(), type_=dict[str, Any])
55+
.append("next_thought", dspy.OutputField(
56+
desc="The next thought to consider in the trajectory."
57+
" Make sure the key is exactly 'next_thought'"
58+
), type_=str)
59+
.append("next_tool_name", dspy.OutputField(
60+
desc="The next tool to use in the trajectory."
61+
" Make sure the key is exactly 'next_tool_name'"
62+
), type_=Literal[tuple(tools.keys())])
63+
.append("next_tool_args", dspy.OutputField(
64+
desc="The arguments to pass to the next tool in the trajectory."
65+
" Make sure the key is exactly 'next_tool_args'"
66+
), type_=dict[str, Any])
5867
)
5968

6069
fallback_signature = dspy.Signature(

0 commit comments

Comments
 (0)