Skip to content

Commit

Permalink
chore: rebuild project due to codegen change (#4)
Browse files Browse the repository at this point in the history
  • Loading branch information
stainless-app[bot] authored and stainless-bot committed Nov 4, 2024
1 parent aa6fca3 commit c60d81b
Show file tree
Hide file tree
Showing 2 changed files with 86 additions and 72 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ import com.fasterxml.jackson.databind.SerializerProvider
import com.fasterxml.jackson.databind.annotation.JsonDeserialize
import com.fasterxml.jackson.databind.annotation.JsonSerialize
import com.fasterxml.jackson.module.kotlin.jacksonTypeRef
import com.google.common.collect.ArrayListMultimap
import com.google.common.collect.ListMultimap
import com.omnistack.api.core.BaseDeserializer
import com.omnistack.api.core.BaseSerializer
import com.omnistack.api.core.Enum
Expand Down Expand Up @@ -53,8 +55,8 @@ constructor(
private val topLogprobs: Long?,
private val topP: Double?,
private val user: String?,
private val additionalQueryParams: Map<String, List<String>>,
private val additionalHeaders: Map<String, List<String>>,
private val additionalQueryParams: Map<String, List<String>>,
private val additionalBodyProperties: Map<String, JsonValue>,
) {

Expand Down Expand Up @@ -136,10 +138,10 @@ constructor(
)
}

internal fun getQueryParams(): Map<String, List<String>> = additionalQueryParams

internal fun getHeaders(): Map<String, List<String>> = additionalHeaders

internal fun getQueryParams(): Map<String, List<String>> = additionalQueryParams

@JsonDeserialize(builder = ChatCompletionCreateBody.Builder::class)
@NoAutoDetect
class ChatCompletionCreateBody
Expand Down Expand Up @@ -758,26 +760,26 @@ constructor(
"ChatCompletionCreateBody{messages=$messages, model=$model, frequencyPenalty=$frequencyPenalty, functionCall=$functionCall, functions=$functions, logitBias=$logitBias, logprobs=$logprobs, maxCompletionTokens=$maxCompletionTokens, maxTokens=$maxTokens, n=$n, parallelToolCalls=$parallelToolCalls, presencePenalty=$presencePenalty, responseFormat=$responseFormat, seed=$seed, serviceTier=$serviceTier, stop=$stop, stream=$stream, streamOptions=$streamOptions, temperature=$temperature, toolChoice=$toolChoice, tools=$tools, topLogprobs=$topLogprobs, topP=$topP, user=$user, additionalProperties=$additionalProperties}"
}

fun _additionalQueryParams(): Map<String, List<String>> = additionalQueryParams

fun _additionalHeaders(): Map<String, List<String>> = additionalHeaders

fun _additionalQueryParams(): Map<String, List<String>> = additionalQueryParams

fun _additionalBodyProperties(): Map<String, JsonValue> = additionalBodyProperties

override fun equals(other: Any?): Boolean {
if (this === other) {
return true
}

return /* spotless:off */ other is ChatCompletionCreateParams && this.messages == other.messages && this.model == other.model && this.frequencyPenalty == other.frequencyPenalty && this.functionCall == other.functionCall && this.functions == other.functions && this.logitBias == other.logitBias && this.logprobs == other.logprobs && this.maxCompletionTokens == other.maxCompletionTokens && this.maxTokens == other.maxTokens && this.n == other.n && this.parallelToolCalls == other.parallelToolCalls && this.presencePenalty == other.presencePenalty && this.responseFormat == other.responseFormat && this.seed == other.seed && this.serviceTier == other.serviceTier && this.stop == other.stop && this.stream == other.stream && this.streamOptions == other.streamOptions && this.temperature == other.temperature && this.toolChoice == other.toolChoice && this.tools == other.tools && this.topLogprobs == other.topLogprobs && this.topP == other.topP && this.user == other.user && this.additionalQueryParams == other.additionalQueryParams && this.additionalHeaders == other.additionalHeaders && this.additionalBodyProperties == other.additionalBodyProperties /* spotless:on */
return /* spotless:off */ other is ChatCompletionCreateParams && this.messages == other.messages && this.model == other.model && this.frequencyPenalty == other.frequencyPenalty && this.functionCall == other.functionCall && this.functions == other.functions && this.logitBias == other.logitBias && this.logprobs == other.logprobs && this.maxCompletionTokens == other.maxCompletionTokens && this.maxTokens == other.maxTokens && this.n == other.n && this.parallelToolCalls == other.parallelToolCalls && this.presencePenalty == other.presencePenalty && this.responseFormat == other.responseFormat && this.seed == other.seed && this.serviceTier == other.serviceTier && this.stop == other.stop && this.stream == other.stream && this.streamOptions == other.streamOptions && this.temperature == other.temperature && this.toolChoice == other.toolChoice && this.tools == other.tools && this.topLogprobs == other.topLogprobs && this.topP == other.topP && this.user == other.user && this.additionalHeaders == other.additionalHeaders && this.additionalQueryParams == other.additionalQueryParams && this.additionalBodyProperties == other.additionalBodyProperties /* spotless:on */
}

override fun hashCode(): Int {
return /* spotless:off */ Objects.hash(messages, model, frequencyPenalty, functionCall, functions, logitBias, logprobs, maxCompletionTokens, maxTokens, n, parallelToolCalls, presencePenalty, responseFormat, seed, serviceTier, stop, stream, streamOptions, temperature, toolChoice, tools, topLogprobs, topP, user, additionalQueryParams, additionalHeaders, additionalBodyProperties) /* spotless:on */
return /* spotless:off */ Objects.hash(messages, model, frequencyPenalty, functionCall, functions, logitBias, logprobs, maxCompletionTokens, maxTokens, n, parallelToolCalls, presencePenalty, responseFormat, seed, serviceTier, stop, stream, streamOptions, temperature, toolChoice, tools, topLogprobs, topP, user, additionalHeaders, additionalQueryParams, additionalBodyProperties) /* spotless:on */
}

override fun toString() =
"ChatCompletionCreateParams{messages=$messages, model=$model, frequencyPenalty=$frequencyPenalty, functionCall=$functionCall, functions=$functions, logitBias=$logitBias, logprobs=$logprobs, maxCompletionTokens=$maxCompletionTokens, maxTokens=$maxTokens, n=$n, parallelToolCalls=$parallelToolCalls, presencePenalty=$presencePenalty, responseFormat=$responseFormat, seed=$seed, serviceTier=$serviceTier, stop=$stop, stream=$stream, streamOptions=$streamOptions, temperature=$temperature, toolChoice=$toolChoice, tools=$tools, topLogprobs=$topLogprobs, topP=$topP, user=$user, additionalQueryParams=$additionalQueryParams, additionalHeaders=$additionalHeaders, additionalBodyProperties=$additionalBodyProperties}"
"ChatCompletionCreateParams{messages=$messages, model=$model, frequencyPenalty=$frequencyPenalty, functionCall=$functionCall, functions=$functions, logitBias=$logitBias, logprobs=$logprobs, maxCompletionTokens=$maxCompletionTokens, maxTokens=$maxTokens, n=$n, parallelToolCalls=$parallelToolCalls, presencePenalty=$presencePenalty, responseFormat=$responseFormat, seed=$seed, serviceTier=$serviceTier, stop=$stop, stream=$stream, streamOptions=$streamOptions, temperature=$temperature, toolChoice=$toolChoice, tools=$tools, topLogprobs=$topLogprobs, topP=$topP, user=$user, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams, additionalBodyProperties=$additionalBodyProperties}"

fun toBuilder() = Builder().from(this)

Expand Down Expand Up @@ -813,8 +815,8 @@ constructor(
private var topLogprobs: Long? = null
private var topP: Double? = null
private var user: String? = null
private var additionalQueryParams: MutableMap<String, MutableList<String>> = mutableMapOf()
private var additionalHeaders: MutableMap<String, MutableList<String>> = mutableMapOf()
private var additionalHeaders: ListMultimap<String, String> = ArrayListMultimap.create()
private var additionalQueryParams: ListMultimap<String, String> = ArrayListMultimap.create()
private var additionalBodyProperties: MutableMap<String, JsonValue> = mutableMapOf()

internal fun from(chatCompletionCreateParams: ChatCompletionCreateParams) = apply {
Expand Down Expand Up @@ -842,8 +844,8 @@ constructor(
this.topLogprobs = chatCompletionCreateParams.topLogprobs
this.topP = chatCompletionCreateParams.topP
this.user = chatCompletionCreateParams.user
additionalQueryParams(chatCompletionCreateParams.additionalQueryParams)
additionalHeaders(chatCompletionCreateParams.additionalHeaders)
additionalQueryParams(chatCompletionCreateParams.additionalQueryParams)
additionalBodyProperties(chatCompletionCreateParams.additionalBodyProperties)
}

Expand Down Expand Up @@ -1259,45 +1261,44 @@ constructor(
*/
fun user(user: String) = apply { this.user = user }

fun additionalQueryParams(additionalQueryParams: Map<String, List<String>>) = apply {
this.additionalQueryParams.clear()
putAllQueryParams(additionalQueryParams)
fun additionalHeaders(additionalHeaders: Map<String, Iterable<String>>) = apply {
this.additionalHeaders.clear()
putAllAdditionalHeaders(additionalHeaders)
}

fun putQueryParam(name: String, value: String) = apply {
this.additionalQueryParams.getOrPut(name) { mutableListOf() }.add(value)
fun putAdditionalHeader(name: String, value: String) = apply {
additionalHeaders.put(name, value)
}

fun putQueryParams(name: String, values: Iterable<String>) = apply {
this.additionalQueryParams.getOrPut(name) { mutableListOf() }.addAll(values)
fun putAdditionalHeaders(name: String, values: Iterable<String>) = apply {
additionalHeaders.putAll(name, values)
}

fun putAllQueryParams(additionalQueryParams: Map<String, Iterable<String>>) = apply {
additionalQueryParams.forEach(this::putQueryParams)
fun putAllAdditionalHeaders(additionalHeaders: Map<String, Iterable<String>>) = apply {
additionalHeaders.forEach(::putAdditionalHeaders)
}

fun removeQueryParam(name: String) = apply {
this.additionalQueryParams.put(name, mutableListOf())
}
fun removeAdditionalHeader(name: String) = apply { additionalHeaders.removeAll(name) }

fun additionalHeaders(additionalHeaders: Map<String, Iterable<String>>) = apply {
this.additionalHeaders.clear()
putAllHeaders(additionalHeaders)
fun additionalQueryParams(additionalQueryParams: Map<String, Iterable<String>>) = apply {
this.additionalQueryParams.clear()
putAllAdditionalQueryParams(additionalQueryParams)
}

fun putHeader(name: String, value: String) = apply {
this.additionalHeaders.getOrPut(name) { mutableListOf() }.add(value)
fun putAdditionalQueryParam(key: String, value: String) = apply {
additionalQueryParams.put(key, value)
}

fun putHeaders(name: String, values: Iterable<String>) = apply {
this.additionalHeaders.getOrPut(name) { mutableListOf() }.addAll(values)
fun putAdditionalQueryParams(key: String, values: Iterable<String>) = apply {
additionalQueryParams.putAll(key, values)
}

fun putAllHeaders(additionalHeaders: Map<String, Iterable<String>>) = apply {
additionalHeaders.forEach(this::putHeaders)
}
fun putAllAdditionalQueryParams(additionalQueryParams: Map<String, Iterable<String>>) =
apply {
additionalQueryParams.forEach(::putAdditionalQueryParams)
}

fun removeHeader(name: String) = apply { this.additionalHeaders.put(name, mutableListOf()) }
fun removeAdditionalQueryParam(key: String) = apply { additionalQueryParams.removeAll(key) }

fun additionalBodyProperties(additionalBodyProperties: Map<String, JsonValue>) = apply {
this.additionalBodyProperties.clear()
Expand Down Expand Up @@ -1339,8 +1340,14 @@ constructor(
topLogprobs,
topP,
user,
additionalQueryParams.mapValues { it.value.toImmutable() }.toImmutable(),
additionalHeaders.mapValues { it.value.toImmutable() }.toImmutable(),
additionalHeaders
.asMap()
.mapValues { it.value.toList().toImmutable() }
.toImmutable(),
additionalQueryParams
.asMap()
.mapValues { it.value.toList().toImmutable() }
.toImmutable(),
additionalBodyProperties.toImmutable(),
)
}
Expand Down
Loading

0 comments on commit c60d81b

Please sign in to comment.