@@ -665,27 +665,25 @@ print(optimized_system.assistant.tools["research"].desc)
665665print (optimized_system.assistant.tools[" calculator" ].desc)
666666```
667667
668- ### Inspecting Optimized Tool Descriptions
668+ ### Inspecting Optimized ReAct Components
669669
670- After optimization, tool descriptions are automatically updated in your program. Access them directly through your module structure :
670+ After optimization, all ReAct components are automatically updated in your program. Access them directly:
671671
672672``` python
673673optimized_agent = gepa.compile(agent, trainset = train, valset = val)
674674
675- # Access tools directly - descriptions are already updated
676- print (optimized_agent.tools[" search" ].desc)
677- print (optimized_agent.tools[" calculator" ].desc)
678- ```
675+ # ReAct instruction (guides reasoning and tool selection)
676+ print (" React instruction:" , optimized_agent.react.signature.instructions)
679677
680- For multi-agent systems, access nested tools through your module hierarchy:
678+ # Extract instruction (guides answer extraction from trajectory)
679+ print (" Extract instruction:" , optimized_agent.extract.predict.signature.instructions)
681680
682- ``` python
683- optimized_system = gepa.compile(ResearchAssistant(), trainset = train, valset = val)
684-
685- # Access tools at different levels
686- print (optimized_system.researcher.tools[" search" ].desc) # Sub-agent tool
687- print (optimized_system.assistant.tools[" research" ].desc) # Main agent tool
688- print (optimized_system.assistant.tools[" calculator" ].desc)
681+ # Tool descriptions
682+ for tool_name, tool in optimized_agent.tools.items():
683+ if tool_name != ' finish' : # Skip the built-in finish tool
684+ print (f " Tool ' { tool_name} ' description: " , tool.desc)
685+ # Tool argument descriptions
686+ print (f " Argument descriptions: " , tool.arg_desc)
689687```
690688
691689### Compatibility with Custom Instruction Proposers
0 commit comments