Skip to content

Conversation

kanishk2106
Copy link

@kanishk2106 kanishk2106 commented Oct 5, 2025

This PR improves validation in FeedbackConfigModel to ensure stricter feedback configuration and better error handling.

Changes:

  1. Enforce type field as a required field in FeedbackConfigModel.
  2. Add validation to reject unknown fields using a model_validator before model creation.
  3. Update test cases in test_feedback_config.py to cover:
  4. Valid and invalid configurations
  5. Missing type handling
  6. Extra fields detection
  7. Literal enforcement and category validation

Tests
All tests pass successfully:
pytest tests/evaluation/test_feedback_config.py -v
8 passed in 0.02s
All validation scenarios covered (valid, invalid, missing type, extra fields, literal enforcement).

Notes
This change is backward-compatible and designed to work seamlessly alongside existing pydantic.v1 usage in the repository.

Issue Fixed

Fixes #31802

@kanishk2106
Copy link
Author

Hi, This PR is ready for review — would appreciate feedback from the maintainers!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant