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

Support both string and integer types for duration in TranslationVerbose #2034

Closed
wants to merge 1 commit into from

Conversation

Programmer-RD-AI
Copy link

This update enhances the TranslationVerbose model by supporting both string and integer types for the duration field:

  • Changed: Updated the duration field type to Union[str, int] to allow both formats.
  • Added: A __post_init__ method to ensure consistent handling of integer durations by converting them to strings internally.

This change addresses potential usability issues where the duration might be provided as an integer but was previously expected as a string.

Impact: Improves flexibility and usability for the TranslationVerbose model.

  • I understand that this repository is auto-generated and my pull request may not be merged

Changes Being Requested

Support for both string and integer values in the duration field of the TranslationVerbose model.

Additional Context & Links

…ose.

This update enhances the `TranslationVerbose` model by supporting both string and integer types for the `duration` field:

- **Changed**: Updated the `duration` field type to `Union[str, int]` to allow both formats.
- **Added**: A `__post_init__` method to ensure consistent handling of integer durations by converting them to strings internally.

This change addresses potential usability issues where the duration might be provided as an integer but was previously expected as a string.

**Impact**: Improves flexibility and usability for the `TranslationVerbose` model.
@RobertCraigie
Copy link
Collaborator

Thanks for the PR but the fact that it is a str is a bug, we should just be using a number type. I'll get this fixed on our end.

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