-
Notifications
You must be signed in to change notification settings - Fork 2
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
OpenAPI revisions for compatibility with Fern SDK generator #422
base: master
Are you sure you want to change the base?
Conversation
…to generated named Enums" This reverts commit 9d99420.
We use plural models everywhere else
We have a different name vs api_value for SerpSearchLocation
do we really need this huge refactor of all enums? |
in any case if this can be broken up between the auth header and the enum that would be greatly appreciated |
I used Where it was something else, I have used |
Do we need the enum for fern to generate the |
By default, Fern will generate types like CompareLLMSelectedModelsItem = typing.Union[typing.Literal[...], typing.Any] Giving an Enum type lets us customize this name because fastapi will generate an OpenAPI component with the name inferred from the Enum's name. By default, Literals will create a new OpenAPI Enum type for each input, and each will have its own different name. |
Separated into this and #465 |
I have tested all the affected recipes in this PR - the UX names, API names, and their use in The nice thing with the refactor is that it doesn't affect how the value is stored in state, or passed down to the |
Change Summary
authnewAPIAuth
class that inherits fromfastapi.security.base.SecurityBase
(refactored into this fromapi_auth_header
to output OpenAPI with bearer scheme)renameauth_keyword
toauth_scheme
get_openapi_extra
classmethod toBasePage
sdk_method_name
class attribute toBasePage
x-fern-ignore
API endpoints that shouldn't be present in SDKText2ImgModels
toTextToImageModels
for parity with SDK namesImg2ImgModels
toImageToImageModels
for parity with SDK namesLipsyncModel
toLipsyncModels
(plural) for consistency with rest of model classesGooeyEnum
api_enum
class property forGooeyEnum
that creates a dynamic enum mapping fromapi_value
->api_value
(default,name
->name
)api_choices
in favor ofapi_enum
GooeyEnum
forAnimationModels
AsrModels
TextToImageModels
ImageToImageModels
SegmentationModels
UpscalerModels
ControlNetModels
AsrOutputFormat
CitationStyles
Schedulers
TextToSpeechProviders
TextToAudioModels
CombineDocumentChainType
SerpSearchType
SerpSearchLocations
Q/A checklist
You can visualize this using tuna:
To measure import time for a specific library:
To reduce import times, import libraries that take a long time inside the functions that use them instead of at the top of the file:
Legal Boilerplate
Look, I get it. The entity doing business as “Gooey.AI” and/or “Dara.network” was incorporated in the State of Delaware in 2020 as Dara Network Inc. and is gonna need some rights from me in order to utilize my contributions in this PR. So here's the deal: I retain all rights, title and interest in and to my contributions, and by keeping this boilerplate intact I confirm that Dara Network Inc can use, modify, copy, and redistribute my contributions, under its choice of terms.