commonMain.com.xebia.functional.openai.generated.model.CreateTranscriptionRequestModel.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of xef-openai-client Show documentation
Show all versions of xef-openai-client Show documentation
Building applications with LLMs through composability in Kotlin
The newest version!
/**
*
* Please note:
* This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* Do not edit this file manually.
*
*/
@file:Suppress(
"ArrayInDataClass",
"EnumEntryName",
"RemoveRedundantQualifierName",
"UnusedImport"
)
package com.xebia.functional.openai.generated.model
import kotlinx.serialization.*
import kotlinx.serialization.builtins.*
import kotlinx.serialization.encoding.*
import kotlin.jvm.JvmStatic
import com.xebia.functional.openai.generated.model.CreateTranscriptionRequestModel.Supported.whisper_1
/**
* ID of the model to use. Only `whisper-1` (which is powered by our open source Whisper V2 model) is currently available.
*/
// We define a serializer for the parent sum type, and then use it to serialize the child types
@Suppress("SERIALIZER_TYPE_INCOMPATIBLE")
@Serializable(with = CreateTranscriptionRequestModelSerializer::class)
sealed interface CreateTranscriptionRequestModel {
val value: kotlin.String
@Serializable(with = CreateTranscriptionRequestModelSerializer::class)
enum class Supported(override val value: kotlin.String) : CreateTranscriptionRequestModel {
@SerialName(value = "whisper-1") whisper_1("whisper-1");
override fun toString(): kotlin.String = value
}
@Serializable(with = CreateTranscriptionRequestModelSerializer::class)
data class Custom(override val value: kotlin.String) : CreateTranscriptionRequestModel
companion object {
@JvmStatic
fun valueOf(value: kotlin.String): CreateTranscriptionRequestModel =
values().firstOrNull { it.value == value } ?: Custom(value)
inline val whisper_1: CreateTranscriptionRequestModel
get() = Supported.whisper_1
@JvmStatic fun values(): List = Supported.entries
}
}
object CreateTranscriptionRequestModelSerializer : KSerializer {
private val valueSerializer = kotlin.String.serializer()
override val descriptor = valueSerializer.descriptor
override fun deserialize(decoder: Decoder): CreateTranscriptionRequestModel {
val value = decoder.decodeSerializableValue(valueSerializer)
return CreateTranscriptionRequestModel.valueOf(value)
}
override fun serialize(encoder: Encoder, value: CreateTranscriptionRequestModel) {
encoder.encodeSerializableValue(valueSerializer, value.value)
}
}