-
Notifications
You must be signed in to change notification settings - Fork 5
Allow chain/chain_id to take str/int and convert to int #12
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
@@ -0,0 +1,12 @@ | |||
def normalize_chain_id( |
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.
was wondering if we should just keep it simple by regexp digits or just throw if chain_id
is not is_digit?
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.
I think regex to extract makes sense, to avoid other edge cases where the model may do something like "Chain ID: 1". It does make sense to throw then is_digit = False, but I think for something like this it might be best to just post process the llm outputs a little.
Adds a normalization function that converts strings to int, and removes quotes. Also less strict type checking, allowing str/int.