Skip to content
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

Fixes argument order for custom code evaluator #1690

Merged
merged 1 commit into from
May 21, 2024

Conversation

LucasTrg
Copy link
Contributor

@LucasTrg LucasTrg commented May 21, 2024

Hey, I noticed arguments were fed out of order for custom code evaluators.
This is the template for the proposed custom evaluator

from typing import Dict

def evaluate(
    app_params: Dict[str, str],
    inputs: Dict[str, str],
    output: str,
    correct_answer: str
) -> float:
    # ...
    return 0.75  # Replace with your calculated score

But currently evaluators are invoked with result = environment["evaluate"](app_params, inputs, correct_answer, output)
To me the argument order in the template makes more sense, but it might not be backward compatible for people that worked around it by modifying the signature of the "evaluate" method.
Let me know which options sounds best to you and I can expand the PR in the desired direction :)

@dosubot dosubot bot added the size:XS This PR changes 0-9 lines, ignoring generated files. label May 21, 2024
Copy link

vercel bot commented May 21, 2024

@LucasTrg is attempting to deploy a commit to the mmabrouk's projects Team on Vercel.

A member of the Team first needs to authorize it.

@dosubot dosubot bot added Backend bug Something isn't working python Pull requests that update Python code labels May 21, 2024
@mmabrouk mmabrouk requested review from aakrem and aybruhm May 21, 2024 11:29
Copy link
Member

@aybruhm aybruhm left a comment

Choose a reason for hiding this comment

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

You're right! Thanks for catching that, @LucasTrg!

Copy link

vercel bot commented May 21, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
agenta ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 21, 2024 5:46pm

@mmabrouk
Copy link
Member

@all-contributors please add @LucasTrg for code and bug fix

Copy link
Contributor

@mmabrouk

I've put up a pull request to add @LucasTrg! 🎉

@mmabrouk
Copy link
Member

Thanks @LucasTrg !

@mmabrouk mmabrouk merged commit 207aaf9 into Agenta-AI:main May 21, 2024
10 of 13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Backend bug Something isn't working lgtm This PR has been approved by a maintainer python Pull requests that update Python code size:XS This PR changes 0-9 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants