Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(client): make some classes and constructors non-public #169

Merged
merged 1 commit into from
Jan 26, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ private constructor(private val okHttpClient: okhttp3.OkHttpClient, private val
@JvmStatic fun builder() = Builder()
}

class Builder {
class Builder internal constructor() {

private var baseUrl: HttpUrl? = null
// The default timeout is 10 minutes.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class OpenAIOkHttpClient private constructor() {
@JvmStatic fun fromEnv(): OpenAIClient = builder().fromEnv().build()
}

class Builder {
class Builder internal constructor() {

private var clientOptions: ClientOptions.Builder = ClientOptions.builder()
private var baseUrl: String = ClientOptions.PRODUCTION_URL
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class OpenAIOkHttpClientAsync private constructor() {
@JvmStatic fun fromEnv(): OpenAIClientAsync = builder().fromEnv().build()
}

class Builder {
class Builder internal constructor() {

private var clientOptions: ClientOptions.Builder = ClientOptions.builder()
private var baseUrl: String = ClientOptions.PRODUCTION_URL
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,7 @@ import com.openai.services.async.ModerationServiceAsyncImpl
import com.openai.services.async.UploadServiceAsync
import com.openai.services.async.UploadServiceAsyncImpl

class OpenAIClientAsyncImpl
constructor(
class OpenAIClientAsyncImpl(
private val clientOptions: ClientOptions,
) : OpenAIClientAsync {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,7 @@ import com.openai.services.blocking.ModerationServiceImpl
import com.openai.services.blocking.UploadService
import com.openai.services.blocking.UploadServiceImpl

class OpenAIClientImpl
constructor(
class OpenAIClientImpl(
private val clientOptions: ClientOptions,
) : OpenAIClient {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ private constructor(
@JvmStatic fun fromEnv(): ClientOptions = builder().fromEnv().build()
}

class Builder {
class Builder internal constructor() {

private var httpClient: HttpClient? = null
private var jsonMapper: JsonMapper = jsonMapper()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ private constructor(
@JvmStatic fun builder() = Builder()
}

class Builder {
class Builder internal constructor() {

private var responseValidation: Boolean? = null
private var timeout: Duration? = null

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ private constructor(
@JvmStatic fun builder() = Builder()
}

class Builder {
class Builder internal constructor() {

private val map: MutableMap<String, MutableList<String>> =
TreeMap(String.CASE_INSENSITIVE_ORDER)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ private constructor(
@JvmStatic fun builder() = Builder()
}

class Builder {
class Builder internal constructor() {

private var method: HttpMethod? = null
private var url: String? = null
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ private constructor(
@JvmStatic fun builder() = Builder()
}

class Builder {
class Builder internal constructor() {

private val map: MutableMap<String, MutableList<String>> = mutableMapOf()
private var size: Int = 0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ private constructor(
@JvmStatic fun builder() = Builder()
}

class Builder {
class Builder internal constructor() {

private var httpClient: HttpClient? = null
private var clock: Clock = Clock.systemUTC()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ private constructor(
@JvmStatic fun builder() = Builder()
}

class Builder {
class Builder internal constructor() {

private var jsonMapper: JsonMapper? = null
private var event: String? = null
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ private constructor(
@JvmStatic fun builder() = Builder()
}

class Builder {
class Builder internal constructor() {

private var additionalProperties: MutableMap<String, JsonValue> = mutableMapOf()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ private constructor(
}
}

class Deserializer : BaseDeserializer<Annotation>(Annotation::class) {
internal class Deserializer : BaseDeserializer<Annotation>(Annotation::class) {

override fun ObjectCodec.deserialize(node: JsonNode): Annotation {
val json = JsonValue.fromJsonNode(node)
Expand All @@ -174,7 +174,7 @@ private constructor(
}
}

class Serializer : BaseSerializer<Annotation>(Annotation::class) {
internal class Serializer : BaseSerializer<Annotation>(Annotation::class) {

override fun serialize(
value: Annotation,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ private constructor(
}
}

class Deserializer : BaseDeserializer<AnnotationDelta>(AnnotationDelta::class) {
internal class Deserializer : BaseDeserializer<AnnotationDelta>(AnnotationDelta::class) {

override fun ObjectCodec.deserialize(node: JsonNode): AnnotationDelta {
val json = JsonValue.fromJsonNode(node)
Expand Down Expand Up @@ -179,7 +179,7 @@ private constructor(
}
}

class Serializer : BaseSerializer<AnnotationDelta>(AnnotationDelta::class) {
internal class Serializer : BaseSerializer<AnnotationDelta>(AnnotationDelta::class) {

override fun serialize(
value: AnnotationDelta,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ private constructor(
@JvmStatic fun builder() = Builder()
}

class Builder {
class Builder internal constructor() {

private var id: JsonField<String>? = null
private var createdAt: JsonField<Long>? = null
Expand Down Expand Up @@ -754,7 +754,7 @@ private constructor(
@JvmStatic fun builder() = Builder()
}

class Builder {
class Builder internal constructor() {

private var codeInterpreter: JsonField<CodeInterpreter> = JsonMissing.of()
private var fileSearch: JsonField<FileSearch> = JsonMissing.of()
Expand Down Expand Up @@ -857,7 +857,7 @@ private constructor(
@JvmStatic fun builder() = Builder()
}

class Builder {
class Builder internal constructor() {

private var fileIds: JsonField<MutableList<String>>? = null
private var additionalProperties: MutableMap<String, JsonValue> = mutableMapOf()
Expand Down Expand Up @@ -1001,7 +1001,7 @@ private constructor(
@JvmStatic fun builder() = Builder()
}

class Builder {
class Builder internal constructor() {

private var vectorStoreIds: JsonField<MutableList<String>>? = null
private var additionalProperties: MutableMap<String, JsonValue> = mutableMapOf()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ private constructor(
@JvmStatic fun builder() = Builder()
}

class Builder {
class Builder internal constructor() {

private var id: JsonField<String>? = null
private var deleted: JsonField<Boolean>? = null
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ private constructor(
}
}

class Deserializer :
internal class Deserializer :
BaseDeserializer<AssistantResponseFormatOption>(AssistantResponseFormatOption::class) {

override fun ObjectCodec.deserialize(node: JsonNode): AssistantResponseFormatOption {
Expand Down Expand Up @@ -226,7 +226,7 @@ private constructor(
}
}

class Serializer :
internal class Serializer :
BaseSerializer<AssistantResponseFormatOption>(AssistantResponseFormatOption::class) {

override fun serialize(
Expand Down
Loading