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

Bugfix for empty string validation #621

Merged
merged 2 commits into from
Mar 11, 2024
Merged

Bugfix for empty string validation #621

merged 2 commits into from
Mar 11, 2024

Conversation

thekaranacharya
Copy link
Contributor

@thekaranacharya thekaranacharya commented Mar 11, 2024

  • Fixes this [bug] ToxicLanguage doesn't work with streaming and OpenAI  #619
  • Was previously always returning None as error for StringSchema's parse() method. This allowed even empty strings/None to fail validators which expect only non-empty strings.
  • Solution: Return True as error if empty string, else False -> This will enable move_to_next here: and will continue until a non-empty string is found.

@thekaranacharya thekaranacharya changed the title Bugfix #619 Bugfix for empty string validation Mar 11, 2024
@thekaranacharya thekaranacharya self-assigned this Mar 11, 2024
@thekaranacharya
Copy link
Contributor Author

Tested both with and without streaming for strings, works!

@thekaranacharya thekaranacharya merged commit 83dee2d into main Mar 11, 2024
60 checks passed
@thekaranacharya thekaranacharya deleted the karan/bugfix-619 branch March 11, 2024 19:13
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