Skip to content

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

Merged
merged 12 commits into from
Mar 24, 2025
Merged

Conversation

cjber
Copy link
Contributor

@cjber cjber commented Mar 21, 2025

Adds a normalization function that converts strings to int, and removes quotes. Also less strict type checking, allowing str/int.

@@ -0,0 +1,12 @@
def normalize_chain_id(
Copy link
Member

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?

Copy link
Contributor Author

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.

@cjber cjber force-pushed the cb/chain_id_type branch from 2148435 to 6414e0a Compare March 24, 2025 12:26
@cjber cjber merged commit a4713ac into main Mar 24, 2025
2 checks passed
@cjber cjber deleted the cb/chain_id_type branch March 24, 2025 14:43
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.

2 participants