@@ -68,9 +68,18 @@ def __init__(self, signature, tools: list[Callable], max_iters=5):
68
68
react_signature = (
69
69
dspy .Signature ({** signature .input_fields }, "\n " .join (instr ))
70
70
.append ("trajectory" , dspy .InputField (), type_ = str )
71
- .append ("next_thought" , dspy .OutputField (), type_ = str )
72
- .append ("next_tool_name" , dspy .OutputField (), type_ = Literal [tuple (tools .keys ())])
73
- .append ("next_tool_args" , dspy .OutputField (), type_ = dict [str , Any ])
71
+ .append ("next_thought" , dspy .OutputField (
72
+ desc = "The next thought to consider in the trajectory."
73
+ " Make sure the key is exactly 'next_thought'"
74
+ ), type_ = str )
75
+ .append ("next_tool_name" , dspy .OutputField (
76
+ desc = "The next tool to use in the trajectory."
77
+ " Make sure the key is exactly 'next_tool_name'"
78
+ ), type_ = Literal [tuple (tools .keys ())])
79
+ .append ("next_tool_args" , dspy .OutputField (
80
+ desc = "The arguments to pass to the next tool in the trajectory."
81
+ " Make sure the key is exactly 'next_tool_args'"
82
+ ), type_ = dict [str , Any ])
74
83
)
75
84
76
85
fallback_signature = dspy .Signature (
0 commit comments