-
Notifications
You must be signed in to change notification settings - Fork 536
Refactor/faithfulness template protocol #1462
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Refactor/faithfulness template protocol #1462
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
return f"""Based on the given text, please extract a comprehensive list of FACTUAL, undisputed truths, that can inferred from the provided text. | ||
These truths, MUST BE COHERENT, and CANNOT be taken out of context. | ||
|
||
Example: | ||
Example Text: | ||
Example Text: q |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typo?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, it's a typo thank you for pointing it out!
... | ||
|
||
@staticmethod | ||
def generate_reason(score: float, contradictions: List[str]) -> str: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missed ...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I just updated it
I just opened a PR with an example using Protocol. I believe this approach is more flexible than ABC and makes it much easier for users to define domain-specific evaluation prompt templates. The example has been tested locally with GPT-3.5, and I’ve also fixed the bugs from my previous PR (#1462) everything is working now. Would love your feedback on whether this direction makes sense for DeepEval. |
fixed typo, and added "..." |
Title:
Refactor prompt template into protocol for customizable faithfulness evaluation
Description:
This PR extracts the faithfulness prompt logic into a protocol interface (FaithfulnessTemplateProtocol) to allow easy injection of custom prompt templates. This improves flexibility, code clarity, and enables user-defined behavior.