Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Request for Java-friendly support when customizing OkHttp (current implementation in Kotlin causes difficulties)

オープン
#574 コメント 2 件 リアクション 9 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
5/5
見積もり時間
1週間以上
初心者へのやさしさ
30/100
issue の種類
機能追加
明瞭さ
説明が足りない
活発さ
停滞
技術スタック
java, kotlin

調査の方向性

まず、openai-java-client-okhttp の現在の Kotlin 実装と、エントリポイントである OpenAIClientImpl.builder を読みます。どの Java に適したカスタマイズ方法をサポートすべきかを判断し、そのうえで、Java プロジェクトから Kotlin のビルド依存関係なしにカスタム OkHttp クライアントを設定または注入できることを確認します。

索引モデルが issue の本文から書いたものです。

説明

enhancement sdk
📌 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
  1. Language barrier

    • Requires understanding of Kotlin syntax (apply, null safety, extension functions, etc.).
    • Converting the code to Java requires additional work.
  2. 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 OpenAIOkHttpClientBuilder that allows configuring Timeout, Dispatcher, Interceptors, etc.
  • Option 2: Allow direct injection of an OkHttpClient instance 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

環境構築

Codespaces で開く

このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

openai/openai-java のほかの issue

openai/openai-java の issue をすべて見る

似ている issue

Kotlin の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。