Open nikochiko opened 2 months ago
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
do we really need this huge refactor of all enums?
I used GooeyEnum
where we were already using Enums or TextChoices per https://github.com/GooeyAI/gooey-server/discussions/393. That was an easier change and consistent with this discussion.
Where it was something else, I have used x-fern-type-name
to not make new Enums.
do we really need this huge refactor of all enums?
I used
GooeyEnum
where we were already using Enums or TextChoices per https://github.com/GooeyAI/gooey-server/discussions/393. That was an easier change and consistent with this discussion.Where it was something else, I have used
x-fern-type-name
to not make new Enums.
Do we need the enum for fern to generate the literal | str
type annotation? The enum refactor is nice but i think it would need a lot of testing to pass the review
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 https://github.com/GooeyAI/gooey-server/pull/465
The enum refactor is nice but i think it would need a lot of testing to pass the review
I have tested all the affected recipes in this PR - the UX names, API names, and their use in run
& run_v2
- with different models and settings.
The nice thing with the refactor is that it doesn't affect how the value is stored in state, or passed down to the run
method of each recipe. So that logic doesn't need any changes (I have still tested, and fixed where this wasn't the case).
The automated tests already guarantee that all pages load with 200, sane_defaults
work as before. We can continue testing like before manually after deployment, and also revert easily in case anything is breaking (because no migrations).
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
To measure import time for a specific library:
Executed in 1.15 secs fish external usr time 2.22 secs 86.00 micros 2.22 secs sys time 0.72 secs 613.00 micros 0.72 secs
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.