Skip to content
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
27 changes: 1 addition & 26 deletions MIGRATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,7 @@ This guide helps existing `oci-genai-openai` users migrate to `oci-genai-auth-ja
- Replace dependency `oci-genai-openai` with `oci-genai-auth-java-core`.
- Continue using the `openai-java` SDK client.
- Use `OciOkHttpClientFactory` to build a signed OkHttpClient.
- Choose endpoint/config based on API mode:
- OCI Enterprise AI Agents: `https://inference.generativeai.<region>.oci.oraclecloud.com/openai/v1` + `openai-project` header
- Partner : `https://inference.generativeai.<region>.oci.oraclecloud.com/20231130/actions/v1` + `compartmentId`
- Use the OCI Enterprise AI Agents endpoint: `https://inference.generativeai.<region>.oci.oraclecloud.com/openai/v1` + `openai-project` header

## 1) Dependency Changes

Expand Down Expand Up @@ -78,31 +76,8 @@ OpenAIClient client = OpenAIOkHttpClient.builder()
.build();
```

### Partner APIs

Use `/20231130/actions/v1` and include compartment ID:

```java
OciAuthConfig config = OciAuthConfig.builder()
.authType("security_token")
.profile("DEFAULT")
.compartmentId("<ocid1.compartment...>")
.build();

OkHttpClient ociHttpClient = OciOkHttpClientFactory.build(config);

OpenAIClient client = OpenAIOkHttpClient.builder()
.baseUrl("https://inference.generativeai.<region>.oci.oraclecloud.com/20231130/actions/v1")
.okHttpClient(ociHttpClient)
.apiKey("not-used")
.build();
```

## 4) Endpoint and required parameters

- OCI Enterprise AI Agents:
- `baseUrl`: `https://inference.generativeai.<region>.oci.oraclecloud.com/openai/v1`
- required: `openai-project` header with project OCID
- Partner:
- `baseUrl`: `https://inference.generativeai.<region>.oci.oraclecloud.com/20231130/actions/v1`
- required: `compartmentId` in `OciAuthConfig`
29 changes: 1 addition & 28 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ The **OCI GenAI Auth** Java library provides OCI request-signing helpers for the
- [Using OCI IAM Auth](#using-oci-iam-auth)
- [Using API Key Auth](#using-api-key-auth)
- [Using OCI Enterprise AI Agents APIs](#using-oci-enterprise-ai-agents-apis)
- [Using Partner APIs (passthrough)](#using-partner-apis-passthrough)
- [Examples](#examples)
- [Contributing](#contributing)
- [Security](#security)
Expand Down Expand Up @@ -113,34 +112,8 @@ OpenAIClient client = OpenAIOkHttpClient.builder()
.build();
```

## Using Partner APIs (passthrough)

OCI also offers Partner API which passes through your calls to partners such as OpenAI. We will support more partners in the future.

You can leverage Partner API when you want to use OpenAI's API and GPT models, but with OCI auth and billing.

Note: Currently Partner API is only available to Oracle internal teams. Only features that meet partner's Zero Data Retention are available through Partner API.

If you want multi-provider model access and features unavailable under partner's Zero Data Retention (such as File Search), use the OCI Enterprise AI Agents APIs above.

```java
OciAuthConfig config = OciAuthConfig.builder()
.authType("security_token")
.profile("DEFAULT")
.compartmentId("ocid1.compartment.oc1..aaaaaaaaexample")
.build();

OkHttpClient ociHttpClient = OciOkHttpClientFactory.build(config);

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

## Examples
Demo code and instructions on how to run them, for both OCI Enterprise AI Agents and partner usecases can be found in [examples](examples/) folder.
Demo code and instructions on how to run them can be found in [examples](examples/) folder.

## Contributing

Expand Down
20 changes: 0 additions & 20 deletions examples/partner/README.md

This file was deleted.

65 changes: 0 additions & 65 deletions examples/partner/openai/BasicChatCompletion.java

This file was deleted.

45 changes: 0 additions & 45 deletions examples/partner/openai/BasicChatCompletionApiKey.java

This file was deleted.

61 changes: 0 additions & 61 deletions examples/partner/openai/StreamingChatCompletion.java

This file was deleted.

113 changes: 0 additions & 113 deletions examples/partner/openai/ToolCallChatCompletion.java

This file was deleted.

Loading