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

Feat - Implemented BinaryParam SDK type #1052

Merged
merged 11 commits into from
Dec 19, 2023
Merged

Conversation

aybruhm
Copy link
Member

@aybruhm aybruhm commented Dec 14, 2023

Descrtiption

This PR accomplishes the following:

  • Designs a metaclass to manage the behavior of a boolean without direct inheritance
  • Creates a new sdk type that inherits from the above metaclass and int
  • Modifies the frontend openapi parser to identify the sdk type with its x-param
  • Updates the frontend playground to use a switch toggle widget if a binaryparam (boolean) type is used

Related Issue

Closes #1044

@aybruhm aybruhm marked this pull request as ready for review December 15, 2023 07:39
@aybruhm aybruhm requested a review from MohammedMaaz December 19, 2023 08:52
Copy link
Member

@mmabrouk mmabrouk left a comment

Choose a reason for hiding this comment

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

Thanks for the PR @aybruhm

@mmabrouk mmabrouk merged commit 3d43dcd into main Dec 19, 2023
8 checks passed
Copy link
Member

@mmabrouk mmabrouk left a comment

Choose a reason for hiding this comment

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

@aybruhm I just noticed an issue while writing the documentation for this. There is no way to set the default state of the binaryparam when initializing it!

I would expect to be able to use it this way

agenta.config.default(force_json=BinaryParam(False))

@aybruhm
Copy link
Member Author

aybruhm commented Dec 19, 2023

@aybruhm I just noticed an issue while writing the documentation for this. There is no way to set the default state of the binaryparam when initializing it!

I would expect to be able to use it this way

agenta.config.default(force_json=BinaryParam(False))

Initializing the class will still set the default value (False), but I have modified the behavior of the SDK to align with your suggestion.

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.

Add toggle input parameter to the SDK
3 participants