@effect-aws/client-bedrock-runtime 1.10.9 → 2.0.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +1 -1
- package/README.md +3 -3
- package/dist/dts/BedrockRuntimeClientInstance.d.ts +4 -2
- package/dist/dts/BedrockRuntimeClientInstance.d.ts.map +1 -1
- package/dist/dts/BedrockRuntimeService.d.ts +15 -15
- package/dist/dts/BedrockRuntimeService.d.ts.map +1 -1
- package/dist/dts/BedrockRuntimeServiceConfig.d.ts +2 -1
- package/dist/dts/BedrockRuntimeServiceConfig.d.ts.map +1 -1
- package/dist/esm/BedrockRuntimeClientInstance.js +5 -3
- package/dist/esm/BedrockRuntimeClientInstance.js.map +1 -1
- package/dist/esm/BedrockRuntimeService.js +4 -2
- package/dist/esm/BedrockRuntimeService.js.map +1 -1
- package/dist/esm/BedrockRuntimeServiceConfig.js +7 -6
- package/dist/esm/BedrockRuntimeServiceConfig.js.map +1 -1
- package/package.json +8 -14
- package/src/BedrockRuntimeClientInstance.ts +9 -5
- package/src/BedrockRuntimeService.ts +16 -14
- package/src/BedrockRuntimeServiceConfig.ts +8 -7
- package/dist/cjs/BedrockRuntimeClientInstance.d.ts +0 -24
- package/dist/cjs/BedrockRuntimeClientInstance.d.ts.map +0 -1
- package/dist/cjs/BedrockRuntimeClientInstance.js +0 -50
- package/dist/cjs/BedrockRuntimeClientInstance.js.map +0 -1
- package/dist/cjs/BedrockRuntimeService.d.ts +0 -86
- package/dist/cjs/BedrockRuntimeService.d.ts.map +0 -1
- package/dist/cjs/BedrockRuntimeService.js +0 -69
- package/dist/cjs/BedrockRuntimeService.js.map +0 -1
- package/dist/cjs/BedrockRuntimeServiceConfig.d.ts +0 -25
- package/dist/cjs/BedrockRuntimeServiceConfig.d.ts.map +0 -1
- package/dist/cjs/BedrockRuntimeServiceConfig.js +0 -35
- package/dist/cjs/BedrockRuntimeServiceConfig.js.map +0 -1
- package/dist/cjs/Errors.d.ts +0 -19
- package/dist/cjs/Errors.d.ts.map +0 -1
- package/dist/cjs/Errors.js +0 -18
- package/dist/cjs/Errors.js.map +0 -1
- package/dist/cjs/index.d.ts +0 -44
- package/dist/cjs/index.d.ts.map +0 -1
- package/dist/cjs/index.js +0 -56
- package/dist/cjs/index.js.map +0 -1
package/LICENSE
CHANGED
package/README.md
CHANGED
|
@@ -16,7 +16,7 @@ With default BedrockRuntimeClient instance:
|
|
|
16
16
|
```typescript
|
|
17
17
|
import { BedrockRuntime } from "@effect-aws/client-bedrock-runtime";
|
|
18
18
|
|
|
19
|
-
const program = BedrockRuntime.invokeModel(args);
|
|
19
|
+
const program = BedrockRuntime.use((svc) => svc.invokeModel(args));
|
|
20
20
|
|
|
21
21
|
const result = pipe(
|
|
22
22
|
program,
|
|
@@ -30,7 +30,7 @@ With custom BedrockRuntimeClient instance:
|
|
|
30
30
|
```typescript
|
|
31
31
|
import { BedrockRuntime } from "@effect-aws/client-bedrock-runtime";
|
|
32
32
|
|
|
33
|
-
const program = BedrockRuntime.invokeModel(args);
|
|
33
|
+
const program = BedrockRuntime.use((svc) => svc.invokeModel(args));
|
|
34
34
|
|
|
35
35
|
const result = await pipe(
|
|
36
36
|
program,
|
|
@@ -46,7 +46,7 @@ With custom BedrockRuntimeClient configuration:
|
|
|
46
46
|
```typescript
|
|
47
47
|
import { BedrockRuntime } from "@effect-aws/client-bedrock-runtime";
|
|
48
48
|
|
|
49
|
-
const program = BedrockRuntime.invokeModel(args);
|
|
49
|
+
const program = BedrockRuntime.use((svc) => svc.invokeModel(args));
|
|
50
50
|
|
|
51
51
|
const result = await pipe(
|
|
52
52
|
program,
|
|
@@ -2,8 +2,10 @@
|
|
|
2
2
|
* @since 1.0.0
|
|
3
3
|
*/
|
|
4
4
|
import { BedrockRuntimeClient } from "@aws-sdk/client-bedrock-runtime";
|
|
5
|
-
import
|
|
6
|
-
|
|
5
|
+
import * as Effect from "effect/Effect";
|
|
6
|
+
import * as Layer from "effect/Layer";
|
|
7
|
+
import * as ServiceMap from "effect/ServiceMap";
|
|
8
|
+
declare const BedrockRuntimeClientInstance_base: ServiceMap.ServiceClass<BedrockRuntimeClientInstance, "@effect-aws/client-bedrock-runtime/BedrockRuntimeClientInstance", BedrockRuntimeClient>;
|
|
7
9
|
/**
|
|
8
10
|
* @since 1.0.0
|
|
9
11
|
* @category tags
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BedrockRuntimeClientInstance.d.ts","sourceRoot":"","sources":["../../src/BedrockRuntimeClientInstance.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EAAE,oBAAoB,EAAE,MAAM,iCAAiC,CAAC;AACvE,OAAO,
|
|
1
|
+
{"version":3,"file":"BedrockRuntimeClientInstance.d.ts","sourceRoot":"","sources":["../../src/BedrockRuntimeClientInstance.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EAAE,oBAAoB,EAAE,MAAM,iCAAiC,CAAC;AACvE,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AACxC,OAAO,KAAK,KAAK,MAAM,cAAc,CAAC;AACtC,OAAO,KAAK,UAAU,MAAM,mBAAmB,CAAC;;AAGhD;;;GAGG;AACH,qBAAa,4BACX,SAAQ,iCAEP;CACD;AAEF;;;GAGG;AACH,eAAO,MAAM,IAAI,0EAOhB,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,KAAK,yDAAmD,CAAC"}
|
|
@@ -3,8 +3,10 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import { type ApplyGuardrailCommandInput, type ApplyGuardrailCommandOutput, type BedrockRuntimeClient, type BedrockRuntimeClientConfig, type ConverseCommandInput, type ConverseCommandOutput, type ConverseStreamCommandInput, type ConverseStreamCommandOutput, type CountTokensCommandInput, type CountTokensCommandOutput, type GetAsyncInvokeCommandInput, type GetAsyncInvokeCommandOutput, type InvokeModelCommandInput, type InvokeModelCommandOutput, type InvokeModelWithBidirectionalStreamCommandInput, type InvokeModelWithBidirectionalStreamCommandOutput, type InvokeModelWithResponseStreamCommandInput, type InvokeModelWithResponseStreamCommandOutput, type ListAsyncInvokesCommandInput, type ListAsyncInvokesCommandOutput, type StartAsyncInvokeCommandInput, type StartAsyncInvokeCommandOutput } from "@aws-sdk/client-bedrock-runtime";
|
|
5
5
|
import type { HttpHandlerOptions, ServiceLogger } from "@effect-aws/commons";
|
|
6
|
-
import type
|
|
7
|
-
import
|
|
6
|
+
import type * as Cause from "effect/Cause";
|
|
7
|
+
import * as Effect from "effect/Effect";
|
|
8
|
+
import * as Layer from "effect/Layer";
|
|
9
|
+
import * as ServiceMap from "effect/ServiceMap";
|
|
8
10
|
import * as Instance from "./BedrockRuntimeClientInstance.js";
|
|
9
11
|
import type { AccessDeniedError, ConflictError, InternalServerError, ModelError, ModelNotReadyError, ModelStreamError, ModelTimeoutError, ResourceNotFoundError, SdkError, ServiceQuotaExceededError, ServiceUnavailableError, ThrottlingError, ValidationError } from "./Errors.js";
|
|
10
12
|
interface BedrockRuntimeService$ {
|
|
@@ -12,52 +14,50 @@ interface BedrockRuntimeService$ {
|
|
|
12
14
|
/**
|
|
13
15
|
* @see {@link ApplyGuardrailCommand}
|
|
14
16
|
*/
|
|
15
|
-
applyGuardrail(args: ApplyGuardrailCommandInput, options?: HttpHandlerOptions): Effect.Effect<ApplyGuardrailCommandOutput, Cause.
|
|
17
|
+
applyGuardrail(args: ApplyGuardrailCommandInput, options?: HttpHandlerOptions): Effect.Effect<ApplyGuardrailCommandOutput, Cause.TimeoutError | SdkError | AccessDeniedError | InternalServerError | ResourceNotFoundError | ServiceQuotaExceededError | ServiceUnavailableError | ThrottlingError | ValidationError>;
|
|
16
18
|
/**
|
|
17
19
|
* @see {@link ConverseCommand}
|
|
18
20
|
*/
|
|
19
|
-
converse(args: ConverseCommandInput, options?: HttpHandlerOptions): Effect.Effect<ConverseCommandOutput, Cause.
|
|
21
|
+
converse(args: ConverseCommandInput, options?: HttpHandlerOptions): Effect.Effect<ConverseCommandOutput, Cause.TimeoutError | SdkError | AccessDeniedError | InternalServerError | ModelError | ModelNotReadyError | ModelTimeoutError | ResourceNotFoundError | ServiceUnavailableError | ThrottlingError | ValidationError>;
|
|
20
22
|
/**
|
|
21
23
|
* @see {@link ConverseStreamCommand}
|
|
22
24
|
*/
|
|
23
|
-
converseStream(args: ConverseStreamCommandInput, options?: HttpHandlerOptions): Effect.Effect<ConverseStreamCommandOutput, Cause.
|
|
25
|
+
converseStream(args: ConverseStreamCommandInput, options?: HttpHandlerOptions): Effect.Effect<ConverseStreamCommandOutput, Cause.TimeoutError | SdkError | AccessDeniedError | InternalServerError | ModelError | ModelNotReadyError | ModelTimeoutError | ResourceNotFoundError | ServiceUnavailableError | ThrottlingError | ValidationError>;
|
|
24
26
|
/**
|
|
25
27
|
* @see {@link CountTokensCommand}
|
|
26
28
|
*/
|
|
27
|
-
countTokens(args: CountTokensCommandInput, options?: HttpHandlerOptions): Effect.Effect<CountTokensCommandOutput, Cause.
|
|
29
|
+
countTokens(args: CountTokensCommandInput, options?: HttpHandlerOptions): Effect.Effect<CountTokensCommandOutput, Cause.TimeoutError | SdkError | AccessDeniedError | InternalServerError | ResourceNotFoundError | ServiceUnavailableError | ThrottlingError | ValidationError>;
|
|
28
30
|
/**
|
|
29
31
|
* @see {@link GetAsyncInvokeCommand}
|
|
30
32
|
*/
|
|
31
|
-
getAsyncInvoke(args: GetAsyncInvokeCommandInput, options?: HttpHandlerOptions): Effect.Effect<GetAsyncInvokeCommandOutput, Cause.
|
|
33
|
+
getAsyncInvoke(args: GetAsyncInvokeCommandInput, options?: HttpHandlerOptions): Effect.Effect<GetAsyncInvokeCommandOutput, Cause.TimeoutError | SdkError | AccessDeniedError | InternalServerError | ThrottlingError | ValidationError>;
|
|
32
34
|
/**
|
|
33
35
|
* @see {@link InvokeModelCommand}
|
|
34
36
|
*/
|
|
35
|
-
invokeModel(args: InvokeModelCommandInput, options?: HttpHandlerOptions): Effect.Effect<InvokeModelCommandOutput, Cause.
|
|
37
|
+
invokeModel(args: InvokeModelCommandInput, options?: HttpHandlerOptions): Effect.Effect<InvokeModelCommandOutput, Cause.TimeoutError | SdkError | AccessDeniedError | InternalServerError | ModelError | ModelNotReadyError | ModelTimeoutError | ResourceNotFoundError | ServiceQuotaExceededError | ServiceUnavailableError | ThrottlingError | ValidationError>;
|
|
36
38
|
/**
|
|
37
39
|
* @see {@link InvokeModelWithBidirectionalStreamCommand}
|
|
38
40
|
*/
|
|
39
|
-
invokeModelWithBidirectionalStream(args: InvokeModelWithBidirectionalStreamCommandInput, options?: HttpHandlerOptions): Effect.Effect<InvokeModelWithBidirectionalStreamCommandOutput, Cause.
|
|
41
|
+
invokeModelWithBidirectionalStream(args: InvokeModelWithBidirectionalStreamCommandInput, options?: HttpHandlerOptions): Effect.Effect<InvokeModelWithBidirectionalStreamCommandOutput, Cause.TimeoutError | SdkError | AccessDeniedError | InternalServerError | ModelError | ModelNotReadyError | ModelStreamError | ModelTimeoutError | ResourceNotFoundError | ServiceQuotaExceededError | ServiceUnavailableError | ThrottlingError | ValidationError>;
|
|
40
42
|
/**
|
|
41
43
|
* @see {@link InvokeModelWithResponseStreamCommand}
|
|
42
44
|
*/
|
|
43
|
-
invokeModelWithResponseStream(args: InvokeModelWithResponseStreamCommandInput, options?: HttpHandlerOptions): Effect.Effect<InvokeModelWithResponseStreamCommandOutput, Cause.
|
|
45
|
+
invokeModelWithResponseStream(args: InvokeModelWithResponseStreamCommandInput, options?: HttpHandlerOptions): Effect.Effect<InvokeModelWithResponseStreamCommandOutput, Cause.TimeoutError | SdkError | AccessDeniedError | InternalServerError | ModelError | ModelNotReadyError | ModelStreamError | ModelTimeoutError | ResourceNotFoundError | ServiceQuotaExceededError | ServiceUnavailableError | ThrottlingError | ValidationError>;
|
|
44
46
|
/**
|
|
45
47
|
* @see {@link ListAsyncInvokesCommand}
|
|
46
48
|
*/
|
|
47
|
-
listAsyncInvokes(args: ListAsyncInvokesCommandInput, options?: HttpHandlerOptions): Effect.Effect<ListAsyncInvokesCommandOutput, Cause.
|
|
49
|
+
listAsyncInvokes(args: ListAsyncInvokesCommandInput, options?: HttpHandlerOptions): Effect.Effect<ListAsyncInvokesCommandOutput, Cause.TimeoutError | SdkError | AccessDeniedError | InternalServerError | ThrottlingError | ValidationError>;
|
|
48
50
|
/**
|
|
49
51
|
* @see {@link StartAsyncInvokeCommand}
|
|
50
52
|
*/
|
|
51
|
-
startAsyncInvoke(args: StartAsyncInvokeCommandInput, options?: HttpHandlerOptions): Effect.Effect<StartAsyncInvokeCommandOutput, Cause.
|
|
53
|
+
startAsyncInvoke(args: StartAsyncInvokeCommandInput, options?: HttpHandlerOptions): Effect.Effect<StartAsyncInvokeCommandOutput, Cause.TimeoutError | SdkError | AccessDeniedError | ConflictError | InternalServerError | ResourceNotFoundError | ServiceQuotaExceededError | ServiceUnavailableError | ThrottlingError | ValidationError>;
|
|
52
54
|
}
|
|
53
55
|
/**
|
|
54
56
|
* @since 1.0.0
|
|
55
57
|
* @category constructors
|
|
56
58
|
*/
|
|
57
59
|
export declare const makeBedrockRuntimeService: Effect.Effect<BedrockRuntimeService$, never, Instance.BedrockRuntimeClientInstance>;
|
|
58
|
-
declare const BedrockRuntimeService_base:
|
|
59
|
-
use: <X>(body: (_: BedrockRuntimeService$) => X) => [X] extends [Effect.Effect<infer A, infer E, infer R>] ? Effect.Effect<A, E, BedrockRuntimeService | R> : [X] extends [PromiseLike<infer A_1>] ? Effect.Effect<A_1, Cause.UnknownException, BedrockRuntimeService> : Effect.Effect<X, never, BedrockRuntimeService>;
|
|
60
|
-
};
|
|
60
|
+
declare const BedrockRuntimeService_base: ServiceMap.ServiceClass<BedrockRuntimeService, "@effect-aws/client-bedrock-runtime/BedrockRuntimeService", BedrockRuntimeService$>;
|
|
61
61
|
/**
|
|
62
62
|
* @since 1.0.0
|
|
63
63
|
* @category models
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BedrockRuntimeService.d.ts","sourceRoot":"","sources":["../../src/BedrockRuntimeService.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EAEL,KAAK,0BAA0B,EAC/B,KAAK,2BAA2B,EAChC,KAAK,oBAAoB,EACzB,KAAK,0BAA0B,EAE/B,KAAK,oBAAoB,EACzB,KAAK,qBAAqB,EAE1B,KAAK,0BAA0B,EAC/B,KAAK,2BAA2B,EAEhC,KAAK,uBAAuB,EAC5B,KAAK,wBAAwB,EAE7B,KAAK,0BAA0B,EAC/B,KAAK,2BAA2B,EAEhC,KAAK,uBAAuB,EAC5B,KAAK,wBAAwB,EAE7B,KAAK,8CAA8C,EACnD,KAAK,+CAA+C,EAEpD,KAAK,yCAAyC,EAC9C,KAAK,0CAA0C,EAE/C,KAAK,4BAA4B,EACjC,KAAK,6BAA6B,EAElC,KAAK,4BAA4B,EACjC,KAAK,6BAA6B,EACnC,MAAM,iCAAiC,CAAC;AACzC,OAAO,KAAK,EAAE,kBAAkB,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAE7E,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"BedrockRuntimeService.d.ts","sourceRoot":"","sources":["../../src/BedrockRuntimeService.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EAEL,KAAK,0BAA0B,EAC/B,KAAK,2BAA2B,EAChC,KAAK,oBAAoB,EACzB,KAAK,0BAA0B,EAE/B,KAAK,oBAAoB,EACzB,KAAK,qBAAqB,EAE1B,KAAK,0BAA0B,EAC/B,KAAK,2BAA2B,EAEhC,KAAK,uBAAuB,EAC5B,KAAK,wBAAwB,EAE7B,KAAK,0BAA0B,EAC/B,KAAK,2BAA2B,EAEhC,KAAK,uBAAuB,EAC5B,KAAK,wBAAwB,EAE7B,KAAK,8CAA8C,EACnD,KAAK,+CAA+C,EAEpD,KAAK,yCAAyC,EAC9C,KAAK,0CAA0C,EAE/C,KAAK,4BAA4B,EACjC,KAAK,6BAA6B,EAElC,KAAK,4BAA4B,EACjC,KAAK,6BAA6B,EAC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S3E;CACL;AAED;;GAEG;AACH,MAAM,CAAC,OAAO,WAAW,qBAAqB,CAAC;IAC7C;;OAEG;IACH,UAAiB,MAAO,SAAQ,IAAI,CAAC,0BAA0B,EAAE,QAAQ,CAAC;QACxE,QAAQ,CAAC,MAAM,CAAC,EAAE,aAAa,CAAC,6BAA6B,GAAG,IAAI,CAAC;KACtE;IAED;;OAEG;IACH,KAAY,IAAI,GAAG,sBAAsB,CAAC;CAC3C"}
|
|
@@ -2,7 +2,8 @@
|
|
|
2
2
|
* @since 1.0.0
|
|
3
3
|
*/
|
|
4
4
|
import type { BedrockRuntimeClientConfig } from "@aws-sdk/client-bedrock-runtime";
|
|
5
|
-
import
|
|
5
|
+
import * as Effect from "effect/Effect";
|
|
6
|
+
import * as Layer from "effect/Layer";
|
|
6
7
|
import type { BedrockRuntimeService } from "./BedrockRuntimeService.js";
|
|
7
8
|
/**
|
|
8
9
|
* @since 1.0.0
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BedrockRuntimeServiceConfig.d.ts","sourceRoot":"","sources":["../../src/BedrockRuntimeServiceConfig.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,iCAAiC,CAAC;AAElF,OAAO,
|
|
1
|
+
{"version":3,"file":"BedrockRuntimeServiceConfig.d.ts","sourceRoot":"","sources":["../../src/BedrockRuntimeServiceConfig.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,iCAAiC,CAAC;AAElF,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAExC,OAAO,KAAK,KAAK,MAAM,cAAc,CAAC;AAEtC,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AAWxE;;;GAGG;AACH,eAAO,MAAM,+BAA+B,EAAE;IAC5C,CAAC,MAAM,EAAE,qBAAqB,CAAC,MAAM,GAAG,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,KAAK,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;IAC5G,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,EAAE,MAAM,EAAE,qBAAqB,CAAC,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;CAKzG,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,8BAA8B,WAAY,sBAAsB,MAAM,qCACxB,CAAC;AAE5D;;;GAGG;AACH,eAAO,MAAM,4BAA4B,EAAE,MAAM,CAAC,MAAM,CAAC,0BAA0B,CAQjF,CAAC"}
|
|
@@ -2,13 +2,15 @@
|
|
|
2
2
|
* @since 1.0.0
|
|
3
3
|
*/
|
|
4
4
|
import { BedrockRuntimeClient } from "@aws-sdk/client-bedrock-runtime";
|
|
5
|
-
import
|
|
5
|
+
import * as Effect from "effect/Effect";
|
|
6
|
+
import * as Layer from "effect/Layer";
|
|
7
|
+
import * as ServiceMap from "effect/ServiceMap";
|
|
6
8
|
import * as BedrockRuntimeServiceConfig from "./BedrockRuntimeServiceConfig.js";
|
|
7
9
|
/**
|
|
8
10
|
* @since 1.0.0
|
|
9
11
|
* @category tags
|
|
10
12
|
*/
|
|
11
|
-
export class BedrockRuntimeClientInstance extends
|
|
13
|
+
export class BedrockRuntimeClientInstance extends ServiceMap.Service()("@effect-aws/client-bedrock-runtime/BedrockRuntimeClientInstance") {
|
|
12
14
|
}
|
|
13
15
|
/**
|
|
14
16
|
* @since 1.0.0
|
|
@@ -19,5 +21,5 @@ export const make = Effect.flatMap(BedrockRuntimeServiceConfig.toBedrockRuntimeC
|
|
|
19
21
|
* @since 1.0.0
|
|
20
22
|
* @category layers
|
|
21
23
|
*/
|
|
22
|
-
export const layer = Layer.
|
|
24
|
+
export const layer = Layer.effect(BedrockRuntimeClientInstance, make);
|
|
23
25
|
//# sourceMappingURL=BedrockRuntimeClientInstance.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BedrockRuntimeClientInstance.js","sourceRoot":"","sources":["../../src/BedrockRuntimeClientInstance.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EAAE,oBAAoB,EAAE,MAAM,iCAAiC,CAAC;AACvE,OAAO,
|
|
1
|
+
{"version":3,"file":"BedrockRuntimeClientInstance.js","sourceRoot":"","sources":["../../src/BedrockRuntimeClientInstance.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EAAE,oBAAoB,EAAE,MAAM,iCAAiC,CAAC;AACvE,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AACxC,OAAO,KAAK,KAAK,MAAM,cAAc,CAAC;AACtC,OAAO,KAAK,UAAU,MAAM,mBAAmB,CAAC;AAChD,OAAO,KAAK,2BAA2B,MAAM,kCAAkC,CAAC;AAEhF;;;GAGG;AACH,MAAM,OAAO,4BACX,SAAQ,UAAU,CAAC,OAAO,EAAsD,CAC9E,iEAAiE,CAClE;CACD;AAEF;;;GAGG;AACH,MAAM,CAAC,MAAM,IAAI,GAAG,MAAM,CAAC,OAAO,CAChC,2BAA2B,CAAC,4BAA4B,EACxD,CAAC,MAAM,EAAE,EAAE,CACT,MAAM,CAAC,cAAc,CACnB,MAAM,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,IAAI,oBAAoB,CAAC,MAAM,CAAC,CAAC,EACnD,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC,CAChD,CACJ,CAAC;AAEF;;;GAGG;AACH,MAAM,CAAC,MAAM,KAAK,GAAG,KAAK,CAAC,MAAM,CAAC,4BAA4B,EAAE,IAAI,CAAC,CAAC"}
|
|
@@ -3,7 +3,9 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import { ApplyGuardrailCommand, ConverseCommand, ConverseStreamCommand, CountTokensCommand, GetAsyncInvokeCommand, InvokeModelCommand, InvokeModelWithBidirectionalStreamCommand, InvokeModelWithResponseStreamCommand, ListAsyncInvokesCommand, StartAsyncInvokeCommand, } from "@aws-sdk/client-bedrock-runtime";
|
|
5
5
|
import { Service } from "@effect-aws/commons";
|
|
6
|
-
import
|
|
6
|
+
import * as Effect from "effect/Effect";
|
|
7
|
+
import * as Layer from "effect/Layer";
|
|
8
|
+
import * as ServiceMap from "effect/ServiceMap";
|
|
7
9
|
import * as Instance from "./BedrockRuntimeClientInstance.js";
|
|
8
10
|
import * as BedrockRuntimeServiceConfig from "./BedrockRuntimeServiceConfig.js";
|
|
9
11
|
import { AllServiceErrors } from "./Errors.js";
|
|
@@ -34,7 +36,7 @@ export const makeBedrockRuntimeService = Effect.gen(function* () {
|
|
|
34
36
|
* @since 1.0.0
|
|
35
37
|
* @category models
|
|
36
38
|
*/
|
|
37
|
-
export class BedrockRuntimeService extends
|
|
39
|
+
export class BedrockRuntimeService extends ServiceMap.Service()("@effect-aws/client-bedrock-runtime/BedrockRuntimeService") {
|
|
38
40
|
static defaultLayer = Layer.effect(this, makeBedrockRuntimeService).pipe(Layer.provide(Instance.layer));
|
|
39
41
|
static layer = (config) => Layer.effect(this, makeBedrockRuntimeService).pipe(Layer.provide(Instance.layer), Layer.provide(BedrockRuntimeServiceConfig.setBedrockRuntimeServiceConfig(config)));
|
|
40
42
|
static baseLayer = (evaluate) => Layer.effect(this, makeBedrockRuntimeService).pipe(Layer.provide(Layer.effect(Instance.BedrockRuntimeClientInstance, Effect.map(BedrockRuntimeServiceConfig.toBedrockRuntimeClientConfig, evaluate))));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BedrockRuntimeService.js","sourceRoot":"","sources":["../../src/BedrockRuntimeService.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EACL,qBAAqB,EAKrB,eAAe,EAGf,qBAAqB,EAGrB,kBAAkB,EAGlB,qBAAqB,EAGrB,kBAAkB,EAGlB,yCAAyC,EAGzC,oCAAoC,EAGpC,uBAAuB,EAGvB,uBAAuB,GAGxB,MAAM,iCAAiC,CAAC;AAEzC,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAE9C,OAAO,
|
|
1
|
+
{"version":3,"file":"BedrockRuntimeService.js","sourceRoot":"","sources":["../../src/BedrockRuntimeService.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EACL,qBAAqB,EAKrB,eAAe,EAGf,qBAAqB,EAGrB,kBAAkB,EAGlB,qBAAqB,EAGrB,kBAAkB,EAGlB,yCAAyC,EAGzC,oCAAoC,EAGpC,uBAAuB,EAGvB,uBAAuB,GAGxB,MAAM,iCAAiC,CAAC;AAEzC,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAE9C,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AACxC,OAAO,KAAK,KAAK,MAAM,cAAc,CAAC;AACtC,OAAO,KAAK,UAAU,MAAM,mBAAmB,CAAC;AAChD,OAAO,KAAK,QAAQ,MAAM,mCAAmC,CAAC;AAC9D,OAAO,KAAK,2BAA2B,MAAM,kCAAkC,CAAC;AAgBhF,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAE/C,MAAM,QAAQ,GAAG;IACf,qBAAqB;IACrB,eAAe;IACf,qBAAqB;IACrB,kBAAkB;IAClB,qBAAqB;IACrB,kBAAkB;IAClB,yCAAyC;IACzC,oCAAoC;IACpC,uBAAuB;IACvB,uBAAuB;CACxB,CAAC;AAmMF;;;GAGG;AACH,MAAM,CAAC,MAAM,yBAAyB,GAAG,MAAM,CAAC,GAAG,CAAC,QAAQ,CAAC;IAC3D,MAAM,MAAM,GAAG,KAAK,CAAC,CAAC,QAAQ,CAAC,4BAA4B,CAAC;IAE5D,OAAO,KAAK,CAAC,CAAC,OAAO,CAAC,qBAAqB,CACzC,MAAM,EACN,QAAQ,EACR;QACE,SAAS,EAAE,gBAAgB;QAC3B,mBAAmB,EAAE,2BAA2B,CAAC,4BAA4B;KAC9E,CACF,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH;;;GAGG;AACH,MAAM,OAAO,qBAAsB,SAAQ,UAAU,CAAC,OAAO,EAG1D,CAAC,0DAA0D,CAAC;IAC7D,MAAM,CAAU,YAAY,GAAG,KAAK,CAAC,MAAM,CAAC,IAAI,EAAE,yBAAyB,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC;IACjH,MAAM,CAAU,KAAK,GAAG,CAAC,MAAoC,EAAE,EAAE,CAC/D,KAAK,CAAC,MAAM,CAAC,IAAI,EAAE,yBAAyB,CAAC,CAAC,IAAI,CAChD,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAC,EAC7B,KAAK,CAAC,OAAO,CAAC,2BAA2B,CAAC,8BAA8B,CAAC,MAAM,CAAC,CAAC,CAClF,CAAC;IACJ,MAAM,CAAU,SAAS,GAAG,CAC1B,QAA6E,EAC7E,EAAE,CACF,KAAK,CAAC,MAAM,CAAC,IAAI,EAAE,yBAAyB,CAAC,CAAC,IAAI,CAChD,KAAK,CAAC,OAAO,CACX,KAAK,CAAC,MAAM,CACV,QAAQ,CAAC,4BAA4B,EACrC,MAAM,CAAC,GAAG,CAAC,2BAA2B,CAAC,4BAA4B,EAAE,QAAQ,CAAC,CAC/E,CACF,CACF,CAAC"}
|
|
@@ -1,28 +1,29 @@
|
|
|
1
1
|
import { ServiceLogger } from "@effect-aws/commons";
|
|
2
|
-
import
|
|
2
|
+
import * as Effect from "effect/Effect";
|
|
3
3
|
import { dual } from "effect/Function";
|
|
4
|
-
import
|
|
4
|
+
import * as Layer from "effect/Layer";
|
|
5
|
+
import * as ServiceMap from "effect/ServiceMap";
|
|
5
6
|
/**
|
|
6
7
|
* @since 1.0.0
|
|
7
8
|
* @category bedrock-runtime service config
|
|
8
9
|
*/
|
|
9
|
-
const currentBedrockRuntimeServiceConfig =
|
|
10
|
+
const currentBedrockRuntimeServiceConfig = ServiceMap.Reference("@effect-aws/client-bedrock-runtime/currentBedrockRuntimeServiceConfig", { defaultValue: () => ({}) });
|
|
10
11
|
/**
|
|
11
12
|
* @since 1.0.0
|
|
12
13
|
* @category bedrock-runtime service config
|
|
13
14
|
*/
|
|
14
|
-
export const withBedrockRuntimeServiceConfig = dual(2, (effect, config) => Effect.
|
|
15
|
+
export const withBedrockRuntimeServiceConfig = dual(2, (effect, config) => Effect.provideService(effect, currentBedrockRuntimeServiceConfig, config));
|
|
15
16
|
/**
|
|
16
17
|
* @since 1.0.0
|
|
17
18
|
* @category bedrock-runtime service config
|
|
18
19
|
*/
|
|
19
|
-
export const setBedrockRuntimeServiceConfig = (config) => Layer.
|
|
20
|
+
export const setBedrockRuntimeServiceConfig = (config) => Layer.succeed(currentBedrockRuntimeServiceConfig, config);
|
|
20
21
|
/**
|
|
21
22
|
* @since 1.0.0
|
|
22
23
|
* @category adapters
|
|
23
24
|
*/
|
|
24
25
|
export const toBedrockRuntimeClientConfig = Effect.gen(function* () {
|
|
25
|
-
const { logger: serviceLogger, ...config } = yield*
|
|
26
|
+
const { logger: serviceLogger, ...config } = yield* currentBedrockRuntimeServiceConfig;
|
|
26
27
|
const logger = serviceLogger === true
|
|
27
28
|
? yield* ServiceLogger.toClientLogger(ServiceLogger.defaultServiceLogger)
|
|
28
29
|
: (serviceLogger ? yield* ServiceLogger.toClientLogger(ServiceLogger.make(serviceLogger)) : undefined);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BedrockRuntimeServiceConfig.js","sourceRoot":"","sources":["../../src/BedrockRuntimeServiceConfig.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,aAAa,EAAE,MAAM,qBAA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aAAa,CAAC,cAAc,CAAC,aAAa,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC;IAEzG,OAAO,EAAE,MAAM,EAAE,GAAG,MAAM,EAAE,CAAC;AAC/B,CAAC,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@effect-aws/client-bedrock-runtime",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.0-beta.1",
|
|
4
4
|
"description": "Effectful AWS Bedrock Runtime client",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -16,40 +16,34 @@
|
|
|
16
16
|
"homepage": "https://floydspace.github.io/effect-aws/docs/client-bedrock-runtime",
|
|
17
17
|
"dependencies": {
|
|
18
18
|
"@aws-sdk/client-bedrock-runtime": "^3",
|
|
19
|
-
"@effect-aws/commons": "^0.
|
|
19
|
+
"@effect-aws/commons": "^1.0.0-beta.1"
|
|
20
20
|
},
|
|
21
21
|
"peerDependencies": {
|
|
22
|
-
"effect": ">=
|
|
22
|
+
"effect": ">=4.0.0 <5.0.0"
|
|
23
23
|
},
|
|
24
|
-
"main": "./dist/cjs/index.js",
|
|
25
24
|
"module": "./dist/esm/index.js",
|
|
26
25
|
"types": "./dist/dts/index.d.ts",
|
|
27
26
|
"exports": {
|
|
28
27
|
"./package.json": "./package.json",
|
|
29
28
|
".": {
|
|
30
29
|
"types": "./dist/dts/index.d.ts",
|
|
31
|
-
"import": "./dist/esm/index.js"
|
|
32
|
-
"default": "./dist/cjs/index.js"
|
|
30
|
+
"import": "./dist/esm/index.js"
|
|
33
31
|
},
|
|
34
32
|
"./BedrockRuntimeClientInstance": {
|
|
35
33
|
"types": "./dist/dts/BedrockRuntimeClientInstance.d.ts",
|
|
36
|
-
"import": "./dist/esm/BedrockRuntimeClientInstance.js"
|
|
37
|
-
"default": "./dist/cjs/BedrockRuntimeClientInstance.js"
|
|
34
|
+
"import": "./dist/esm/BedrockRuntimeClientInstance.js"
|
|
38
35
|
},
|
|
39
36
|
"./BedrockRuntimeService": {
|
|
40
37
|
"types": "./dist/dts/BedrockRuntimeService.d.ts",
|
|
41
|
-
"import": "./dist/esm/BedrockRuntimeService.js"
|
|
42
|
-
"default": "./dist/cjs/BedrockRuntimeService.js"
|
|
38
|
+
"import": "./dist/esm/BedrockRuntimeService.js"
|
|
43
39
|
},
|
|
44
40
|
"./BedrockRuntimeServiceConfig": {
|
|
45
41
|
"types": "./dist/dts/BedrockRuntimeServiceConfig.d.ts",
|
|
46
|
-
"import": "./dist/esm/BedrockRuntimeServiceConfig.js"
|
|
47
|
-
"default": "./dist/cjs/BedrockRuntimeServiceConfig.js"
|
|
42
|
+
"import": "./dist/esm/BedrockRuntimeServiceConfig.js"
|
|
48
43
|
},
|
|
49
44
|
"./Errors": {
|
|
50
45
|
"types": "./dist/dts/Errors.d.ts",
|
|
51
|
-
"import": "./dist/esm/Errors.js"
|
|
52
|
-
"default": "./dist/cjs/Errors.js"
|
|
46
|
+
"import": "./dist/esm/Errors.js"
|
|
53
47
|
}
|
|
54
48
|
},
|
|
55
49
|
"typesVersions": {
|
|
@@ -2,16 +2,20 @@
|
|
|
2
2
|
* @since 1.0.0
|
|
3
3
|
*/
|
|
4
4
|
import { BedrockRuntimeClient } from "@aws-sdk/client-bedrock-runtime";
|
|
5
|
-
import
|
|
5
|
+
import * as Effect from "effect/Effect";
|
|
6
|
+
import * as Layer from "effect/Layer";
|
|
7
|
+
import * as ServiceMap from "effect/ServiceMap";
|
|
6
8
|
import * as BedrockRuntimeServiceConfig from "./BedrockRuntimeServiceConfig.js";
|
|
7
9
|
|
|
8
10
|
/**
|
|
9
11
|
* @since 1.0.0
|
|
10
12
|
* @category tags
|
|
11
13
|
*/
|
|
12
|
-
export class BedrockRuntimeClientInstance
|
|
13
|
-
|
|
14
|
-
|
|
14
|
+
export class BedrockRuntimeClientInstance
|
|
15
|
+
extends ServiceMap.Service<BedrockRuntimeClientInstance, BedrockRuntimeClient>()(
|
|
16
|
+
"@effect-aws/client-bedrock-runtime/BedrockRuntimeClientInstance",
|
|
17
|
+
)
|
|
18
|
+
{}
|
|
15
19
|
|
|
16
20
|
/**
|
|
17
21
|
* @since 1.0.0
|
|
@@ -30,4 +34,4 @@ export const make = Effect.flatMap(
|
|
|
30
34
|
* @since 1.0.0
|
|
31
35
|
* @category layers
|
|
32
36
|
*/
|
|
33
|
-
export const layer = Layer.
|
|
37
|
+
export const layer = Layer.effect(BedrockRuntimeClientInstance, make);
|
|
@@ -37,8 +37,10 @@ import {
|
|
|
37
37
|
} from "@aws-sdk/client-bedrock-runtime";
|
|
38
38
|
import type { HttpHandlerOptions, ServiceLogger } from "@effect-aws/commons";
|
|
39
39
|
import { Service } from "@effect-aws/commons";
|
|
40
|
-
import type
|
|
41
|
-
import
|
|
40
|
+
import type * as Cause from "effect/Cause";
|
|
41
|
+
import * as Effect from "effect/Effect";
|
|
42
|
+
import * as Layer from "effect/Layer";
|
|
43
|
+
import * as ServiceMap from "effect/ServiceMap";
|
|
42
44
|
import * as Instance from "./BedrockRuntimeClientInstance.js";
|
|
43
45
|
import * as BedrockRuntimeServiceConfig from "./BedrockRuntimeServiceConfig.js";
|
|
44
46
|
import type {
|
|
@@ -82,7 +84,7 @@ interface BedrockRuntimeService$ {
|
|
|
82
84
|
options?: HttpHandlerOptions,
|
|
83
85
|
): Effect.Effect<
|
|
84
86
|
ApplyGuardrailCommandOutput,
|
|
85
|
-
| Cause.
|
|
87
|
+
| Cause.TimeoutError
|
|
86
88
|
| SdkError
|
|
87
89
|
| AccessDeniedError
|
|
88
90
|
| InternalServerError
|
|
@@ -101,7 +103,7 @@ interface BedrockRuntimeService$ {
|
|
|
101
103
|
options?: HttpHandlerOptions,
|
|
102
104
|
): Effect.Effect<
|
|
103
105
|
ConverseCommandOutput,
|
|
104
|
-
| Cause.
|
|
106
|
+
| Cause.TimeoutError
|
|
105
107
|
| SdkError
|
|
106
108
|
| AccessDeniedError
|
|
107
109
|
| InternalServerError
|
|
@@ -122,7 +124,7 @@ interface BedrockRuntimeService$ {
|
|
|
122
124
|
options?: HttpHandlerOptions,
|
|
123
125
|
): Effect.Effect<
|
|
124
126
|
ConverseStreamCommandOutput,
|
|
125
|
-
| Cause.
|
|
127
|
+
| Cause.TimeoutError
|
|
126
128
|
| SdkError
|
|
127
129
|
| AccessDeniedError
|
|
128
130
|
| InternalServerError
|
|
@@ -143,7 +145,7 @@ interface BedrockRuntimeService$ {
|
|
|
143
145
|
options?: HttpHandlerOptions,
|
|
144
146
|
): Effect.Effect<
|
|
145
147
|
CountTokensCommandOutput,
|
|
146
|
-
| Cause.
|
|
148
|
+
| Cause.TimeoutError
|
|
147
149
|
| SdkError
|
|
148
150
|
| AccessDeniedError
|
|
149
151
|
| InternalServerError
|
|
@@ -161,7 +163,7 @@ interface BedrockRuntimeService$ {
|
|
|
161
163
|
options?: HttpHandlerOptions,
|
|
162
164
|
): Effect.Effect<
|
|
163
165
|
GetAsyncInvokeCommandOutput,
|
|
164
|
-
Cause.
|
|
166
|
+
Cause.TimeoutError | SdkError | AccessDeniedError | InternalServerError | ThrottlingError | ValidationError
|
|
165
167
|
>;
|
|
166
168
|
|
|
167
169
|
/**
|
|
@@ -172,7 +174,7 @@ interface BedrockRuntimeService$ {
|
|
|
172
174
|
options?: HttpHandlerOptions,
|
|
173
175
|
): Effect.Effect<
|
|
174
176
|
InvokeModelCommandOutput,
|
|
175
|
-
| Cause.
|
|
177
|
+
| Cause.TimeoutError
|
|
176
178
|
| SdkError
|
|
177
179
|
| AccessDeniedError
|
|
178
180
|
| InternalServerError
|
|
@@ -194,7 +196,7 @@ interface BedrockRuntimeService$ {
|
|
|
194
196
|
options?: HttpHandlerOptions,
|
|
195
197
|
): Effect.Effect<
|
|
196
198
|
InvokeModelWithBidirectionalStreamCommandOutput,
|
|
197
|
-
| Cause.
|
|
199
|
+
| Cause.TimeoutError
|
|
198
200
|
| SdkError
|
|
199
201
|
| AccessDeniedError
|
|
200
202
|
| InternalServerError
|
|
@@ -217,7 +219,7 @@ interface BedrockRuntimeService$ {
|
|
|
217
219
|
options?: HttpHandlerOptions,
|
|
218
220
|
): Effect.Effect<
|
|
219
221
|
InvokeModelWithResponseStreamCommandOutput,
|
|
220
|
-
| Cause.
|
|
222
|
+
| Cause.TimeoutError
|
|
221
223
|
| SdkError
|
|
222
224
|
| AccessDeniedError
|
|
223
225
|
| InternalServerError
|
|
@@ -240,7 +242,7 @@ interface BedrockRuntimeService$ {
|
|
|
240
242
|
options?: HttpHandlerOptions,
|
|
241
243
|
): Effect.Effect<
|
|
242
244
|
ListAsyncInvokesCommandOutput,
|
|
243
|
-
Cause.
|
|
245
|
+
Cause.TimeoutError | SdkError | AccessDeniedError | InternalServerError | ThrottlingError | ValidationError
|
|
244
246
|
>;
|
|
245
247
|
|
|
246
248
|
/**
|
|
@@ -251,7 +253,7 @@ interface BedrockRuntimeService$ {
|
|
|
251
253
|
options?: HttpHandlerOptions,
|
|
252
254
|
): Effect.Effect<
|
|
253
255
|
StartAsyncInvokeCommandOutput,
|
|
254
|
-
| Cause.
|
|
256
|
+
| Cause.TimeoutError
|
|
255
257
|
| SdkError
|
|
256
258
|
| AccessDeniedError
|
|
257
259
|
| ConflictError
|
|
@@ -285,10 +287,10 @@ export const makeBedrockRuntimeService = Effect.gen(function*() {
|
|
|
285
287
|
* @since 1.0.0
|
|
286
288
|
* @category models
|
|
287
289
|
*/
|
|
288
|
-
export class BedrockRuntimeService extends
|
|
290
|
+
export class BedrockRuntimeService extends ServiceMap.Service<
|
|
289
291
|
BedrockRuntimeService,
|
|
290
292
|
BedrockRuntimeService$
|
|
291
|
-
>() {
|
|
293
|
+
>()("@effect-aws/client-bedrock-runtime/BedrockRuntimeService") {
|
|
292
294
|
static readonly defaultLayer = Layer.effect(this, makeBedrockRuntimeService).pipe(Layer.provide(Instance.layer));
|
|
293
295
|
static readonly layer = (config: BedrockRuntimeService.Config) =>
|
|
294
296
|
Layer.effect(this, makeBedrockRuntimeService).pipe(
|
|
@@ -3,18 +3,19 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import type { BedrockRuntimeClientConfig } from "@aws-sdk/client-bedrock-runtime";
|
|
5
5
|
import { ServiceLogger } from "@effect-aws/commons";
|
|
6
|
-
import
|
|
6
|
+
import * as Effect from "effect/Effect";
|
|
7
7
|
import { dual } from "effect/Function";
|
|
8
|
-
import
|
|
8
|
+
import * as Layer from "effect/Layer";
|
|
9
|
+
import * as ServiceMap from "effect/ServiceMap";
|
|
9
10
|
import type { BedrockRuntimeService } from "./BedrockRuntimeService.js";
|
|
10
11
|
|
|
11
12
|
/**
|
|
12
13
|
* @since 1.0.0
|
|
13
14
|
* @category bedrock-runtime service config
|
|
14
15
|
*/
|
|
15
|
-
const currentBedrockRuntimeServiceConfig =
|
|
16
|
+
const currentBedrockRuntimeServiceConfig = ServiceMap.Reference<BedrockRuntimeService.Config>(
|
|
16
17
|
"@effect-aws/client-bedrock-runtime/currentBedrockRuntimeServiceConfig",
|
|
17
|
-
() =>
|
|
18
|
+
{ defaultValue: () => ({}) },
|
|
18
19
|
);
|
|
19
20
|
|
|
20
21
|
/**
|
|
@@ -27,7 +28,7 @@ export const withBedrockRuntimeServiceConfig: {
|
|
|
27
28
|
} = dual(
|
|
28
29
|
2,
|
|
29
30
|
<A, E, R>(effect: Effect.Effect<A, E, R>, config: BedrockRuntimeService.Config): Effect.Effect<A, E, R> =>
|
|
30
|
-
Effect.
|
|
31
|
+
Effect.provideService(effect, currentBedrockRuntimeServiceConfig, config),
|
|
31
32
|
);
|
|
32
33
|
|
|
33
34
|
/**
|
|
@@ -35,14 +36,14 @@ export const withBedrockRuntimeServiceConfig: {
|
|
|
35
36
|
* @category bedrock-runtime service config
|
|
36
37
|
*/
|
|
37
38
|
export const setBedrockRuntimeServiceConfig = (config: BedrockRuntimeService.Config) =>
|
|
38
|
-
Layer.
|
|
39
|
+
Layer.succeed(currentBedrockRuntimeServiceConfig, config);
|
|
39
40
|
|
|
40
41
|
/**
|
|
41
42
|
* @since 1.0.0
|
|
42
43
|
* @category adapters
|
|
43
44
|
*/
|
|
44
45
|
export const toBedrockRuntimeClientConfig: Effect.Effect<BedrockRuntimeClientConfig> = Effect.gen(function*() {
|
|
45
|
-
const { logger: serviceLogger, ...config } = yield*
|
|
46
|
+
const { logger: serviceLogger, ...config } = yield* currentBedrockRuntimeServiceConfig;
|
|
46
47
|
|
|
47
48
|
const logger = serviceLogger === true
|
|
48
49
|
? yield* ServiceLogger.toClientLogger(ServiceLogger.defaultServiceLogger)
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @since 1.0.0
|
|
3
|
-
*/
|
|
4
|
-
import { BedrockRuntimeClient } from "@aws-sdk/client-bedrock-runtime";
|
|
5
|
-
import { Context, Effect, Layer } from "effect";
|
|
6
|
-
declare const BedrockRuntimeClientInstance_base: Context.TagClass<BedrockRuntimeClientInstance, "@effect-aws/client-bedrock-runtime/BedrockRuntimeClientInstance", BedrockRuntimeClient>;
|
|
7
|
-
/**
|
|
8
|
-
* @since 1.0.0
|
|
9
|
-
* @category tags
|
|
10
|
-
*/
|
|
11
|
-
export declare class BedrockRuntimeClientInstance extends BedrockRuntimeClientInstance_base {
|
|
12
|
-
}
|
|
13
|
-
/**
|
|
14
|
-
* @since 1.0.0
|
|
15
|
-
* @category constructors
|
|
16
|
-
*/
|
|
17
|
-
export declare const make: Effect.Effect<BedrockRuntimeClient, never, import("effect/Scope").Scope>;
|
|
18
|
-
/**
|
|
19
|
-
* @since 1.0.0
|
|
20
|
-
* @category layers
|
|
21
|
-
*/
|
|
22
|
-
export declare const layer: Layer.Layer<BedrockRuntimeClientInstance, never, never>;
|
|
23
|
-
export {};
|
|
24
|
-
//# sourceMappingURL=BedrockRuntimeClientInstance.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"BedrockRuntimeClientInstance.d.ts","sourceRoot":"","sources":["../../src/BedrockRuntimeClientInstance.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EAAE,oBAAoB,EAAE,MAAM,iCAAiC,CAAC;AACvE,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAC;;AAGhD;;;GAGG;AACH,qBAAa,4BAA6B,SAAQ,iCAEK;CAAG;AAE1D;;;GAGG;AACH,eAAO,MAAM,IAAI,0EAOhB,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,KAAK,yDAAmD,CAAC"}
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
exports.layer = exports.make = exports.BedrockRuntimeClientInstance = void 0;
|
|
27
|
-
/**
|
|
28
|
-
* @since 1.0.0
|
|
29
|
-
*/
|
|
30
|
-
const client_bedrock_runtime_1 = require("@aws-sdk/client-bedrock-runtime");
|
|
31
|
-
const effect_1 = require("effect");
|
|
32
|
-
const BedrockRuntimeServiceConfig = __importStar(require("./BedrockRuntimeServiceConfig.js"));
|
|
33
|
-
/**
|
|
34
|
-
* @since 1.0.0
|
|
35
|
-
* @category tags
|
|
36
|
-
*/
|
|
37
|
-
class BedrockRuntimeClientInstance extends effect_1.Context.Tag("@effect-aws/client-bedrock-runtime/BedrockRuntimeClientInstance")() {
|
|
38
|
-
}
|
|
39
|
-
exports.BedrockRuntimeClientInstance = BedrockRuntimeClientInstance;
|
|
40
|
-
/**
|
|
41
|
-
* @since 1.0.0
|
|
42
|
-
* @category constructors
|
|
43
|
-
*/
|
|
44
|
-
exports.make = effect_1.Effect.flatMap(BedrockRuntimeServiceConfig.toBedrockRuntimeClientConfig, (config) => effect_1.Effect.acquireRelease(effect_1.Effect.sync(() => new client_bedrock_runtime_1.BedrockRuntimeClient(config)), (client) => effect_1.Effect.sync(() => client.destroy())));
|
|
45
|
-
/**
|
|
46
|
-
* @since 1.0.0
|
|
47
|
-
* @category layers
|
|
48
|
-
*/
|
|
49
|
-
exports.layer = effect_1.Layer.scoped(BedrockRuntimeClientInstance, exports.make);
|
|
50
|
-
//# sourceMappingURL=BedrockRuntimeClientInstance.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"BedrockRuntimeClientInstance.js","sourceRoot":"","sources":["../../src/BedrockRuntimeClientInstance.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;GAEG;AACH,4EAAuE;AACvE,mCAAgD;AAChD,8FAAgF;AAEhF;;;GAGG;AACH,MAAa,4BAA6B,SAAQ,gBAAO,CAAC,GAAG,CAC3D,iEAAiE,CAClE,EAAsD;CAAG;AAF1D,oEAE0D;AAE1D;;;GAGG;AACU,QAAA,IAAI,GAAG,eAAM,CAAC,OAAO,CAChC,2BAA2B,CAAC,4BAA4B,EACxD,CAAC,MAAM,EAAE,EAAE,CACT,eAAM,CAAC,cAAc,CACnB,eAAM,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,IAAI,6CAAoB,CAAC,MAAM,CAAC,CAAC,EACnD,CAAC,MAAM,EAAE,EAAE,CAAC,eAAM,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC,CAChD,CACJ,CAAC;AAEF;;;GAGG;AACU,QAAA,KAAK,GAAG,cAAK,CAAC,MAAM,CAAC,4BAA4B,EAAE,YAAI,CAAC,CAAC"}
|
|
@@ -1,86 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @since 1.0.0
|
|
3
|
-
*/
|
|
4
|
-
import { type ApplyGuardrailCommandInput, type ApplyGuardrailCommandOutput, type BedrockRuntimeClient, type BedrockRuntimeClientConfig, type ConverseCommandInput, type ConverseCommandOutput, type ConverseStreamCommandInput, type ConverseStreamCommandOutput, type CountTokensCommandInput, type CountTokensCommandOutput, type GetAsyncInvokeCommandInput, type GetAsyncInvokeCommandOutput, type InvokeModelCommandInput, type InvokeModelCommandOutput, type InvokeModelWithBidirectionalStreamCommandInput, type InvokeModelWithBidirectionalStreamCommandOutput, type InvokeModelWithResponseStreamCommandInput, type InvokeModelWithResponseStreamCommandOutput, type ListAsyncInvokesCommandInput, type ListAsyncInvokesCommandOutput, type StartAsyncInvokeCommandInput, type StartAsyncInvokeCommandOutput } from "@aws-sdk/client-bedrock-runtime";
|
|
5
|
-
import type { HttpHandlerOptions, ServiceLogger } from "@effect-aws/commons";
|
|
6
|
-
import type { Cause } from "effect";
|
|
7
|
-
import { Effect, Layer } from "effect";
|
|
8
|
-
import * as Instance from "./BedrockRuntimeClientInstance.js";
|
|
9
|
-
import type { AccessDeniedError, ConflictError, InternalServerError, ModelError, ModelNotReadyError, ModelStreamError, ModelTimeoutError, ResourceNotFoundError, SdkError, ServiceQuotaExceededError, ServiceUnavailableError, ThrottlingError, ValidationError } from "./Errors.js";
|
|
10
|
-
interface BedrockRuntimeService$ {
|
|
11
|
-
readonly _: unique symbol;
|
|
12
|
-
/**
|
|
13
|
-
* @see {@link ApplyGuardrailCommand}
|
|
14
|
-
*/
|
|
15
|
-
applyGuardrail(args: ApplyGuardrailCommandInput, options?: HttpHandlerOptions): Effect.Effect<ApplyGuardrailCommandOutput, Cause.TimeoutException | SdkError | AccessDeniedError | InternalServerError | ResourceNotFoundError | ServiceQuotaExceededError | ServiceUnavailableError | ThrottlingError | ValidationError>;
|
|
16
|
-
/**
|
|
17
|
-
* @see {@link ConverseCommand}
|
|
18
|
-
*/
|
|
19
|
-
converse(args: ConverseCommandInput, options?: HttpHandlerOptions): Effect.Effect<ConverseCommandOutput, Cause.TimeoutException | SdkError | AccessDeniedError | InternalServerError | ModelError | ModelNotReadyError | ModelTimeoutError | ResourceNotFoundError | ServiceUnavailableError | ThrottlingError | ValidationError>;
|
|
20
|
-
/**
|
|
21
|
-
* @see {@link ConverseStreamCommand}
|
|
22
|
-
*/
|
|
23
|
-
converseStream(args: ConverseStreamCommandInput, options?: HttpHandlerOptions): Effect.Effect<ConverseStreamCommandOutput, Cause.TimeoutException | SdkError | AccessDeniedError | InternalServerError | ModelError | ModelNotReadyError | ModelTimeoutError | ResourceNotFoundError | ServiceUnavailableError | ThrottlingError | ValidationError>;
|
|
24
|
-
/**
|
|
25
|
-
* @see {@link CountTokensCommand}
|
|
26
|
-
*/
|
|
27
|
-
countTokens(args: CountTokensCommandInput, options?: HttpHandlerOptions): Effect.Effect<CountTokensCommandOutput, Cause.TimeoutException | SdkError | AccessDeniedError | InternalServerError | ResourceNotFoundError | ServiceUnavailableError | ThrottlingError | ValidationError>;
|
|
28
|
-
/**
|
|
29
|
-
* @see {@link GetAsyncInvokeCommand}
|
|
30
|
-
*/
|
|
31
|
-
getAsyncInvoke(args: GetAsyncInvokeCommandInput, options?: HttpHandlerOptions): Effect.Effect<GetAsyncInvokeCommandOutput, Cause.TimeoutException | SdkError | AccessDeniedError | InternalServerError | ThrottlingError | ValidationError>;
|
|
32
|
-
/**
|
|
33
|
-
* @see {@link InvokeModelCommand}
|
|
34
|
-
*/
|
|
35
|
-
invokeModel(args: InvokeModelCommandInput, options?: HttpHandlerOptions): Effect.Effect<InvokeModelCommandOutput, Cause.TimeoutException | SdkError | AccessDeniedError | InternalServerError | ModelError | ModelNotReadyError | ModelTimeoutError | ResourceNotFoundError | ServiceQuotaExceededError | ServiceUnavailableError | ThrottlingError | ValidationError>;
|
|
36
|
-
/**
|
|
37
|
-
* @see {@link InvokeModelWithBidirectionalStreamCommand}
|
|
38
|
-
*/
|
|
39
|
-
invokeModelWithBidirectionalStream(args: InvokeModelWithBidirectionalStreamCommandInput, options?: HttpHandlerOptions): Effect.Effect<InvokeModelWithBidirectionalStreamCommandOutput, Cause.TimeoutException | SdkError | AccessDeniedError | InternalServerError | ModelError | ModelNotReadyError | ModelStreamError | ModelTimeoutError | ResourceNotFoundError | ServiceQuotaExceededError | ServiceUnavailableError | ThrottlingError | ValidationError>;
|
|
40
|
-
/**
|
|
41
|
-
* @see {@link InvokeModelWithResponseStreamCommand}
|
|
42
|
-
*/
|
|
43
|
-
invokeModelWithResponseStream(args: InvokeModelWithResponseStreamCommandInput, options?: HttpHandlerOptions): Effect.Effect<InvokeModelWithResponseStreamCommandOutput, Cause.TimeoutException | SdkError | AccessDeniedError | InternalServerError | ModelError | ModelNotReadyError | ModelStreamError | ModelTimeoutError | ResourceNotFoundError | ServiceQuotaExceededError | ServiceUnavailableError | ThrottlingError | ValidationError>;
|
|
44
|
-
/**
|
|
45
|
-
* @see {@link ListAsyncInvokesCommand}
|
|
46
|
-
*/
|
|
47
|
-
listAsyncInvokes(args: ListAsyncInvokesCommandInput, options?: HttpHandlerOptions): Effect.Effect<ListAsyncInvokesCommandOutput, Cause.TimeoutException | SdkError | AccessDeniedError | InternalServerError | ThrottlingError | ValidationError>;
|
|
48
|
-
/**
|
|
49
|
-
* @see {@link StartAsyncInvokeCommand}
|
|
50
|
-
*/
|
|
51
|
-
startAsyncInvoke(args: StartAsyncInvokeCommandInput, options?: HttpHandlerOptions): Effect.Effect<StartAsyncInvokeCommandOutput, Cause.TimeoutException | SdkError | AccessDeniedError | ConflictError | InternalServerError | ResourceNotFoundError | ServiceQuotaExceededError | ServiceUnavailableError | ThrottlingError | ValidationError>;
|
|
52
|
-
}
|
|
53
|
-
/**
|
|
54
|
-
* @since 1.0.0
|
|
55
|
-
* @category constructors
|
|
56
|
-
*/
|
|
57
|
-
export declare const makeBedrockRuntimeService: Effect.Effect<BedrockRuntimeService$, never, Instance.BedrockRuntimeClientInstance>;
|
|
58
|
-
declare const BedrockRuntimeService_base: import("effect/Context").TagClass<BedrockRuntimeService, "@effect-aws/client-bedrock-runtime/BedrockRuntimeService", BedrockRuntimeService$> & Effect.Tag.Proxy<BedrockRuntimeService, BedrockRuntimeService$> & {
|
|
59
|
-
use: <X>(body: (_: BedrockRuntimeService$) => X) => [X] extends [Effect.Effect<infer A, infer E, infer R>] ? Effect.Effect<A, E, BedrockRuntimeService | R> : [X] extends [PromiseLike<infer A_1>] ? Effect.Effect<A_1, Cause.UnknownException, BedrockRuntimeService> : Effect.Effect<X, never, BedrockRuntimeService>;
|
|
60
|
-
};
|
|
61
|
-
/**
|
|
62
|
-
* @since 1.0.0
|
|
63
|
-
* @category models
|
|
64
|
-
*/
|
|
65
|
-
export declare class BedrockRuntimeService extends BedrockRuntimeService_base {
|
|
66
|
-
static readonly defaultLayer: Layer.Layer<BedrockRuntimeService, never, never>;
|
|
67
|
-
static readonly layer: (config: BedrockRuntimeService.Config) => Layer.Layer<BedrockRuntimeService, never, never>;
|
|
68
|
-
static readonly baseLayer: (evaluate: (defaultConfig: BedrockRuntimeClientConfig) => BedrockRuntimeClient) => Layer.Layer<BedrockRuntimeService, never, never>;
|
|
69
|
-
}
|
|
70
|
-
/**
|
|
71
|
-
* @since 1.0.0
|
|
72
|
-
*/
|
|
73
|
-
export declare namespace BedrockRuntimeService {
|
|
74
|
-
/**
|
|
75
|
-
* @since 1.0.0
|
|
76
|
-
*/
|
|
77
|
-
interface Config extends Omit<BedrockRuntimeClientConfig, "logger"> {
|
|
78
|
-
readonly logger?: ServiceLogger.ServiceLoggerConstructorProps | true;
|
|
79
|
-
}
|
|
80
|
-
/**
|
|
81
|
-
* @since 1.0.0
|
|
82
|
-
*/
|
|
83
|
-
type Type = BedrockRuntimeService$;
|
|
84
|
-
}
|
|
85
|
-
export {};
|
|
86
|
-
//# sourceMappingURL=BedrockRuntimeService.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"BedrockRuntimeService.d.ts","sourceRoot":"","sources":["../../src/BedrockRuntimeService.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EAEL,KAAK,0BAA0B,EAC/B,KAAK,2BAA2B,EAChC,KAAK,oBAAoB,EACzB,KAAK,0BAA0B,EAE/B,KAAK,oBAAoB,EACzB,KAAK,qBAAqB,EAE1B,KAAK,0BAA0B,EAC/B,KAAK,2BAA2B,EAEhC,KAAK,uBAAuB,EAC5B,KAAK,wBAAwB,EAE7B,KAAK,0BAA0B,EAC/B,KAAK,2BAA2B,EAEhC,KAAK,uBAAuB,EAC5B,KAAK,wBAAwB,EAE7B,KAAK,8CAA8C,EACnD,KAAK,+CAA+C,EAEpD,KAAK,yCAAyC,EAC9C,KAAK,0CAA0C,EAE/C,KAAK,4BAA4B,EACjC,KAAK,6BAA6B,EAElC,KAAK,4BAA4B,EACjC,KAAK,6BAA6B,EACnC,MAAM,iCAAiC,CAAC;AACzC,OAAO,KAAK,EAAE,kBAAkB,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAE7E,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAC;AACpC,OAAO,EAAE,MAAM,EAAE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KACtE;IAED;;OAEG;IACH,KAAY,IAAI,GAAG,sBAAsB,CAAC;CAC3C"}
|
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
exports.BedrockRuntimeService = exports.makeBedrockRuntimeService = void 0;
|
|
27
|
-
/**
|
|
28
|
-
* @since 1.0.0
|
|
29
|
-
*/
|
|
30
|
-
const client_bedrock_runtime_1 = require("@aws-sdk/client-bedrock-runtime");
|
|
31
|
-
const commons_1 = require("@effect-aws/commons");
|
|
32
|
-
const effect_1 = require("effect");
|
|
33
|
-
const Instance = __importStar(require("./BedrockRuntimeClientInstance.js"));
|
|
34
|
-
const BedrockRuntimeServiceConfig = __importStar(require("./BedrockRuntimeServiceConfig.js"));
|
|
35
|
-
const Errors_js_1 = require("./Errors.js");
|
|
36
|
-
const commands = {
|
|
37
|
-
ApplyGuardrailCommand: client_bedrock_runtime_1.ApplyGuardrailCommand,
|
|
38
|
-
ConverseCommand: client_bedrock_runtime_1.ConverseCommand,
|
|
39
|
-
ConverseStreamCommand: client_bedrock_runtime_1.ConverseStreamCommand,
|
|
40
|
-
CountTokensCommand: client_bedrock_runtime_1.CountTokensCommand,
|
|
41
|
-
GetAsyncInvokeCommand: client_bedrock_runtime_1.GetAsyncInvokeCommand,
|
|
42
|
-
InvokeModelCommand: client_bedrock_runtime_1.InvokeModelCommand,
|
|
43
|
-
InvokeModelWithBidirectionalStreamCommand: client_bedrock_runtime_1.InvokeModelWithBidirectionalStreamCommand,
|
|
44
|
-
InvokeModelWithResponseStreamCommand: client_bedrock_runtime_1.InvokeModelWithResponseStreamCommand,
|
|
45
|
-
ListAsyncInvokesCommand: client_bedrock_runtime_1.ListAsyncInvokesCommand,
|
|
46
|
-
StartAsyncInvokeCommand: client_bedrock_runtime_1.StartAsyncInvokeCommand,
|
|
47
|
-
};
|
|
48
|
-
/**
|
|
49
|
-
* @since 1.0.0
|
|
50
|
-
* @category constructors
|
|
51
|
-
*/
|
|
52
|
-
exports.makeBedrockRuntimeService = effect_1.Effect.gen(function* () {
|
|
53
|
-
const client = yield* Instance.BedrockRuntimeClientInstance;
|
|
54
|
-
return yield* commons_1.Service.fromClientAndCommands(client, commands, {
|
|
55
|
-
errorTags: Errors_js_1.AllServiceErrors,
|
|
56
|
-
resolveClientConfig: BedrockRuntimeServiceConfig.toBedrockRuntimeClientConfig,
|
|
57
|
-
});
|
|
58
|
-
});
|
|
59
|
-
/**
|
|
60
|
-
* @since 1.0.0
|
|
61
|
-
* @category models
|
|
62
|
-
*/
|
|
63
|
-
class BedrockRuntimeService extends effect_1.Effect.Tag("@effect-aws/client-bedrock-runtime/BedrockRuntimeService")() {
|
|
64
|
-
static defaultLayer = effect_1.Layer.effect(this, exports.makeBedrockRuntimeService).pipe(effect_1.Layer.provide(Instance.layer));
|
|
65
|
-
static layer = (config) => effect_1.Layer.effect(this, exports.makeBedrockRuntimeService).pipe(effect_1.Layer.provide(Instance.layer), effect_1.Layer.provide(BedrockRuntimeServiceConfig.setBedrockRuntimeServiceConfig(config)));
|
|
66
|
-
static baseLayer = (evaluate) => effect_1.Layer.effect(this, exports.makeBedrockRuntimeService).pipe(effect_1.Layer.provide(effect_1.Layer.effect(Instance.BedrockRuntimeClientInstance, effect_1.Effect.map(BedrockRuntimeServiceConfig.toBedrockRuntimeClientConfig, evaluate))));
|
|
67
|
-
}
|
|
68
|
-
exports.BedrockRuntimeService = BedrockRuntimeService;
|
|
69
|
-
//# sourceMappingURL=BedrockRuntimeService.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"BedrockRuntimeService.js","sourceRoot":"","sources":["../../src/BedrockRuntimeService.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;GAEG;AACH,4EAiCyC;AAEzC,iDAA8C;AAE9C,mCAAuC;AACvC,4EAA8D;AAC9D,8FAAgF;AAgBhF,2CAA+C;AAE/C,MAAM,QAAQ,GAAG;IACf,qBAAqB,EAArB,8CAAqB;IACrB,eAAe,EAAf,wCAAe;IACf,qBAAqB,EAArB,8CAAqB;IACrB,kBAAkB,EAAlB,2CAAkB;IAClB,qBAAqB,EAArB,8CAAqB;IACrB,kBAAkB,EAAlB,2CAAkB;IAClB,yCAAyC,EAAzC,kEAAyC;IACzC,oCAAoC,EAApC,6DAAoC;IACpC,uBAAuB,EAAvB,gDAAuB;IACvB,uBAAuB,EAAvB,gDAAuB;CACxB,CAAC;AAmMF;;;GAGG;AACU,QAAA,yBAAyB,GAAG,eAAM,CAAC,GAAG,CAAC,QAAQ,CAAC;IAC3D,MAAM,MAAM,GAAG,KAAK,CAAC,CAAC,QA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import type { BedrockRuntimeService } from "./BedrockRuntimeService.js";
|
|
7
|
-
/**
|
|
8
|
-
* @since 1.0.0
|
|
9
|
-
* @category bedrock-runtime service config
|
|
10
|
-
*/
|
|
11
|
-
export declare const withBedrockRuntimeServiceConfig: {
|
|
12
|
-
(config: BedrockRuntimeService.Config): <A, E, R>(effect: Effect.Effect<A, E, R>) => Effect.Effect<A, E, R>;
|
|
13
|
-
<A, E, R>(effect: Effect.Effect<A, E, R>, config: BedrockRuntimeService.Config): Effect.Effect<A, E, R>;
|
|
14
|
-
};
|
|
15
|
-
/**
|
|
16
|
-
* @since 1.0.0
|
|
17
|
-
* @category bedrock-runtime service config
|
|
18
|
-
*/
|
|
19
|
-
export declare const setBedrockRuntimeServiceConfig: (config: BedrockRuntimeService.Config) => Layer.Layer<never, never, never>;
|
|
20
|
-
/**
|
|
21
|
-
* @since 1.0.0
|
|
22
|
-
* @category adapters
|
|
23
|
-
*/
|
|
24
|
-
export declare const toBedrockRuntimeClientConfig: Effect.Effect<BedrockRuntimeClientConfig>;
|
|
25
|
-
//# sourceMappingURL=BedrockRuntimeServiceConfig.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"BedrockRuntimeServiceConfig.d.ts","sourceRoot":"","sources":["../../src/BedrockRuntimeServiceConfig.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,iCAAiC,CAAC;AAElF,OAAO,EAAE,MAAM,EAAY,KAAK,EAAE,MAAM,QAAQ,CAAC;AAGjD,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AAWxE;;;GAGG;AACH,eAAO,MAAM,+BAA+B,EAAE;IAC5C,CAAC,MAAM,EAAE,qBAAqB,CAAC,MAAM,GAAG,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,KAAK,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;IAC5G,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,EAAE,MAAM,EAAE,qBAAqB,CAAC,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;CAKzG,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,8BAA8B,WAAY,sBAAsB,MAAM,qCAClB,CAAC;AAElE;;;GAGG;AACH,eAAO,MAAM,4BAA4B,EAAE,MAAM,CAAC,MAAM,CAAC,0BAA0B,CAQjF,CAAC"}
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.toBedrockRuntimeClientConfig = exports.setBedrockRuntimeServiceConfig = exports.withBedrockRuntimeServiceConfig = void 0;
|
|
4
|
-
const commons_1 = require("@effect-aws/commons");
|
|
5
|
-
const effect_1 = require("effect");
|
|
6
|
-
const Function_1 = require("effect/Function");
|
|
7
|
-
const GlobalValue_1 = require("effect/GlobalValue");
|
|
8
|
-
/**
|
|
9
|
-
* @since 1.0.0
|
|
10
|
-
* @category bedrock-runtime service config
|
|
11
|
-
*/
|
|
12
|
-
const currentBedrockRuntimeServiceConfig = (0, GlobalValue_1.globalValue)("@effect-aws/client-bedrock-runtime/currentBedrockRuntimeServiceConfig", () => effect_1.FiberRef.unsafeMake({}));
|
|
13
|
-
/**
|
|
14
|
-
* @since 1.0.0
|
|
15
|
-
* @category bedrock-runtime service config
|
|
16
|
-
*/
|
|
17
|
-
exports.withBedrockRuntimeServiceConfig = (0, Function_1.dual)(2, (effect, config) => effect_1.Effect.locally(effect, currentBedrockRuntimeServiceConfig, config));
|
|
18
|
-
/**
|
|
19
|
-
* @since 1.0.0
|
|
20
|
-
* @category bedrock-runtime service config
|
|
21
|
-
*/
|
|
22
|
-
const setBedrockRuntimeServiceConfig = (config) => effect_1.Layer.locallyScoped(currentBedrockRuntimeServiceConfig, config);
|
|
23
|
-
exports.setBedrockRuntimeServiceConfig = setBedrockRuntimeServiceConfig;
|
|
24
|
-
/**
|
|
25
|
-
* @since 1.0.0
|
|
26
|
-
* @category adapters
|
|
27
|
-
*/
|
|
28
|
-
exports.toBedrockRuntimeClientConfig = effect_1.Effect.gen(function* () {
|
|
29
|
-
const { logger: serviceLogger, ...config } = yield* effect_1.FiberRef.get(currentBedrockRuntimeServiceConfig);
|
|
30
|
-
const logger = serviceLogger === true
|
|
31
|
-
? yield* commons_1.ServiceLogger.toClientLogger(commons_1.ServiceLogger.defaultServiceLogger)
|
|
32
|
-
: (serviceLogger ? yield* commons_1.ServiceLogger.toClientLogger(commons_1.ServiceLogger.make(serviceLogger)) : undefined);
|
|
33
|
-
return { logger, ...config };
|
|
34
|
-
});
|
|
35
|
-
//# sourceMappingURL=BedrockRuntimeServiceConfig.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"BedrockRuntimeServiceConfig.js","sourceRoot":"","sources":["../../src/BedrockRuntimeServiceConfig.ts"],"names":[],"mappings":";;;AAIA,iDAAoD;AACpD,mCAAiD;AACjD,8CAAuC;AACvC,oDAAiD;AAGjD;;;GAGG;AACH,MAAM,kCAAkC,GAAG,IAAA,yBAAW,EACpD,uEAAuE,EACvE,GAAG,EAAE,CAAC,iBAAQ,CAAC,UAAU,CAA+B,EAAE,CAAC,CAC5D,CAAC;AAEF;;;GAGG;AACU,QAAA,+BAA+B,GAGxC,IAAA,eAAI,EACN,CAAC,EACD,CAAU,MAA8B,EAAE,MAAoC,EAA0B,EAAE,CACxG,eAAM,CAAC,OAAO,CAAC,MAAM,EAAE,kCAAkC,EAAE,MAAM,CAAC,CACrE,CAAC;AAEF;;;GAGG;AACI,MAAM,8BAA8B,GAAG,CAAC,MAAoC,EAAE,EAAE,CACrF,cAAK,CAAC,aAAa,CAAC,kCAAkC,EAAE,MAAM,CAAC,CAAC;AADrD,QAAA,8BAA8B,kCACuB;AAElE;;;GAGG;AACU,QAAA,4BAA4B,GAA8C,eAAM,CAAC,GAAG,CAAC,QAAQ,CAAC;IACzG,MAAM,EAAE,MAAM,EAAE,aAAa,EAAE,GAAG,MAAM,EAAE,GAAG,KAAK,CAAC,CAAC,iBAAQ,CAAC,GAAG,CAAC,kCAAkC,CAAC,CAAC;IAErG,MAAM,MAAM,GAAG,aAAa,KAAK,IAAI;QACnC,CAAC,CAAC,KAAK,CAAC,CAAC,uBAAa,CAAC,cAAc,CAAC,uBAAa,CAAC,oBAAoB,CAAC;QACzE,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,uBAAa,CAAC,cAAc,CAAC,uBAAa,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC;IAEzG,OAAO,EAAE,MAAM,EAAE,GAAG,MAAM,EAAE,CAAC;AAC/B,CAAC,CAAC,CAAC"}
|
package/dist/cjs/Errors.d.ts
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import type { AccessDeniedException, ConflictException, InternalServerException, ModelErrorException, ModelNotReadyException, ModelStreamErrorException, ModelTimeoutException, ResourceNotFoundException, ServiceQuotaExceededException, ServiceUnavailableException, ThrottlingException, ValidationException } from "@aws-sdk/client-bedrock-runtime";
|
|
2
|
-
import type { TaggedException } from "@effect-aws/commons";
|
|
3
|
-
export declare const AllServiceErrors: readonly ["AccessDeniedException", "ConflictException", "InternalServerException", "ModelErrorException", "ModelNotReadyException", "ModelStreamErrorException", "ModelTimeoutException", "ResourceNotFoundException", "ServiceQuotaExceededException", "ServiceUnavailableException", "ThrottlingException", "ValidationException"];
|
|
4
|
-
export type AccessDeniedError = TaggedException<AccessDeniedException>;
|
|
5
|
-
export type ConflictError = TaggedException<ConflictException>;
|
|
6
|
-
export type InternalServerError = TaggedException<InternalServerException>;
|
|
7
|
-
export type ModelError = TaggedException<ModelErrorException>;
|
|
8
|
-
export type ModelNotReadyError = TaggedException<ModelNotReadyException>;
|
|
9
|
-
export type ModelStreamError = TaggedException<ModelStreamErrorException>;
|
|
10
|
-
export type ModelTimeoutError = TaggedException<ModelTimeoutException>;
|
|
11
|
-
export type ResourceNotFoundError = TaggedException<ResourceNotFoundException>;
|
|
12
|
-
export type ServiceQuotaExceededError = TaggedException<ServiceQuotaExceededException>;
|
|
13
|
-
export type ServiceUnavailableError = TaggedException<ServiceUnavailableException>;
|
|
14
|
-
export type ThrottlingError = TaggedException<ThrottlingException>;
|
|
15
|
-
export type ValidationError = TaggedException<ValidationException>;
|
|
16
|
-
export type SdkError = TaggedException<Error & {
|
|
17
|
-
name: "SdkError";
|
|
18
|
-
}>;
|
|
19
|
-
//# sourceMappingURL=Errors.d.ts.map
|
package/dist/cjs/Errors.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Errors.d.ts","sourceRoot":"","sources":["../../src/Errors.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,qBAAqB,EACrB,iBAAiB,EACjB,uBAAuB,EACvB,mBAAmB,EACnB,sBAAsB,EACtB,yBAAyB,EACzB,qBAAqB,EACrB,yBAAyB,EACzB,6BAA6B,EAC7B,2BAA2B,EAC3B,mBAAmB,EACnB,mBAAmB,EACpB,MAAM,iCAAiC,CAAC;AACzC,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAE3D,eAAO,MAAM,gBAAgB,sUAanB,CAAC;AAEX,MAAM,MAAM,iBAAiB,GAAG,eAAe,CAAC,qBAAqB,CAAC,CAAC;AACvE,MAAM,MAAM,aAAa,GAAG,eAAe,CAAC,iBAAiB,CAAC,CAAC;AAC/D,MAAM,MAAM,mBAAmB,GAAG,eAAe,CAAC,uBAAuB,CAAC,CAAC;AAC3E,MAAM,MAAM,UAAU,GAAG,eAAe,CAAC,mBAAmB,CAAC,CAAC;AAC9D,MAAM,MAAM,kBAAkB,GAAG,eAAe,CAAC,sBAAsB,CAAC,CAAC;AACzE,MAAM,MAAM,gBAAgB,GAAG,eAAe,CAAC,yBAAyB,CAAC,CAAC;AAC1E,MAAM,MAAM,iBAAiB,GAAG,eAAe,CAAC,qBAAqB,CAAC,CAAC;AACvE,MAAM,MAAM,qBAAqB,GAAG,eAAe,CAAC,yBAAyB,CAAC,CAAC;AAC/E,MAAM,MAAM,yBAAyB,GAAG,eAAe,CAAC,6BAA6B,CAAC,CAAC;AACvF,MAAM,MAAM,uBAAuB,GAAG,eAAe,CAAC,2BAA2B,CAAC,CAAC;AACnF,MAAM,MAAM,eAAe,GAAG,eAAe,CAAC,mBAAmB,CAAC,CAAC;AACnE,MAAM,MAAM,eAAe,GAAG,eAAe,CAAC,mBAAmB,CAAC,CAAC;AACnE,MAAM,MAAM,QAAQ,GAAG,eAAe,CAAC,KAAK,GAAG;IAAE,IAAI,EAAE,UAAU,CAAA;CAAE,CAAC,CAAC"}
|
package/dist/cjs/Errors.js
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.AllServiceErrors = void 0;
|
|
4
|
-
exports.AllServiceErrors = [
|
|
5
|
-
"AccessDeniedException",
|
|
6
|
-
"ConflictException",
|
|
7
|
-
"InternalServerException",
|
|
8
|
-
"ModelErrorException",
|
|
9
|
-
"ModelNotReadyException",
|
|
10
|
-
"ModelStreamErrorException",
|
|
11
|
-
"ModelTimeoutException",
|
|
12
|
-
"ResourceNotFoundException",
|
|
13
|
-
"ServiceQuotaExceededException",
|
|
14
|
-
"ServiceUnavailableException",
|
|
15
|
-
"ThrottlingException",
|
|
16
|
-
"ValidationException",
|
|
17
|
-
];
|
|
18
|
-
//# sourceMappingURL=Errors.js.map
|
package/dist/cjs/Errors.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Errors.js","sourceRoot":"","sources":["../../src/Errors.ts"],"names":[],"mappings":";;;AAgBa,QAAA,gBAAgB,GAAG;IAC9B,uBAAuB;IACvB,mBAAmB;IACnB,yBAAyB;IACzB,qBAAqB;IACrB,wBAAwB;IACxB,2BAA2B;IAC3B,uBAAuB;IACvB,2BAA2B;IAC3B,+BAA+B;IAC/B,6BAA6B;IAC7B,qBAAqB;IACrB,qBAAqB;CACb,CAAC"}
|
package/dist/cjs/index.d.ts
DELETED
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @since 1.0.0
|
|
3
|
-
*/
|
|
4
|
-
import { BedrockRuntimeService } from "./BedrockRuntimeService.js";
|
|
5
|
-
/**
|
|
6
|
-
* @since 1.0.0
|
|
7
|
-
*/
|
|
8
|
-
export * from "./Errors.js";
|
|
9
|
-
/**
|
|
10
|
-
* @since 1.0.0
|
|
11
|
-
*/
|
|
12
|
-
export * as BedrockRuntimeClientInstance from "./BedrockRuntimeClientInstance.js";
|
|
13
|
-
/**
|
|
14
|
-
* @since 1.0.0
|
|
15
|
-
*/
|
|
16
|
-
export * as BedrockRuntimeServiceConfig from "./BedrockRuntimeServiceConfig.js";
|
|
17
|
-
/**
|
|
18
|
-
* @since 1.0.0
|
|
19
|
-
*/
|
|
20
|
-
export * from "./BedrockRuntimeService.js";
|
|
21
|
-
/**
|
|
22
|
-
* @since 1.0.0
|
|
23
|
-
* @category exports
|
|
24
|
-
* @alias BedrockRuntimeService
|
|
25
|
-
*/
|
|
26
|
-
export declare namespace BedrockRuntime {
|
|
27
|
-
/**
|
|
28
|
-
* @since 1.0.0
|
|
29
|
-
* @alias BedrockRuntimeService.Config
|
|
30
|
-
*/
|
|
31
|
-
type Config = BedrockRuntimeService.Config;
|
|
32
|
-
/**
|
|
33
|
-
* @since 1.0.0
|
|
34
|
-
* @alias BedrockRuntimeService.Type
|
|
35
|
-
*/
|
|
36
|
-
type Type = BedrockRuntimeService.Type;
|
|
37
|
-
}
|
|
38
|
-
/**
|
|
39
|
-
* @since 1.0.0
|
|
40
|
-
* @category exports
|
|
41
|
-
* @alias BedrockRuntimeService
|
|
42
|
-
*/
|
|
43
|
-
export declare const BedrockRuntime: typeof BedrockRuntimeService;
|
|
44
|
-
//# sourceMappingURL=index.d.ts.map
|
package/dist/cjs/index.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AAEnE;;GAEG;AACH,cAAc,aAAa,CAAC;AAE5B;;GAEG;AACH,OAAO,KAAK,4BAA4B,MAAM,mCAAmC,CAAC;AAElF;;GAEG;AACH,OAAO,KAAK,2BAA2B,MAAM,kCAAkC,CAAC;AAEhF;;GAEG;AACH,cAAc,4BAA4B,CAAC;AAE3C;;;;GAIG;AACH,MAAM,CAAC,OAAO,WAAW,cAAc,CAAC;IACtC;;;OAGG;IACH,KAAY,MAAM,GAAG,qBAAqB,CAAC,MAAM,CAAC;IAElD;;;OAGG;IACH,KAAY,IAAI,GAAG,qBAAqB,CAAC,IAAI,CAAC;CAC/C;AAED;;;;GAIG;AACH,eAAO,MAAM,cAAc,8BAAwB,CAAC"}
|
package/dist/cjs/index.js
DELETED
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
19
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
20
|
-
};
|
|
21
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
22
|
-
if (mod && mod.__esModule) return mod;
|
|
23
|
-
var result = {};
|
|
24
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
25
|
-
__setModuleDefault(result, mod);
|
|
26
|
-
return result;
|
|
27
|
-
};
|
|
28
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
-
exports.BedrockRuntime = exports.BedrockRuntimeServiceConfig = exports.BedrockRuntimeClientInstance = void 0;
|
|
30
|
-
/**
|
|
31
|
-
* @since 1.0.0
|
|
32
|
-
*/
|
|
33
|
-
const BedrockRuntimeService_js_1 = require("./BedrockRuntimeService.js");
|
|
34
|
-
/**
|
|
35
|
-
* @since 1.0.0
|
|
36
|
-
*/
|
|
37
|
-
__exportStar(require("./Errors.js"), exports);
|
|
38
|
-
/**
|
|
39
|
-
* @since 1.0.0
|
|
40
|
-
*/
|
|
41
|
-
exports.BedrockRuntimeClientInstance = __importStar(require("./BedrockRuntimeClientInstance.js"));
|
|
42
|
-
/**
|
|
43
|
-
* @since 1.0.0
|
|
44
|
-
*/
|
|
45
|
-
exports.BedrockRuntimeServiceConfig = __importStar(require("./BedrockRuntimeServiceConfig.js"));
|
|
46
|
-
/**
|
|
47
|
-
* @since 1.0.0
|
|
48
|
-
*/
|
|
49
|
-
__exportStar(require("./BedrockRuntimeService.js"), exports);
|
|
50
|
-
/**
|
|
51
|
-
* @since 1.0.0
|
|
52
|
-
* @category exports
|
|
53
|
-
* @alias BedrockRuntimeService
|
|
54
|
-
*/
|
|
55
|
-
exports.BedrockRuntime = BedrockRuntimeService_js_1.BedrockRuntimeService;
|
|
56
|
-
//# sourceMappingURL=index.js.map
|
package/dist/cjs/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;GAEG;AACH,yEAAmE;AAEnE;;GAEG;AACH,8CAA4B;AAE5B;;GAEG;AACH,kGAAkF;AAElF;;GAEG;AACH,gGAAgF;AAEhF;;GAEG;AACH,6DAA2C;AAqB3C;;;;GAIG;AACU,QAAA,cAAc,GAAG,gDAAqB,CAAC"}
|