@@ -52,9 +52,18 @@ def __init__(self, signature, tools: list[Callable], max_iters=5):
52
52
react_signature = (
53
53
dspy .Signature ({** signature .input_fields }, "\n " .join (instr ))
54
54
.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 ])
58
67
)
59
68
60
69
fallback_signature = dspy .Signature (
0 commit comments