Description:
Instrument formatter operations to provide visibility into template rendering and response parsing.
Detailed Requirements:
- Add spans for formatter operations:
formatter.apply - Overall formatter application
formatter.render_prompt - Prompt template rendering
formatter.parse_response - Response parsing/extraction
- Add attributes:
formatter_type - Class name of formatter
template_name - Template identifier if applicable
input_length - Input character count
output_length - Output character count
- Handle multiple formatter types in codebase
- Capture parsing errors as span events
Files to Modify:
mellea/stdlib/formatters/ - Instrument formatter classes
mellea/core/formatter.py - Base formatter instrumentation
Acceptance Criteria:
Description:
Instrument formatter operations to provide visibility into template rendering and response parsing.
Detailed Requirements:
formatter.apply- Overall formatter applicationformatter.render_prompt- Prompt template renderingformatter.parse_response- Response parsing/extractionformatter_type- Class name of formattertemplate_name- Template identifier if applicableinput_length- Input character countoutput_length- Output character countFiles to Modify:
mellea/stdlib/formatters/- Instrument formatter classesmellea/core/formatter.py- Base formatter instrumentationAcceptance Criteria: