Request for Java-friendly support when customizing OkHttp (current implementation in Kotlin causes difficulties)
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 初心者へのやさしさ
- 30/100
- issue の種類
- 機能追加
- 明瞭さ
- 説明が足りない
- 活発さ
- 停滞
調査の方向性
まず、openai-java-client-okhttp の現在の Kotlin 実装と、エントリポイントである OpenAIClientImpl.builder を読みます。どの Java に適したカスタマイズ方法をサポートすべきかを判断し、そのうえで、Java プロジェクトから Kotlin のビルド依存関係なしにカスタム OkHttp クライアントを設定または注入できることを確認します。
索引モデルが issue の本文から書いたものです。
説明
📌 Background
Currently, to customize the OkHttp client, the recommended approach is to copy the OkHttpClient implementation from openai-java-client-okhttp and modify it.
However, since the implementation is written in Kotlin, this process is difficult for developers working in pure Java projects.
⚠ Problems
-
Language barrier
- Requires understanding of Kotlin syntax (
apply, null safety, extension functions, etc.). - Converting the code to Java requires additional work.
- Requires understanding of Kotlin syntax (
-
Build environment overhead
- Pure Java projects need to add the Kotlin build plugin to use the copied code.
- This introduces extra build configuration and dependency management burden.
💡 Suggestions
-
Option 1: Provide a Java-friendly abstraction layer
- e.g., an
OpenAIOkHttpClientBuilderthat allows configuring Timeout, Dispatcher, Interceptors, etc.
- e.g., an
-
Option 2: Allow direct injection of an
OkHttpClientinstance via factory methods-
Example:
OpenAIClient client = OpenAIClientImpl.builder() .apiKey("...") .httpClient(customOkHttpClient) // Built via OkHttpClient.Builder .build();
-
-
Option 3: Provide a Java version of the current Kotlin implementation as a sample
- So Java developers can copy and modify it without Kotlin dependencies.
✅ Expected benefits
- Java developers can customize OkHttp without learning Kotlin.
- Significantly lowers the barrier compared to the current “copy-and-modify” approach.
- Improves flexibility for adapting to different network environments.
- 主要言語
- Kotlin
- スター
- 1.5k
- フォーク
- 266
- 平均マージ
- 9時間 50分
- マージ済み PR(30日)
- 146
環境構築
このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
openai/openai-java のほかの issue
-
HttpRequest.url() logs spaces in path segments as literal plus signs対応中かも @sylvesterkaczmarek が 53 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
openai/openai-java#886 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
-
Make diarized transcription duration and task optional対応中かも @wskr00 が 84 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
openai/openai-java#802 · コメント 2 件 · リアクション 3 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 3/5 半日 初心者へのやさしさ 42/100
openai/openai-java#1160 ·
メンテナーはふだん 1 日以内に返信
-
AsyncStreamResponse can hang when the subscriber executor rejects work対応中かも @sylvesterkaczmarek が 36 日前に担当しました。 オープン
難易度 3/5 1〜2日 初心者へのやさしさ 74/100
openai/openai-java#973 ·
メンテナーはふだん 1 日以内に返信
-
難易度 5/5 1週間以上 初心者へのやさしさ 35/100
openai/openai-java#956 ·
メンテナーはふだん 1 日以内に返信
openai/openai-java の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 64/100
utopia-rise/godot-jvm#1004 ·
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 88/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
ankidroid/Anki-Android#22408 ·
メンテナーはふだん 1 日以内に返信
-
enhancement
難易度 2/5 1時間未満 初心者へのやさしさ 72/100
afarber/OpenMapView#22 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
nightscout/AndroidAPS#5245 ·
メンテナーはふだん 1 日以内に返信