Commit 548f741
committed
feat(oci): support both V1 (OciClient) and V2 (OciClientV2) with validation
- Add OciClient back for V1 API (Command R, embeddings)
- OciClientV2 for V2 API (Command A, COHEREV2 format)
- Fail-fast validation: V2 body on V1 client or V1 body on V2 client
raises ValueError with clear guidance on which client to use
- V1/V2 determined by client class, not body sniffing
- Full V1 chat, stream, and response transforms restored
- Par to par with BedrockClient/BedrockClientV2 architecture
- 47 tests pass (14 integration + 33 unit) against OCI GenAI1 parent 14f6e01 commit 548f741
4 files changed
Lines changed: 579 additions & 233 deletions
File tree
- src/cohere
- manually_maintained
- tests
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
518 | 518 | | |
519 | 519 | | |
520 | 520 | | |
| 521 | + | |
521 | 522 | | |
522 | 523 | | |
523 | 524 | | |
| |||
852 | 853 | | |
853 | 854 | | |
854 | 855 | | |
| 856 | + | |
855 | 857 | | |
856 | 858 | | |
857 | 859 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
| 6 | + | |
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| |||
0 commit comments