commonMain.com.xebia.functional.openai.generated.model.RunStepDeltaStepDetailsToolCallsCodeObjectCodeInterpreterOutputsInner.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-jvm Show documentation
Show all versions of xef-openai-client-jvm Show documentation
Building applications with LLMs through composability in Kotlin
/**
*
* 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 com.xebia.functional.openai.generated.model.RunStepDeltaStepDetailsToolCallsCodeOutputImageObject
import com.xebia.functional.openai.generated.model.RunStepDeltaStepDetailsToolCallsCodeOutputImageObjectImage
import com.xebia.functional.openai.generated.model.RunStepDeltaStepDetailsToolCallsCodeOutputLogsObject
import com.xebia.functional.openai.attemptDeserialize
import kotlin.jvm.JvmInline
import kotlinx.serialization.*
import kotlinx.serialization.builtins.*
import kotlinx.serialization.descriptors.*
import kotlinx.serialization.encoding.*
import kotlinx.serialization.json.*
@Serializable(with = RunStepDeltaStepDetailsToolCallsCodeObjectCodeInterpreterOutputsInnerSerializer::class)
sealed interface RunStepDeltaStepDetailsToolCallsCodeObjectCodeInterpreterOutputsInner {
@JvmInline
@Serializable
value class CaseRunStepDeltaStepDetailsToolCallsCodeOutputImageObject(val value: RunStepDeltaStepDetailsToolCallsCodeOutputImageObject): RunStepDeltaStepDetailsToolCallsCodeObjectCodeInterpreterOutputsInner
@JvmInline
@Serializable
value class CaseRunStepDeltaStepDetailsToolCallsCodeOutputLogsObject(val value: RunStepDeltaStepDetailsToolCallsCodeOutputLogsObject): RunStepDeltaStepDetailsToolCallsCodeObjectCodeInterpreterOutputsInner
}
object RunStepDeltaStepDetailsToolCallsCodeObjectCodeInterpreterOutputsInnerSerializer : KSerializer {
@OptIn(InternalSerializationApi::class, ExperimentalSerializationApi::class)
override val descriptor: SerialDescriptor = buildSerialDescriptor("RunStepDeltaStepDetailsToolCallsCodeObjectCodeInterpreterOutputsInner", PolymorphicKind.SEALED) {
element("1", RunStepDeltaStepDetailsToolCallsCodeOutputImageObject.serializer().descriptor)
element("2", RunStepDeltaStepDetailsToolCallsCodeOutputLogsObject.serializer().descriptor)
}
override fun deserialize(decoder: Decoder): RunStepDeltaStepDetailsToolCallsCodeObjectCodeInterpreterOutputsInner {
val jsonSerde = Json { ignoreUnknownKeys = true }
val json = decoder.decodeSerializableValue(JsonElement.serializer())
return attemptDeserialize(json,
Pair(RunStepDeltaStepDetailsToolCallsCodeObjectCodeInterpreterOutputsInner.CaseRunStepDeltaStepDetailsToolCallsCodeOutputImageObject::class) {
RunStepDeltaStepDetailsToolCallsCodeObjectCodeInterpreterOutputsInner.CaseRunStepDeltaStepDetailsToolCallsCodeOutputImageObject(jsonSerde.decodeFromJsonElement(RunStepDeltaStepDetailsToolCallsCodeOutputImageObject.serializer(), json))
},
Pair(RunStepDeltaStepDetailsToolCallsCodeObjectCodeInterpreterOutputsInner.CaseRunStepDeltaStepDetailsToolCallsCodeOutputLogsObject::class) {
RunStepDeltaStepDetailsToolCallsCodeObjectCodeInterpreterOutputsInner.CaseRunStepDeltaStepDetailsToolCallsCodeOutputLogsObject(jsonSerde.decodeFromJsonElement(RunStepDeltaStepDetailsToolCallsCodeOutputLogsObject.serializer(), json))
})
}
override fun serialize(encoder: Encoder, value: RunStepDeltaStepDetailsToolCallsCodeObjectCodeInterpreterOutputsInner) =
when(value) {
is RunStepDeltaStepDetailsToolCallsCodeObjectCodeInterpreterOutputsInner.CaseRunStepDeltaStepDetailsToolCallsCodeOutputImageObject ->
encoder.encodeSerializableValue(RunStepDeltaStepDetailsToolCallsCodeOutputImageObject.serializer(), value.value)
is RunStepDeltaStepDetailsToolCallsCodeObjectCodeInterpreterOutputsInner.CaseRunStepDeltaStepDetailsToolCallsCodeOutputLogsObject ->
encoder.encodeSerializableValue(RunStepDeltaStepDetailsToolCallsCodeOutputLogsObject.serializer(), value.value)
}
}