Skip to content

Commit 0940322

Browse files
committed
refactor(oci): drop V1 OciClient, go V2-only
- Remove OciClient (V1 API) class entirely - Remove all is_v2 parameter threading and body-sniffing detection - Remove V1 chat (single message string), V1 stream format, generate/rerank endpoints - OciClientV2 is now the only client, always uses COHEREV2 apiFormat - Add validation: raise ValueError if messages array is missing - Add oci_client.py to .fernignore to survive Fern regeneration - Update __init__.py and lazy_oci_deps.py to reference only OciClientV2 - Update tests: remove V1 test classes, add missing-messages test - All 41 tests pass (11 integration + 30 unit) against LUIGI_FRA_API
1 parent 14b5c6e commit 0940322

5 files changed

Lines changed: 266 additions & 703 deletions

File tree

.fernignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ src/cohere/manually_maintained/__init__.py
1515
src/cohere/bedrock_client.py
1616
src/cohere/aws_client.py
1717
src/cohere/sagemaker_client.py
18+
src/cohere/oci_client.py
1819
src/cohere/client_v2.py
1920
mypy.ini
2021
src/cohere/aliases.py

src/cohere/__init__.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -518,7 +518,6 @@
518518
"NotFoundError": ".errors",
519519
"NotImplementedError": ".errors",
520520
"OAuthAuthorizeResponse": ".types",
521-
"OciClient": ".oci_client",
522521
"OciClientV2": ".oci_client",
523522
"ParseInfo": ".types",
524523
"RerankDocument": ".types",
@@ -853,7 +852,6 @@ def __dir__():
853852
"NotFoundError",
854853
"NotImplementedError",
855854
"OAuthAuthorizeResponse",
856-
"OciClient",
857855
"OciClientV2",
858856
"ParseInfo",
859857
"RerankDocument",

src/cohere/manually_maintained/lazy_oci_deps.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
from typing import Any
44

55
OCI_INSTALLATION_MESSAGE = """
6-
The OCI SDK is required to use OciClient or OciClientV2.
6+
The OCI SDK is required to use OciClientV2.
77
88
Install it with:
99
pip install oci

0 commit comments

Comments
 (0)