Skip to content

Commit 228434b

Browse files
Add V2 AWS clients (#224)
* Add AwsClientV2 and corresponding BedrockClientV2 and SagemakerClientV2 classes * Fix path
1 parent d427a0a commit 228434b

File tree

3 files changed

+22
-2
lines changed

3 files changed

+22
-2
lines changed

src/AwsClient.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,17 @@
11
import { AwsProps } from './aws-utils';
22
import { CohereClient } from "./Client";
3+
import { CohereClientV2 } from './ClientV2';
34

45
export class AwsClient extends CohereClient {
56
constructor(_options: CohereClient.Options & AwsProps) {
67
_options.token = "n/a"; // AWS clients don't need a token but setting to this to a string so Fern doesn't complain
78
super(_options);
89
}
10+
}
11+
12+
export class AwsClientV2 extends CohereClientV2 {
13+
constructor(_options: CohereClient.Options & AwsProps) {
14+
_options.token = "n/a"; // AWS clients don't need a token but setting to this to a string so Fern doesn't complain
15+
super(_options);
16+
}
917
}

src/BedrockClient.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,15 @@
11
import { AwsProps, fetchOverride } from './aws-utils';
2-
import { AwsClient } from './AwsClient';
2+
import { AwsClient, AwsClientV2 } from './AwsClient';
33
import { CohereClient } from "./Client";
44

55
export class BedrockClient extends AwsClient {
66
constructor(_options: CohereClient.Options & AwsProps) {
77
super({ ..._options, fetcher: fetchOverride("bedrock", _options) });
88
}
99
}
10+
11+
export class BedrockClientV2 extends AwsClientV2 {
12+
constructor(_options: CohereClient.Options & AwsProps) {
13+
super({ ..._options, fetcher: fetchOverride("bedrock", _options) });
14+
}
15+
}

src/SagemakerClient.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { AwsClient } from './AwsClient';
1+
import { AwsClient, AwsClientV2 } from './AwsClient';
22
import { CohereClient } from "./Client";
33
import { AwsProps, fetchOverride } from './aws-utils';
44

@@ -8,3 +8,9 @@ export class SagemakerClient extends AwsClient {
88
super({ ..._options, fetcher: fetchOverride("sagemaker", _options) });
99
}
1010
}
11+
12+
export class SagemakerClientV2 extends AwsClientV2 {
13+
constructor(_options: CohereClient.Options & AwsProps) {
14+
super({ ..._options, fetcher: fetchOverride("sagemaker", _options) });
15+
}
16+
}

0 commit comments

Comments
 (0)