You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I had in my mind a feature request to allow to specify custom factory names, which (together with the already implemented titles) would be the ultimate piece for full customization support.
My idea was to use Specification Extensions to define the factory name in the schema (e.g. using something like x-factoryName):
function_call:
title: ChatCompletionFunctionCalldescription: Controls how the model calls functions.oneOf:
- type: stringtitle: ChatCompletionFunctionCallModex-factoryName: modeenum: [none, auto]
- $ref: "#/components/schemas/ChatCompletionFunctionCallOption"ChatCompletionFunctionCallOption:
type: objectx-factoryName: functionCallOptionproperties:
name:
type: stringdescription: The name of the function to call.required:
- name
> My idea was to use [Specification Extensions](https://swagger.io/specification/#specification-extensions) to define the factory name in the schema (e.g. using something like `x-factoryName`):
Yea this package does not introduce any sort of package specific customization like that. The idea was to just be compatible with any API schema out of the box, without introducing any extra dependency or custom definitions.
@davidmigloz alternatively, we can do it at the code generation level with an onUnionConstructorName function that would allow a user to override the constructor of a specific union. Feel free to open an issue and we can move that chat there.
I see your point, it may be better to do it at the code generation level to keep the spec pure and clean. onUnionConstructorName sounds like a good idea, in line with the other functions.
I had in my mind a feature request to allow to specify custom factory names, which (together with the already implemented titles) would be the ultimate piece for full customization support.
My idea was to use Specification Extensions to define the factory name in the schema (e.g. using something like
x-factoryName
):Originally posted by @davidmigloz in #32 (comment)
Yea this package does not introduce any sort of package specific customization like that. The idea was to just be compatible with any API schema out of the box, without introducing any extra dependency or custom definitions.
@davidmigloz alternatively, we can do it at the code generation level with an
onUnionConstructorName
function that would allow a user to override the constructor of a specific union. Feel free to open an issue and we can move that chat there.Will cut a new release with these changes.
Originally posted by @walsha2 in #32 (comment)
The text was updated successfully, but these errors were encountered: