Skip to content

Commit 375640b

Browse files
authored
Merge pull request #9 from oracle-samples/remove-partner-api
Remove Partner API section and examples
2 parents 8997c25 + 57dd613 commit 375640b

11 files changed

Lines changed: 5 additions & 372 deletions

MIGRATION.md

Lines changed: 3 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,7 @@ This guide helps existing `oci-openai` users migrate to `oci-genai-auth`.
77
- Replace dependency `oci-openai` with `oci-genai-auth`.
88
- Continue using the `openai` Python SDK client.
99
- Use `OciSessionAuth` to sign requests with OCI IAM.
10-
- Choose endpoint/config based on API mode.:
11-
- AgentHub: `https://inference.generativeai.<region>.oci.oraclecloud.com/openai/v1` + `project`
12-
- Partner : `https://inference.generativeai.<region>.oci.oraclecloud.com/20231130/actions/v1` + `opc-compartment-id`
10+
- Use endpoint `https://inference.generativeai.<region>.oci.oraclecloud.com/openai/v1` with a `project` OCID.
1311

1412
## 1) Dependency Changes
1513

@@ -30,8 +28,6 @@ from oci_openai import OciSessionAuth
3028

3129
## 3) Client Initialization Changes
3230

33-
### AgentHub
34-
3531
Use the OpenAI-compatible endpoint and provide project OCID:
3632

3733
```python
@@ -47,28 +43,7 @@ client = OpenAI(
4743
)
4844
```
4945

50-
### Partner APIs
51-
52-
Use `/v1` and include compartment header:
53-
54-
```python
55-
import httpx
56-
from openai import OpenAI
57-
from oci_genai_auth import OciSessionAuth
58-
59-
client = OpenAI(
60-
base_url="https://inference.generativeai.<region>.oci.oraclecloud.com/v1",
61-
api_key="not-used",
62-
default_headers={"opc-compartment-id": "<ocid1.compartment...>"},
63-
http_client=httpx.Client(auth=OciSessionAuth(profile_name="DEFAULT")),
64-
)
65-
```
66-
6746
## 4) Endpoint and required parameters
6847

69-
- AgentHub:
70-
- `base_url`: `https://inference.generativeai.<region>.oci.oraclecloud.com/openai/v1`
71-
- required: `project=<PROJECT_OCID>`
72-
- Partner:
73-
- `base_url`: `https://inference.generativeai.<region>.oci.oraclecloud.com/v1`
74-
- required header: `opc-compartment-id=<COMPARTMENT_OCID>`
48+
- `base_url`: `https://inference.generativeai.<region>.oci.oraclecloud.com/openai/v1`
49+
- required: `project=<PROJECT_OCID>`

README.md

Lines changed: 2 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,7 @@ The **OCI GenAI Auth** Python library provides OCI request-signing helpers for t
1111
- [Using OCI IAM Auth](#using-oci-iam-auth)
1212
- [Using API Key Auth](#using-api-key-auth)
1313
- [Using AgentHub APIs](#using-agenthub-apis)
14-
- [Using Partner APIs (passthrough)](#using-partner-apis-passthrough)
15-
- [Running the Examples](#running-the-examples)
14+
- [Examples](#examples)
1615
- [Contributing](#contributing)
1716
- [Security](#security)
1817
- [License](#license)
@@ -86,33 +85,8 @@ client = OpenAI(
8685
)
8786
```
8887

89-
## Using Partner APIs (passthrough)
90-
91-
OCI also offers Partner API which passes through your calls to partners such as OpenAI. We will support more partners in the future.
92-
93-
You can leverage Partner API when you want to use OpenAI's API and GPT models, but with OCI auth and billing.
94-
95-
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.
96-
97-
If you want multi-provider model access and features unavailable under partner's Zero Data Retention (such as File Search), use the AgentHub APIs above.
98-
99-
```python
100-
import httpx
101-
from openai import OpenAI
102-
from oci_genai_auth import OciSessionAuth
103-
104-
client = OpenAI(
105-
base_url="https://inference.generativeai.us-chicago-1.oci.oraclecloud.com/20231130/actions/v1",
106-
api_key="not-used",
107-
default_headers={
108-
"opc-compartment-id": "ocid1.compartment.oc1..aaaaaaaaexample",
109-
},
110-
http_client=httpx.Client(auth=OciSessionAuth(profile_name="DEFAULT")),
111-
)
112-
```
113-
11488
## Examples
115-
Demo code and instructions on how to run them, for both agenthub and partner usecases can be found in ```examples``` folder.
89+
Demo code and instructions on how to run them can be found in the ```examples``` folder.
11690

11791
## Contributing
11892

examples/partner/README.md

Lines changed: 0 additions & 29 deletions
This file was deleted.

examples/partner/__init__.py

Lines changed: 0 additions & 2 deletions
This file was deleted.

examples/partner/common.py

Lines changed: 0 additions & 39 deletions
This file was deleted.

examples/partner/openai/__init__.py

Lines changed: 0 additions & 2 deletions
This file was deleted.

examples/partner/openai/basic_chat_completion.py

Lines changed: 0 additions & 29 deletions
This file was deleted.

examples/partner/openai/basic_chat_completion_api_key.py

Lines changed: 0 additions & 37 deletions
This file was deleted.

examples/partner/openai/quickstart_openai_chat_completions.py

Lines changed: 0 additions & 46 deletions
This file was deleted.

examples/partner/openai/streaming_chat_completion.py

Lines changed: 0 additions & 38 deletions
This file was deleted.

0 commit comments

Comments
 (0)