Skip to content

Java code provided in examples is incorrect #9

@tilperion2

Description

@tilperion2

ISSUE DETAILS:
I've tried to explore these OCI OpenAI examples in Java, but seems they are not correct and do not compile.

OpenAIClient client = OpenAIOkHttpClient.builder()
        .baseUrl("https://inference.generativeai.us-chicago-1.oci.oraclecloud.com/openai/v1")
        **.okHttpClient(ociHttpClient)**
        .apiKey("not-used")
        .build();

Current OpenAIOkHttpClient builder API does not expose an okHttpClient(...) method. In the current source, build() creates the underlying HTTP client itself via OkHttpClient.builder()...build(), and a search of OpenAIOkHttpClient.kt does not show a fun okHttpClient(...) builder method.

The official README also shows the supported manual builder pattern as things like .fromEnv(), .apiKey(...), .baseUrl(...), etc., but not .okHttpClient(...).

I've tried to use OpenAI clients of different version as well, v4, v3. But it is just not present there.

DESIRED SOLUTION:
Specify what OpenAI version are you using
Please update examples to be compilable, and semantically and functionally correct.
Also update Readme.MD to display actual example usages from Java files you have in examples.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions