@@ -68,9 +68,18 @@ def __init__(self, signature, tools: list[Callable], max_iters=5):
6868 react_signature = (
6969 dspy .Signature ({** signature .input_fields }, "\n " .join (instr ))
7070 .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 ])
7483 )
7584
7685 fallback_signature = dspy .Signature (
0 commit comments