You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- Define tool functions outside class for clarity
- Match structure of simple ReAct example
- Add clear comments explaining architecture
- Make code more readable and maintainable
Copy file name to clipboardExpand all lines: docs/docs/api/optimizers/GEPA/GEPA_Advanced.md
+179Lines changed: 179 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -443,3 +443,182 @@ gepa = dspy.GEPA(
443
443
auto="medium"
444
444
)
445
445
```
446
+
447
+
## Tool Description Optimization
448
+
449
+
### What is optimize_tool_descriptions?
450
+
451
+
The `optimize_tool_descriptions` parameter enables GEPA to optimize tool descriptions in addition to signature instructions. This is particularly valuable for ReAct agents and other tool-using systems, where the quality of tool descriptions directly impacts the agent's ability to select appropriate tools for each task.
452
+
453
+
Unlike signature instructions that guide reasoning strategies, tool descriptions serve a fundamentally different purpose: they help agents decide **which tool to use** in a given situation. GEPA recognizes this categorical difference and applies a specialized reflection prompt tailored for tool selection decisions.
454
+
455
+
### Default Behavior
456
+
457
+
By default, GEPA only optimizes signature instructions (`optimize_tool_descriptions=False`):
instruction_proposer=MultiModalInstructionProposer(), # For signatures
619
+
optimize_tool_descriptions=True, # Enables ToolProposer for tools
620
+
auto="medium"
621
+
)
622
+
```
623
+
624
+
**Note:** Tool optimization is fully backward compatible. Existing programs without tools, or with `optimize_tool_descriptions=False`, continue to work exactly as before.
0 commit comments