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

added valid number range #679

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

nikhil-kumar94
Copy link

Title:

  • Valid Number range plugin

Related Issues:

Comment on lines +10 to +12
target: Number,
lowerLimit: Number,
upperLimit: Number
Copy link
Contributor

Choose a reason for hiding this comment

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

Number isn't a type. use number instead.

Comment on lines +14 to +19
try {
return target >= lowerLimit && target <= upperLimit;
} catch (error) {
return false;
}
}
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think this logic is what the expectation is. Ideally plugins are used as part of generation so we must be able to use this rule with generated content. This rule must check weather the generated content (number) is within the range.

use getText function to retrieve the message content and make sure the content is number (or possibly use regex to extract number from the message content) and do validation with the extracted number.

Check existing plugins here: https://github.com/Portkey-AI/gateway/tree/main/plugins/default

@VisargD
Copy link
Collaborator

VisargD commented Nov 8, 2024

Hey @nikhil-kumar94 and @b4s36t4 , is there any blocker for this PR? Please let me know if you have any doubts.

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.

4 participants