-
Notifications
You must be signed in to change notification settings - Fork 2.1k
examples: minor tweak on llm_as_a_judge example #1284
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
Conversation
* Introduced `max_attempts` counter to prevent infinite judging loops (defaults to 5) * Added trailing spaces between adjacent string literals for clearer agent prompts * Inserted missing “the” in evaluator instructions for grammatical accuracy
@@ -30,9 +30,9 @@ class EvaluationFeedback: | |||
evaluator = Agent[None]( | |||
name="evaluator", | |||
instructions=( | |||
"You evaluate a story outline and decide if it's good enough." | |||
"If it's not good enough, you provide feedback on what needs to be improved." | |||
"Never give it a pass on the first try. After 5 attempts, you can give it a pass if story outline is good enough - do not go for perfection" |
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.
the instructions allow running 5+ times, so the changes in this PR are inconsistent. if you remove the max_attempts etc., we are happy to merge other changes.
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.
Thanks for pointing that out. The max_attempts
logic has been removed, and only the instruction formatting fixes are kept.
@@ -46,6 +46,8 @@ async def main() -> None: | |||
|
|||
# We'll run the entire workflow in a single trace | |||
with trace("LLM as a judge"): | |||
max_attempts = 5 |
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.
as i mentioned above, please remove this additional logic, which is not necessary
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.
Apologies, I clicked the review request by mistake before reverting the changes.
* Reverted the `max_attempts` safeguard logic to restore the intended behavior of the LLM-as-a-judge pattern. The evaluator instructions use the phrase “After 5 attempts, you *can* give it a pass,” indicating discretion rather than a strict limit. * Retained fixes to instruction string formatting to avoid run-together text (e.g., “input.If there” → “input. If there”). * Corrected a minor grammatical issue by adding “the” before “story outline” for proper English usage.
Uh oh!
There was an error while loading. Please reload this page.