Skip to content

adding in the openai integration#338

Merged
xzrderek merged 5 commits intomainfrom
derekx/openai-integration
Nov 19, 2025
Merged

adding in the openai integration#338
xzrderek merged 5 commits intomainfrom
derekx/openai-integration

Conversation

@xzrderek
Copy link
Contributor

@xzrderek xzrderek commented Nov 18, 2025

Note

Adds OpenAI RFT integration to convert Eval Protocol evaluation functions into Python grader specs, plus example usage and tests.

  • Integrations:
    • Add eval_protocol/integrations/openai_rft.py with build_python_grader_from_evaluation_test to convert evaluation-style functions into OpenAI Python grader specs by:
      • Stripping decorators/annotations via AST, renaming to _ep_eval, and embedding helper types (EvaluationRow, EvaluateResult, Message).
      • Building grade(sample, item) that maps item/sample to a duck-typed row and normalizes outputs to a float score.
    • Export in eval_protocol/integrations/__init__.py.
  • Examples:
    • examples/openai_rft/example_rapidfuzz.py: demo @evaluation_test using RapidFuzz and conversion to grader.
    • examples/openai_rft/test_openai_grader.py: script to validate/run the grader via OpenAI API.
  • Tests:
    • tests/test_openai_rft_integration.py: verifies grader generation from plain and wrapped functions and correct scoring behavior.

Written by Cursor Bugbot for commit 6fc1c36. This will update automatically on new commits. Configure here.

@xzrderek xzrderek requested review from benjibc and dphuang2 November 18, 2025 09:51
except Exception:
pass

return 0.0
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: Unhandled Exceptions Propagate, Crashing Evaluation

The call to _ep_eval on line 152 is outside the try-except block, so exceptions raised by the user's evaluation function will not be caught. Only normalization errors are caught, allowing crashes from the evaluation logic to propagate instead of gracefully returning 0.0 as intended.

Fix in Cursor Fix in Web

Copy link
Collaborator

@dphuang2 dphuang2 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

great!

@xzrderek xzrderek merged commit 2d46f12 into main Nov 19, 2025
9 checks passed
@xzrderek xzrderek deleted the derekx/openai-integration branch November 19, 2025 07:58
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.

2 participants