Skip to content

Commit

Permalink
Updates enum var naming strategy (#558)
Browse files Browse the repository at this point in the history
  • Loading branch information
fedefernandez authored Nov 23, 2023
1 parent 0153cc9 commit 954e976
Show file tree
Hide file tree
Showing 54 changed files with 169 additions and 176 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ open class AudioApi : ApiClient {
@SerialName(value = "json") json("json"),
@SerialName(value = "text") text("text"),
@SerialName(value = "srt") srt("srt"),
@SerialName(value = "verbose_json") verboseJson("verbose_json"),
@SerialName(value = "verbose_json") verbose_json("verbose_json"),
@SerialName(value = "vtt") vtt("vtt")
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ open class FilesApi : ApiClient {
@Serializable
enum class PurposeCreateFile(val value: kotlin.String) {

@SerialName(value = "fine-tune") fineMinusTune("fine-tune"),
@SerialName(value = "fine-tune") fine_tune("fine-tune"),
@SerialName(value = "assistants") assistants("assistants")
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ open class ImagesApi : ApiClient {
enum class ResponseFormatCreateImageEdit(val value: kotlin.String) {

@SerialName(value = "url") url("url"),
@SerialName(value = "b64_json") b64Json("b64_json")
@SerialName(value = "b64_json") b64_json("b64_json")
}

/**
Expand Down Expand Up @@ -151,7 +151,7 @@ open class ImagesApi : ApiClient {
enum class ResponseFormatCreateImageVariation(val value: kotlin.String) {

@SerialName(value = "url") url("url"),
@SerialName(value = "b64_json") b64Json("b64_json")
@SerialName(value = "b64_json") b64_json("b64_json")
}

/** enum for parameter size */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,10 @@ data class AssistantFileObject(
/**
* The object type, which is always `assistant.file`.
*
* Values: assistantPeriodFile
* Values: assistant_file
*/
@Serializable
enum class `Object`(val value: kotlin.String) {
@SerialName(value = "assistant.file") assistantPeriodFile("assistant.file")
@SerialName(value = "assistant.file") assistant_file("assistant.file")
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@ data class AssistantObjectToolsInner(
/**
* The type of tool being defined: `code_interpreter`
*
* Values: codeInterpreter,retrieval,function
* Values: code_interpreter,retrieval,function
*/
@Serializable
enum class Type(val value: kotlin.String) {
@SerialName(value = "code_interpreter") codeInterpreter("code_interpreter"),
@SerialName(value = "code_interpreter") code_interpreter("code_interpreter"),
@SerialName(value = "retrieval") retrieval("retrieval"),
@SerialName(value = "function") function("function")
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ data class AssistantToolsCode(
/**
* The type of tool being defined: `code_interpreter`
*
* Values: codeInterpreter
* Values: code_interpreter
*/
@Serializable
enum class Type(val value: kotlin.String) {
@SerialName(value = "code_interpreter") codeInterpreter("code_interpreter")
@SerialName(value = "code_interpreter") code_interpreter("code_interpreter")
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,28 +14,24 @@ import kotlinx.serialization.*
* which models work with the Chat API.
*
* Values:
* gptMinus4Minus1106MinusPreview,gptMinus4MinusVisionMinusPreview,gptMinus4,gptMinus4Minus0314,gptMinus4Minus0613,gptMinus4Minus32k,gptMinus4Minus32kMinus0314,gptMinus4Minus32kMinus0613,gptMinus3Period5MinusTurbo,gptMinus3Period5MinusTurboMinus16k,gptMinus3Period5MinusTurboMinus0301,gptMinus3Period5MinusTurboMinus0613,gptMinus3Period5MinusTurboMinus16kMinus0613
* gpt_4_1106_preview,gpt_4_vision_preview,gpt_4,gpt_4_0314,gpt_4_0613,gpt_4_32k,gpt_4_32k_0314,gpt_4_32k_0613,gpt_3_5_turbo,gpt_3_5_turbo_16k,gpt_3_5_turbo_0301,gpt_3_5_turbo_0613,gpt_3_5_turbo_16k_0613
*/
@Serializable
enum class CreateChatCompletionRequestModel(val value: kotlin.String) {

@SerialName(value = "gpt-4-1106-preview") gptMinus4Minus1106MinusPreview("gpt-4-1106-preview"),
@SerialName(value = "gpt-4-vision-preview")
gptMinus4MinusVisionMinusPreview("gpt-4-vision-preview"),
@SerialName(value = "gpt-4") gptMinus4("gpt-4"),
@SerialName(value = "gpt-4-0314") gptMinus4Minus0314("gpt-4-0314"),
@SerialName(value = "gpt-4-0613") gptMinus4Minus0613("gpt-4-0613"),
@SerialName(value = "gpt-4-32k") gptMinus4Minus32k("gpt-4-32k"),
@SerialName(value = "gpt-4-32k-0314") gptMinus4Minus32kMinus0314("gpt-4-32k-0314"),
@SerialName(value = "gpt-4-32k-0613") gptMinus4Minus32kMinus0613("gpt-4-32k-0613"),
@SerialName(value = "gpt-3.5-turbo") gptMinus3Period5MinusTurbo("gpt-3.5-turbo"),
@SerialName(value = "gpt-3.5-turbo-16k") gptMinus3Period5MinusTurboMinus16k("gpt-3.5-turbo-16k"),
@SerialName(value = "gpt-3.5-turbo-0301")
gptMinus3Period5MinusTurboMinus0301("gpt-3.5-turbo-0301"),
@SerialName(value = "gpt-3.5-turbo-0613")
gptMinus3Period5MinusTurboMinus0613("gpt-3.5-turbo-0613"),
@SerialName(value = "gpt-3.5-turbo-16k-0613")
gptMinus3Period5MinusTurboMinus16kMinus0613("gpt-3.5-turbo-16k-0613");
@SerialName(value = "gpt-4-1106-preview") gpt_4_1106_preview("gpt-4-1106-preview"),
@SerialName(value = "gpt-4-vision-preview") gpt_4_vision_preview("gpt-4-vision-preview"),
@SerialName(value = "gpt-4") gpt_4("gpt-4"),
@SerialName(value = "gpt-4-0314") gpt_4_0314("gpt-4-0314"),
@SerialName(value = "gpt-4-0613") gpt_4_0613("gpt-4-0613"),
@SerialName(value = "gpt-4-32k") gpt_4_32k("gpt-4-32k"),
@SerialName(value = "gpt-4-32k-0314") gpt_4_32k_0314("gpt-4-32k-0314"),
@SerialName(value = "gpt-4-32k-0613") gpt_4_32k_0613("gpt-4-32k-0613"),
@SerialName(value = "gpt-3.5-turbo") gpt_3_5_turbo("gpt-3.5-turbo"),
@SerialName(value = "gpt-3.5-turbo-16k") gpt_3_5_turbo_16k("gpt-3.5-turbo-16k"),
@SerialName(value = "gpt-3.5-turbo-0301") gpt_3_5_turbo_0301("gpt-3.5-turbo-0301"),
@SerialName(value = "gpt-3.5-turbo-0613") gpt_3_5_turbo_0613("gpt-3.5-turbo-0613"),
@SerialName(value = "gpt-3.5-turbo-16k-0613") gpt_3_5_turbo_16k_0613("gpt-3.5-turbo-16k-0613");

/**
* Override [toString()] to avoid using the enum variable name as the value, and instead use the
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,11 @@ data class CreateChatCompletionRequestResponseFormat(
/**
* Must be one of `text` or `json_object`.
*
* Values: text,jsonObject
* Values: text,json_object
*/
@Serializable
enum class Type(val value: kotlin.String) {
@SerialName(value = "text") text("text"),
@SerialName(value = "json_object") jsonObject("json_object")
@SerialName(value = "json_object") json_object("json_object")
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,10 @@ data class CreateChatCompletionResponse(
/**
* The object type, which is always `chat.completion`.
*
* Values: chatPeriodCompletion
* Values: chat_completion
*/
@Serializable
enum class `Object`(val value: kotlin.String) {
@SerialName(value = "chat.completion") chatPeriodCompletion("chat.completion")
@SerialName(value = "chat.completion") chat_completion("chat.completion")
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,14 @@ data class CreateChatCompletionResponseChoicesInner(
* filters, `tool_calls` if the model called a tool, or `function_call` (deprecated) if the model
* called a function.
*
* Values: stop,lengthType,toolCalls,contentFilter,functionCall
* Values: stop,length_type,tool_calls,content_filter,function_call
*/
@Serializable
enum class FinishReason(val value: kotlin.String) {
@SerialName(value = "stop") stop("stop"),
@SerialName(value = "length") lengthType("length"),
@SerialName(value = "tool_calls") toolCalls("tool_calls"),
@SerialName(value = "content_filter") contentFilter("content_filter"),
@SerialName(value = "function_call") functionCall("function_call")
@SerialName(value = "length") length_type("length"),
@SerialName(value = "tool_calls") tool_calls("tool_calls"),
@SerialName(value = "content_filter") content_filter("content_filter"),
@SerialName(value = "function_call") function_call("function_call")
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,10 @@ data class CreateChatCompletionStreamResponse(
/**
* The object type, which is always `chat.completion.chunk`.
*
* Values: chatPeriodCompletionPeriodChunk
* Values: chat_completion_chunk
*/
@Serializable
enum class `Object`(val value: kotlin.String) {
@SerialName(value = "chat.completion.chunk")
chatPeriodCompletionPeriodChunk("chat.completion.chunk")
@SerialName(value = "chat.completion.chunk") chat_completion_chunk("chat.completion.chunk")
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,14 @@ data class CreateChatCompletionStreamResponseChoicesInner(
* filters, `tool_calls` if the model called a tool, or `function_call` (deprecated) if the model
* called a function.
*
* Values: stop,lengthType,toolCalls,contentFilter,functionCall
* Values: stop,length_type,tool_calls,content_filter,function_call
*/
@Serializable
enum class FinishReason(val value: kotlin.String) {
@SerialName(value = "stop") stop("stop"),
@SerialName(value = "length") lengthType("length"),
@SerialName(value = "tool_calls") toolCalls("tool_calls"),
@SerialName(value = "content_filter") contentFilter("content_filter"),
@SerialName(value = "function_call") functionCall("function_call")
@SerialName(value = "length") length_type("length"),
@SerialName(value = "tool_calls") tool_calls("tool_calls"),
@SerialName(value = "content_filter") content_filter("content_filter"),
@SerialName(value = "function_call") function_call("function_call")
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,22 +14,21 @@ import kotlinx.serialization.*
* of them.
*
* Values:
* babbageMinus002,davinciMinus002,gptMinus3Period5MinusTurboMinusInstruct,textMinusDavinciMinus003,textMinusDavinciMinus002,textMinusDavinciMinus001,codeMinusDavinciMinus002,textMinusCurieMinus001,textMinusBabbageMinus001,textMinusAdaMinus001
* babbage_002,davinci_002,gpt_3_5_turbo_instruct,text_davinci_003,text_davinci_002,text_davinci_001,code_davinci_002,text_curie_001,text_babbage_001,text_ada_001
*/
@Serializable
enum class CreateCompletionRequestModel(val value: kotlin.String) {

@SerialName(value = "babbage-002") babbageMinus002("babbage-002"),
@SerialName(value = "davinci-002") davinciMinus002("davinci-002"),
@SerialName(value = "gpt-3.5-turbo-instruct")
gptMinus3Period5MinusTurboMinusInstruct("gpt-3.5-turbo-instruct"),
@SerialName(value = "text-davinci-003") textMinusDavinciMinus003("text-davinci-003"),
@SerialName(value = "text-davinci-002") textMinusDavinciMinus002("text-davinci-002"),
@SerialName(value = "text-davinci-001") textMinusDavinciMinus001("text-davinci-001"),
@SerialName(value = "code-davinci-002") codeMinusDavinciMinus002("code-davinci-002"),
@SerialName(value = "text-curie-001") textMinusCurieMinus001("text-curie-001"),
@SerialName(value = "text-babbage-001") textMinusBabbageMinus001("text-babbage-001"),
@SerialName(value = "text-ada-001") textMinusAdaMinus001("text-ada-001");
@SerialName(value = "babbage-002") babbage_002("babbage-002"),
@SerialName(value = "davinci-002") davinci_002("davinci-002"),
@SerialName(value = "gpt-3.5-turbo-instruct") gpt_3_5_turbo_instruct("gpt-3.5-turbo-instruct"),
@SerialName(value = "text-davinci-003") text_davinci_003("text-davinci-003"),
@SerialName(value = "text-davinci-002") text_davinci_002("text-davinci-002"),
@SerialName(value = "text-davinci-001") text_davinci_001("text-davinci-001"),
@SerialName(value = "code-davinci-002") code_davinci_002("code-davinci-002"),
@SerialName(value = "text-curie-001") text_curie_001("text-curie-001"),
@SerialName(value = "text-babbage-001") text_babbage_001("text-babbage-001"),
@SerialName(value = "text-ada-001") text_ada_001("text-ada-001");

/**
* Override [toString()] to avoid using the enum variable name as the value, and instead use the
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,10 @@ data class CreateCompletionResponse(
/**
* The object type, which is always \"text_completion\"
*
* Values: textCompletion
* Values: text_completion
*/
@Serializable
enum class `Object`(val value: kotlin.String) {
@SerialName(value = "text_completion") textCompletion("text_completion")
@SerialName(value = "text_completion") text_completion("text_completion")
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,12 @@ data class CreateCompletionResponseChoicesInner(
* the request was reached, or `content_filter` if content was omitted due to a flag from our
* content filters.
*
* Values: stop,lengthType,contentFilter
* Values: stop,length_type,content_filter
*/
@Serializable
enum class FinishReason(val value: kotlin.String) {
@SerialName(value = "stop") stop("stop"),
@SerialName(value = "length") lengthType("length"),
@SerialName(value = "content_filter") contentFilter("content_filter")
@SerialName(value = "length") length_type("length"),
@SerialName(value = "content_filter") content_filter("content_filter")
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,13 @@ import kotlinx.serialization.*
* ID of the model to use. You can use the `text-davinci-edit-001` or `code-davinci-edit-001` model
* with this endpoint.
*
* Values: textMinusDavinciMinusEditMinus001,codeMinusDavinciMinusEditMinus001
* Values: text_davinci_edit_001,code_davinci_edit_001
*/
@Serializable
enum class CreateEditRequestModel(val value: kotlin.String) {

@SerialName(value = "text-davinci-edit-001")
textMinusDavinciMinusEditMinus001("text-davinci-edit-001"),
@SerialName(value = "code-davinci-edit-001")
codeMinusDavinciMinusEditMinus001("code-davinci-edit-001");
@SerialName(value = "text-davinci-edit-001") text_davinci_edit_001("text-davinci-edit-001"),
@SerialName(value = "code-davinci-edit-001") code_davinci_edit_001("code-davinci-edit-001");

/**
* Override [toString()] to avoid using the enum variable name as the value, and instead use the
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,11 @@ data class CreateEditResponseChoicesInner(
* the request was reached, or `content_filter` if content was omitted due to a flag from our
* content filters.
*
* Values: stop,lengthType
* Values: stop,length_type
*/
@Serializable
enum class FinishReason(val value: kotlin.String) {
@SerialName(value = "stop") stop("stop"),
@SerialName(value = "length") lengthType("length")
@SerialName(value = "length") length_type("length")
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,12 @@ import kotlinx.serialization.*
* all of your available models, or see our [Model overview](/docs/models/overview) for descriptions
* of them.
*
* Values: textMinusEmbeddingMinusAdaMinus002
* Values: text_embedding_ada_002
*/
@Serializable
enum class CreateEmbeddingRequestModel(val value: kotlin.String) {

@SerialName(value = "text-embedding-ada-002")
textMinusEmbeddingMinusAdaMinus002("text-embedding-ada-002");
@SerialName(value = "text-embedding-ada-002") text_embedding_ada_002("text-embedding-ada-002");

/**
* Override [toString()] to avoid using the enum variable name as the value, and instead use the
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@ import kotlinx.serialization.*
* The name of the model to fine-tune. You can select one of the
* [supported models](/docs/guides/fine-tuning/what-models-can-be-fine-tuned).
*
* Values: babbageMinus002,davinciMinus002,gptMinus3Period5MinusTurbo
* Values: babbage_002,davinci_002,gpt_3_5_turbo
*/
@Serializable
enum class CreateFineTuningJobRequestModel(val value: kotlin.String) {

@SerialName(value = "babbage-002") babbageMinus002("babbage-002"),
@SerialName(value = "davinci-002") davinciMinus002("davinci-002"),
@SerialName(value = "gpt-3.5-turbo") gptMinus3Period5MinusTurbo("gpt-3.5-turbo");
@SerialName(value = "babbage-002") babbage_002("babbage-002"),
@SerialName(value = "davinci-002") davinci_002("davinci-002"),
@SerialName(value = "gpt-3.5-turbo") gpt_3_5_turbo("gpt-3.5-turbo");

/**
* Override [toString()] to avoid using the enum variable name as the value, and instead use the
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ import kotlinx.serialization.*
/**
* The model to use for image generation. Only `dall-e-2` is supported at this time.
*
* Values: dallMinusEMinus2
* Values: dall_e_2
*/
@Serializable
enum class CreateImageEditRequestModel(val value: kotlin.String) {

@SerialName(value = "dall-e-2") dallMinusEMinus2("dall-e-2");
@SerialName(value = "dall-e-2") dall_e_2("dall-e-2");

/**
* Override [toString()] to avoid using the enum variable name as the value, and instead use the
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,12 +73,12 @@ data class CreateImageRequest(
/**
* The format in which the generated images are returned. Must be one of `url` or `b64_json`.
*
* Values: url,b64Json
* Values: url,b64_json
*/
@Serializable
enum class ResponseFormat(val value: kotlin.String) {
@SerialName(value = "url") url("url"),
@SerialName(value = "b64_json") b64Json("b64_json")
@SerialName(value = "b64_json") b64_json("b64_json")
}
/**
* The size of the generated images. Must be one of `256x256`, `512x512`, or `1024x1024` for
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@ import kotlinx.serialization.*
/**
* The model to use for image generation.
*
* Values: dallMinusEMinus2,dallMinusEMinus3
* Values: dall_e_2,dall_e_3
*/
@Serializable
enum class CreateImageRequestModel(val value: kotlin.String) {

@SerialName(value = "dall-e-2") dallMinusEMinus2("dall-e-2"),
@SerialName(value = "dall-e-3") dallMinusEMinus3("dall-e-3");
@SerialName(value = "dall-e-2") dall_e_2("dall-e-2"),
@SerialName(value = "dall-e-3") dall_e_3("dall-e-3");

/**
* Override [toString()] to avoid using the enum variable name as the value, and instead use the
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,13 @@ import kotlinx.serialization.*
* `text-moderation-stable`, we will provide advanced notice before updating the model. Accuracy of
* `text-moderation-stable` may be slightly lower than for `text-moderation-latest`.
*
* Values: textMinusModerationMinusLatest,textMinusModerationMinusStable
* Values: text_moderation_latest,text_moderation_stable
*/
@Serializable
enum class CreateModerationRequestModel(val value: kotlin.String) {

@SerialName(value = "text-moderation-latest")
textMinusModerationMinusLatest("text-moderation-latest"),
@SerialName(value = "text-moderation-stable")
textMinusModerationMinusStable("text-moderation-stable");
@SerialName(value = "text-moderation-latest") text_moderation_latest("text-moderation-latest"),
@SerialName(value = "text-moderation-stable") text_moderation_stable("text-moderation-stable");

/**
* Override [toString()] to avoid using the enum variable name as the value, and instead use the
Expand Down
Loading

0 comments on commit 954e976

Please sign in to comment.