Skip to content

Commit

Permalink
Restore
Browse files Browse the repository at this point in the history
  • Loading branch information
billytrend-cohere committed Aug 20, 2024
1 parent bdc528d commit 0df33de
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
3 changes: 2 additions & 1 deletion .fernignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,5 @@ src/index.ts
src/aws-utils.ts
src/core/streaming-fetcher/streaming-utils.ts
src/ClientV2.ts
src/api/resources/datasets/client/Client.ts
src/api/resources/datasets/client/Client.ts
src/CustomClient.ts
16 changes: 16 additions & 0 deletions src/CustomClient.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import { CohereClient } from "./Client";

export class CustomClient extends CohereClient {
constructor(protected readonly _options: CohereClient.Options = {}) {
try {
// if url ends with /v1, drop it for back compat
const match = /\/v1\/?$/
const fixed = _options.environment?.toString().replace(match, "");
if (fixed !== _options.environment?.toString()) {
_options.environment = fixed
}
} catch { }

super(_options)
}
}

0 comments on commit 0df33de

Please sign in to comment.