@effect-aws/client-bedrock-runtime 1.9.3 → 1.10.0
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/dist/cjs/BedrockRuntimeService.d.ts +15 -10
- package/dist/cjs/BedrockRuntimeService.d.ts.map +1 -1
- package/dist/cjs/BedrockRuntimeService.js +2 -1
- package/dist/cjs/BedrockRuntimeService.js.map +1 -1
- package/dist/dts/BedrockRuntimeService.d.ts +15 -10
- package/dist/dts/BedrockRuntimeService.d.ts.map +1 -1
- package/dist/esm/BedrockRuntimeService.js +3 -2
- package/dist/esm/BedrockRuntimeService.js.map +1 -1
- package/package.json +2 -2
- package/src/BedrockRuntimeService.ts +37 -3
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @since 1.0.0
|
|
3
3
|
*/
|
|
4
|
-
import { type ApplyGuardrailCommandInput, type ApplyGuardrailCommandOutput, type BedrockRuntimeClient, type BedrockRuntimeClientConfig, type ConverseCommandInput, type ConverseCommandOutput, type ConverseStreamCommandInput, type ConverseStreamCommandOutput, type GetAsyncInvokeCommandInput, type GetAsyncInvokeCommandOutput, type InvokeModelCommandInput, type InvokeModelCommandOutput, type InvokeModelWithResponseStreamCommandInput, type InvokeModelWithResponseStreamCommandOutput, type ListAsyncInvokesCommandInput, type ListAsyncInvokesCommandOutput, type StartAsyncInvokeCommandInput, type StartAsyncInvokeCommandOutput } from "@aws-sdk/client-bedrock-runtime";
|
|
4
|
+
import { type ApplyGuardrailCommandInput, type ApplyGuardrailCommandOutput, type BedrockRuntimeClient, type BedrockRuntimeClientConfig, type ConverseCommandInput, type ConverseCommandOutput, type ConverseStreamCommandInput, type ConverseStreamCommandOutput, 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, SdkError, ServiceLogger } from "@effect-aws/commons";
|
|
6
|
+
import type { Cause } from "effect";
|
|
6
7
|
import { Effect, Layer } from "effect";
|
|
7
8
|
import * as Instance from "./BedrockRuntimeClientInstance.js";
|
|
8
9
|
import type { AccessDeniedError, ConflictError, InternalServerError, ModelError, ModelNotReadyError, ModelStreamError, ModelTimeoutError, ResourceNotFoundError, ServiceQuotaExceededError, ServiceUnavailableError, ThrottlingError, ValidationError } from "./Errors.js";
|
|
@@ -11,35 +12,39 @@ interface BedrockRuntimeService$ {
|
|
|
11
12
|
/**
|
|
12
13
|
* @see {@link ApplyGuardrailCommand}
|
|
13
14
|
*/
|
|
14
|
-
applyGuardrail(args: ApplyGuardrailCommandInput, options?: HttpHandlerOptions): Effect.Effect<ApplyGuardrailCommandOutput, SdkError | AccessDeniedError | InternalServerError | ResourceNotFoundError | ServiceQuotaExceededError | ThrottlingError | ValidationError>;
|
|
15
|
+
applyGuardrail(args: ApplyGuardrailCommandInput, options?: HttpHandlerOptions): Effect.Effect<ApplyGuardrailCommandOutput, Cause.TimeoutException | SdkError | AccessDeniedError | InternalServerError | ResourceNotFoundError | ServiceQuotaExceededError | ThrottlingError | ValidationError>;
|
|
15
16
|
/**
|
|
16
17
|
* @see {@link ConverseCommand}
|
|
17
18
|
*/
|
|
18
|
-
converse(args: ConverseCommandInput, options?: HttpHandlerOptions): Effect.Effect<ConverseCommandOutput, SdkError | AccessDeniedError | InternalServerError | ModelError | ModelNotReadyError | ModelTimeoutError | ResourceNotFoundError | ServiceUnavailableError | ThrottlingError | ValidationError>;
|
|
19
|
+
converse(args: ConverseCommandInput, options?: HttpHandlerOptions): Effect.Effect<ConverseCommandOutput, Cause.TimeoutException | SdkError | AccessDeniedError | InternalServerError | ModelError | ModelNotReadyError | ModelTimeoutError | ResourceNotFoundError | ServiceUnavailableError | ThrottlingError | ValidationError>;
|
|
19
20
|
/**
|
|
20
21
|
* @see {@link ConverseStreamCommand}
|
|
21
22
|
*/
|
|
22
|
-
converseStream(args: ConverseStreamCommandInput, options?: HttpHandlerOptions): Effect.Effect<ConverseStreamCommandOutput, SdkError | AccessDeniedError | InternalServerError | ModelError | ModelNotReadyError | ModelTimeoutError | ResourceNotFoundError | ServiceUnavailableError | ThrottlingError | ValidationError>;
|
|
23
|
+
converseStream(args: ConverseStreamCommandInput, options?: HttpHandlerOptions): Effect.Effect<ConverseStreamCommandOutput, Cause.TimeoutException | SdkError | AccessDeniedError | InternalServerError | ModelError | ModelNotReadyError | ModelTimeoutError | ResourceNotFoundError | ServiceUnavailableError | ThrottlingError | ValidationError>;
|
|
23
24
|
/**
|
|
24
25
|
* @see {@link GetAsyncInvokeCommand}
|
|
25
26
|
*/
|
|
26
|
-
getAsyncInvoke(args: GetAsyncInvokeCommandInput, options?: HttpHandlerOptions): Effect.Effect<GetAsyncInvokeCommandOutput, SdkError | AccessDeniedError | InternalServerError | ThrottlingError | ValidationError>;
|
|
27
|
+
getAsyncInvoke(args: GetAsyncInvokeCommandInput, options?: HttpHandlerOptions): Effect.Effect<GetAsyncInvokeCommandOutput, Cause.TimeoutException | SdkError | AccessDeniedError | InternalServerError | ThrottlingError | ValidationError>;
|
|
27
28
|
/**
|
|
28
29
|
* @see {@link InvokeModelCommand}
|
|
29
30
|
*/
|
|
30
|
-
invokeModel(args: InvokeModelCommandInput, options?: HttpHandlerOptions): Effect.Effect<InvokeModelCommandOutput, SdkError | AccessDeniedError | InternalServerError | ModelError | ModelNotReadyError | ModelTimeoutError | ResourceNotFoundError | ServiceQuotaExceededError | ServiceUnavailableError | ThrottlingError | ValidationError>;
|
|
31
|
+
invokeModel(args: InvokeModelCommandInput, options?: HttpHandlerOptions): Effect.Effect<InvokeModelCommandOutput, Cause.TimeoutException | SdkError | AccessDeniedError | InternalServerError | ModelError | ModelNotReadyError | ModelTimeoutError | ResourceNotFoundError | ServiceQuotaExceededError | ServiceUnavailableError | ThrottlingError | ValidationError>;
|
|
32
|
+
/**
|
|
33
|
+
* @see {@link InvokeModelWithBidirectionalStreamCommand}
|
|
34
|
+
*/
|
|
35
|
+
invokeModelWithBidirectionalStream(args: InvokeModelWithBidirectionalStreamCommandInput, options?: HttpHandlerOptions): Effect.Effect<InvokeModelWithBidirectionalStreamCommandOutput, Cause.TimeoutException | SdkError | AccessDeniedError | InternalServerError | ModelError | ModelNotReadyError | ModelStreamError | ModelTimeoutError | ResourceNotFoundError | ServiceQuotaExceededError | ServiceUnavailableError | ThrottlingError | ValidationError>;
|
|
31
36
|
/**
|
|
32
37
|
* @see {@link InvokeModelWithResponseStreamCommand}
|
|
33
38
|
*/
|
|
34
|
-
invokeModelWithResponseStream(args: InvokeModelWithResponseStreamCommandInput, options?: HttpHandlerOptions): Effect.Effect<InvokeModelWithResponseStreamCommandOutput, SdkError | AccessDeniedError | InternalServerError | ModelError | ModelNotReadyError | ModelStreamError | ModelTimeoutError | ResourceNotFoundError | ServiceQuotaExceededError | ServiceUnavailableError | ThrottlingError | ValidationError>;
|
|
39
|
+
invokeModelWithResponseStream(args: InvokeModelWithResponseStreamCommandInput, options?: HttpHandlerOptions): Effect.Effect<InvokeModelWithResponseStreamCommandOutput, Cause.TimeoutException | SdkError | AccessDeniedError | InternalServerError | ModelError | ModelNotReadyError | ModelStreamError | ModelTimeoutError | ResourceNotFoundError | ServiceQuotaExceededError | ServiceUnavailableError | ThrottlingError | ValidationError>;
|
|
35
40
|
/**
|
|
36
41
|
* @see {@link ListAsyncInvokesCommand}
|
|
37
42
|
*/
|
|
38
|
-
listAsyncInvokes(args: ListAsyncInvokesCommandInput, options?: HttpHandlerOptions): Effect.Effect<ListAsyncInvokesCommandOutput, SdkError | AccessDeniedError | InternalServerError | ThrottlingError | ValidationError>;
|
|
43
|
+
listAsyncInvokes(args: ListAsyncInvokesCommandInput, options?: HttpHandlerOptions): Effect.Effect<ListAsyncInvokesCommandOutput, Cause.TimeoutException | SdkError | AccessDeniedError | InternalServerError | ThrottlingError | ValidationError>;
|
|
39
44
|
/**
|
|
40
45
|
* @see {@link StartAsyncInvokeCommand}
|
|
41
46
|
*/
|
|
42
|
-
startAsyncInvoke(args: StartAsyncInvokeCommandInput, options?: HttpHandlerOptions): Effect.Effect<StartAsyncInvokeCommandOutput, SdkError | AccessDeniedError | ConflictError | InternalServerError | ResourceNotFoundError | ServiceQuotaExceededError | ServiceUnavailableError | ThrottlingError | ValidationError>;
|
|
47
|
+
startAsyncInvoke(args: StartAsyncInvokeCommandInput, options?: HttpHandlerOptions): Effect.Effect<StartAsyncInvokeCommandOutput, Cause.TimeoutException | SdkError | AccessDeniedError | ConflictError | InternalServerError | ResourceNotFoundError | ServiceQuotaExceededError | ServiceUnavailableError | ThrottlingError | ValidationError>;
|
|
43
48
|
}
|
|
44
49
|
/**
|
|
45
50
|
* @since 1.0.0
|
|
@@ -47,7 +52,7 @@ interface BedrockRuntimeService$ {
|
|
|
47
52
|
*/
|
|
48
53
|
export declare const makeBedrockRuntimeService: Effect.Effect<BedrockRuntimeService$, never, Instance.BedrockRuntimeClientInstance>;
|
|
49
54
|
declare const BedrockRuntimeService_base: import("effect/Context").TagClass<BedrockRuntimeService, "@effect-aws/client-bedrock-runtime/BedrockRuntimeService", BedrockRuntimeService$> & Effect.Tag.Proxy<BedrockRuntimeService, BedrockRuntimeService$> & {
|
|
50
|
-
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,
|
|
55
|
+
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>;
|
|
51
56
|
};
|
|
52
57
|
/**
|
|
53
58
|
* @since 1.0.0
|
|
@@ -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,0BAA0B,EAC/B,KAAK,2BAA2B,EAEhC,KAAK,uBAAuB,EAC5B,KAAK,wBAAwB,EAE7B,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,QAAQ,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEvF,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAC;AACvC,OAAO,KAAK,QAAQ,MAAM,mCAAmC,CAAC;AAE9D,OAAO,KAAK,EACV,iBAAiB,EACjB,aAAa,EACb,mBAAmB,EACnB,UAAU,EACV,kBAAkB,EAClB,gBAAgB,EAChB,iBAAiB,EACjB,qBAAqB,EACrB,yBAAyB,EACzB,uBAAuB,EACvB,eAAe,EACf,eAAe,EAChB,MAAM,aAAa,CAAC;
|
|
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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C,QAAQ,CAAC,SAAS,aACb,CAAC,aAAa,EAAE,0BAA0B,KAAK,oBAAoB,sDAS3E;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;CACF"}
|
|
@@ -39,6 +39,7 @@ const commands = {
|
|
|
39
39
|
ConverseStreamCommand: client_bedrock_runtime_1.ConverseStreamCommand,
|
|
40
40
|
GetAsyncInvokeCommand: client_bedrock_runtime_1.GetAsyncInvokeCommand,
|
|
41
41
|
InvokeModelCommand: client_bedrock_runtime_1.InvokeModelCommand,
|
|
42
|
+
InvokeModelWithBidirectionalStreamCommand: client_bedrock_runtime_1.InvokeModelWithBidirectionalStreamCommand,
|
|
42
43
|
InvokeModelWithResponseStreamCommand: client_bedrock_runtime_1.InvokeModelWithResponseStreamCommand,
|
|
43
44
|
ListAsyncInvokesCommand: client_bedrock_runtime_1.ListAsyncInvokesCommand,
|
|
44
45
|
StartAsyncInvokeCommand: client_bedrock_runtime_1.StartAsyncInvokeCommand,
|
|
@@ -49,7 +50,7 @@ const commands = {
|
|
|
49
50
|
*/
|
|
50
51
|
exports.makeBedrockRuntimeService = effect_1.Effect.gen(function* () {
|
|
51
52
|
const client = yield* Instance.BedrockRuntimeClientInstance;
|
|
52
|
-
return commons_1.Service.fromClientAndCommands(client, commands, {
|
|
53
|
+
return yield* commons_1.Service.fromClientAndCommands(client, commands, {
|
|
53
54
|
errorTags: Errors_js_1.AllServiceErrors,
|
|
54
55
|
resolveClientConfig: BedrockRuntimeServiceConfig.toBedrockRuntimeClientConfig,
|
|
55
56
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BedrockRuntimeService.js","sourceRoot":"","sources":["../../src/BedrockRuntimeService.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;GAEG;AACH,
|
|
1
|
+
{"version":3,"file":"BedrockRuntimeService.js","sourceRoot":"","sources":["../../src/BedrockRuntimeService.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;GAEG;AACH,4EA8ByC;AAEzC,iDAA8C;AAE9C,mCAAuC;AACvC,4EAA8D;AAC9D,8FAAgF;AAehF,2CAA+C;AAE/C,MAAM,QAAQ,GAAG;IACf,qBAAqB,EAArB,8CAAqB;IACrB,eAAe,EAAf,wCAAe;IACf,qBAAqB,EAArB,8CAAqB;IACrB,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;AAgLF;;;GAGG;AACU,QAAA,yBAAyB,GAAG,eAAM,CAAC,GAAG,CAAC,QAAQ,CAAC;IAC3D,MAAM,MAAM,GAAG,KAAK,CAAC,CAAC,QAAQ,CAAC,4BAA4B,CAAC;IAE5D,OAAO,KAAK,CAAC,CAAC,iBAAO,CAAC,qBAAqB,CACzC,MAAM,EACN,QAAQ,EACR;QACE,SAAS,EAAE,4BAAgB;QAC3B,mBAAmB,EAAE,2BAA2B,CAAC,4BAA4B;KAC9E,CACF,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH;;;GAGG;AACH,MAAa,qBAAsB,SAAQ,eAAM,CAAC,GAAG,CAAC,0DAA0D,CAAC,EAG9G;IACD,MAAM,CAAU,YAAY,GAAG,cAAK,CAAC,MAAM,CAAC,IAAI,EAAE,iCAAyB,CAAC,CAAC,IAAI,CAAC,cAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC;IACjH,MAAM,CAAU,KAAK,GAAG,CAAC,MAAoC,EAAE,EAAE,CAC/D,cAAK,CAAC,MAAM,CAAC,IAAI,EAAE,iCAAyB,CAAC,CAAC,IAAI,CAChD,cAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAC,EAC7B,cAAK,CAAC,OAAO,CAAC,2BAA2B,CAAC,8BAA8B,CAAC,MAAM,CAAC,CAAC,CAClF,CAAC;IACJ,MAAM,CAAU,SAAS,GAAG,CAC1B,QAA6E,EAC7E,EAAE,CACF,cAAK,CAAC,MAAM,CAAC,IAAI,EAAE,iCAAyB,CAAC,CAAC,IAAI,CAChD,cAAK,CAAC,OAAO,CACX,cAAK,CAAC,MAAM,CACV,QAAQ,CAAC,4BAA4B,EACrC,eAAM,CAAC,GAAG,CAAC,2BAA2B,CAAC,4BAA4B,EAAE,QAAQ,CAAC,CAC/E,CACF,CACF,CAAC;;AApBN,sDAqBC"}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @since 1.0.0
|
|
3
3
|
*/
|
|
4
|
-
import { type ApplyGuardrailCommandInput, type ApplyGuardrailCommandOutput, type BedrockRuntimeClient, type BedrockRuntimeClientConfig, type ConverseCommandInput, type ConverseCommandOutput, type ConverseStreamCommandInput, type ConverseStreamCommandOutput, type GetAsyncInvokeCommandInput, type GetAsyncInvokeCommandOutput, type InvokeModelCommandInput, type InvokeModelCommandOutput, type InvokeModelWithResponseStreamCommandInput, type InvokeModelWithResponseStreamCommandOutput, type ListAsyncInvokesCommandInput, type ListAsyncInvokesCommandOutput, type StartAsyncInvokeCommandInput, type StartAsyncInvokeCommandOutput } from "@aws-sdk/client-bedrock-runtime";
|
|
4
|
+
import { type ApplyGuardrailCommandInput, type ApplyGuardrailCommandOutput, type BedrockRuntimeClient, type BedrockRuntimeClientConfig, type ConverseCommandInput, type ConverseCommandOutput, type ConverseStreamCommandInput, type ConverseStreamCommandOutput, 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, SdkError, ServiceLogger } from "@effect-aws/commons";
|
|
6
|
+
import type { Cause } from "effect";
|
|
6
7
|
import { Effect, Layer } from "effect";
|
|
7
8
|
import * as Instance from "./BedrockRuntimeClientInstance.js";
|
|
8
9
|
import type { AccessDeniedError, ConflictError, InternalServerError, ModelError, ModelNotReadyError, ModelStreamError, ModelTimeoutError, ResourceNotFoundError, ServiceQuotaExceededError, ServiceUnavailableError, ThrottlingError, ValidationError } from "./Errors.js";
|
|
@@ -11,35 +12,39 @@ interface BedrockRuntimeService$ {
|
|
|
11
12
|
/**
|
|
12
13
|
* @see {@link ApplyGuardrailCommand}
|
|
13
14
|
*/
|
|
14
|
-
applyGuardrail(args: ApplyGuardrailCommandInput, options?: HttpHandlerOptions): Effect.Effect<ApplyGuardrailCommandOutput, SdkError | AccessDeniedError | InternalServerError | ResourceNotFoundError | ServiceQuotaExceededError | ThrottlingError | ValidationError>;
|
|
15
|
+
applyGuardrail(args: ApplyGuardrailCommandInput, options?: HttpHandlerOptions): Effect.Effect<ApplyGuardrailCommandOutput, Cause.TimeoutException | SdkError | AccessDeniedError | InternalServerError | ResourceNotFoundError | ServiceQuotaExceededError | ThrottlingError | ValidationError>;
|
|
15
16
|
/**
|
|
16
17
|
* @see {@link ConverseCommand}
|
|
17
18
|
*/
|
|
18
|
-
converse(args: ConverseCommandInput, options?: HttpHandlerOptions): Effect.Effect<ConverseCommandOutput, SdkError | AccessDeniedError | InternalServerError | ModelError | ModelNotReadyError | ModelTimeoutError | ResourceNotFoundError | ServiceUnavailableError | ThrottlingError | ValidationError>;
|
|
19
|
+
converse(args: ConverseCommandInput, options?: HttpHandlerOptions): Effect.Effect<ConverseCommandOutput, Cause.TimeoutException | SdkError | AccessDeniedError | InternalServerError | ModelError | ModelNotReadyError | ModelTimeoutError | ResourceNotFoundError | ServiceUnavailableError | ThrottlingError | ValidationError>;
|
|
19
20
|
/**
|
|
20
21
|
* @see {@link ConverseStreamCommand}
|
|
21
22
|
*/
|
|
22
|
-
converseStream(args: ConverseStreamCommandInput, options?: HttpHandlerOptions): Effect.Effect<ConverseStreamCommandOutput, SdkError | AccessDeniedError | InternalServerError | ModelError | ModelNotReadyError | ModelTimeoutError | ResourceNotFoundError | ServiceUnavailableError | ThrottlingError | ValidationError>;
|
|
23
|
+
converseStream(args: ConverseStreamCommandInput, options?: HttpHandlerOptions): Effect.Effect<ConverseStreamCommandOutput, Cause.TimeoutException | SdkError | AccessDeniedError | InternalServerError | ModelError | ModelNotReadyError | ModelTimeoutError | ResourceNotFoundError | ServiceUnavailableError | ThrottlingError | ValidationError>;
|
|
23
24
|
/**
|
|
24
25
|
* @see {@link GetAsyncInvokeCommand}
|
|
25
26
|
*/
|
|
26
|
-
getAsyncInvoke(args: GetAsyncInvokeCommandInput, options?: HttpHandlerOptions): Effect.Effect<GetAsyncInvokeCommandOutput, SdkError | AccessDeniedError | InternalServerError | ThrottlingError | ValidationError>;
|
|
27
|
+
getAsyncInvoke(args: GetAsyncInvokeCommandInput, options?: HttpHandlerOptions): Effect.Effect<GetAsyncInvokeCommandOutput, Cause.TimeoutException | SdkError | AccessDeniedError | InternalServerError | ThrottlingError | ValidationError>;
|
|
27
28
|
/**
|
|
28
29
|
* @see {@link InvokeModelCommand}
|
|
29
30
|
*/
|
|
30
|
-
invokeModel(args: InvokeModelCommandInput, options?: HttpHandlerOptions): Effect.Effect<InvokeModelCommandOutput, SdkError | AccessDeniedError | InternalServerError | ModelError | ModelNotReadyError | ModelTimeoutError | ResourceNotFoundError | ServiceQuotaExceededError | ServiceUnavailableError | ThrottlingError | ValidationError>;
|
|
31
|
+
invokeModel(args: InvokeModelCommandInput, options?: HttpHandlerOptions): Effect.Effect<InvokeModelCommandOutput, Cause.TimeoutException | SdkError | AccessDeniedError | InternalServerError | ModelError | ModelNotReadyError | ModelTimeoutError | ResourceNotFoundError | ServiceQuotaExceededError | ServiceUnavailableError | ThrottlingError | ValidationError>;
|
|
32
|
+
/**
|
|
33
|
+
* @see {@link InvokeModelWithBidirectionalStreamCommand}
|
|
34
|
+
*/
|
|
35
|
+
invokeModelWithBidirectionalStream(args: InvokeModelWithBidirectionalStreamCommandInput, options?: HttpHandlerOptions): Effect.Effect<InvokeModelWithBidirectionalStreamCommandOutput, Cause.TimeoutException | SdkError | AccessDeniedError | InternalServerError | ModelError | ModelNotReadyError | ModelStreamError | ModelTimeoutError | ResourceNotFoundError | ServiceQuotaExceededError | ServiceUnavailableError | ThrottlingError | ValidationError>;
|
|
31
36
|
/**
|
|
32
37
|
* @see {@link InvokeModelWithResponseStreamCommand}
|
|
33
38
|
*/
|
|
34
|
-
invokeModelWithResponseStream(args: InvokeModelWithResponseStreamCommandInput, options?: HttpHandlerOptions): Effect.Effect<InvokeModelWithResponseStreamCommandOutput, SdkError | AccessDeniedError | InternalServerError | ModelError | ModelNotReadyError | ModelStreamError | ModelTimeoutError | ResourceNotFoundError | ServiceQuotaExceededError | ServiceUnavailableError | ThrottlingError | ValidationError>;
|
|
39
|
+
invokeModelWithResponseStream(args: InvokeModelWithResponseStreamCommandInput, options?: HttpHandlerOptions): Effect.Effect<InvokeModelWithResponseStreamCommandOutput, Cause.TimeoutException | SdkError | AccessDeniedError | InternalServerError | ModelError | ModelNotReadyError | ModelStreamError | ModelTimeoutError | ResourceNotFoundError | ServiceQuotaExceededError | ServiceUnavailableError | ThrottlingError | ValidationError>;
|
|
35
40
|
/**
|
|
36
41
|
* @see {@link ListAsyncInvokesCommand}
|
|
37
42
|
*/
|
|
38
|
-
listAsyncInvokes(args: ListAsyncInvokesCommandInput, options?: HttpHandlerOptions): Effect.Effect<ListAsyncInvokesCommandOutput, SdkError | AccessDeniedError | InternalServerError | ThrottlingError | ValidationError>;
|
|
43
|
+
listAsyncInvokes(args: ListAsyncInvokesCommandInput, options?: HttpHandlerOptions): Effect.Effect<ListAsyncInvokesCommandOutput, Cause.TimeoutException | SdkError | AccessDeniedError | InternalServerError | ThrottlingError | ValidationError>;
|
|
39
44
|
/**
|
|
40
45
|
* @see {@link StartAsyncInvokeCommand}
|
|
41
46
|
*/
|
|
42
|
-
startAsyncInvoke(args: StartAsyncInvokeCommandInput, options?: HttpHandlerOptions): Effect.Effect<StartAsyncInvokeCommandOutput, SdkError | AccessDeniedError | ConflictError | InternalServerError | ResourceNotFoundError | ServiceQuotaExceededError | ServiceUnavailableError | ThrottlingError | ValidationError>;
|
|
47
|
+
startAsyncInvoke(args: StartAsyncInvokeCommandInput, options?: HttpHandlerOptions): Effect.Effect<StartAsyncInvokeCommandOutput, Cause.TimeoutException | SdkError | AccessDeniedError | ConflictError | InternalServerError | ResourceNotFoundError | ServiceQuotaExceededError | ServiceUnavailableError | ThrottlingError | ValidationError>;
|
|
43
48
|
}
|
|
44
49
|
/**
|
|
45
50
|
* @since 1.0.0
|
|
@@ -47,7 +52,7 @@ interface BedrockRuntimeService$ {
|
|
|
47
52
|
*/
|
|
48
53
|
export declare const makeBedrockRuntimeService: Effect.Effect<BedrockRuntimeService$, never, Instance.BedrockRuntimeClientInstance>;
|
|
49
54
|
declare const BedrockRuntimeService_base: import("effect/Context").TagClass<BedrockRuntimeService, "@effect-aws/client-bedrock-runtime/BedrockRuntimeService", BedrockRuntimeService$> & Effect.Tag.Proxy<BedrockRuntimeService, BedrockRuntimeService$> & {
|
|
50
|
-
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,
|
|
55
|
+
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>;
|
|
51
56
|
};
|
|
52
57
|
/**
|
|
53
58
|
* @since 1.0.0
|
|
@@ -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,0BAA0B,EAC/B,KAAK,2BAA2B,EAEhC,KAAK,uBAAuB,EAC5B,KAAK,wBAAwB,EAE7B,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,QAAQ,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEvF,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAC;AACvC,OAAO,KAAK,QAAQ,MAAM,mCAAmC,CAAC;AAE9D,OAAO,KAAK,EACV,iBAAiB,EACjB,aAAa,EACb,mBAAmB,EACnB,UAAU,EACV,kBAAkB,EAClB,gBAAgB,EAChB,iBAAiB,EACjB,qBAAqB,EACrB,yBAAyB,EACzB,uBAAuB,EACvB,eAAe,EACf,eAAe,EAChB,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"BedrockRuntimeService.d.ts","sourceRoot":"","sources":["../../src/BedrockRuntimeService.ts"],"names":[],"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,MAAM,CAAC,QAAQ,CAAC,KAAK,WAAY,sBAAsB,MAAM,sDAIzD;IACJ,MAAM,CAAC,QAAQ,CAAC,SAAS,aACb,CAAC,aAAa,EAAE,0BAA0B,KAAK,oBAAoB,sDAS3E;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;CACF"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @since 1.0.0
|
|
3
3
|
*/
|
|
4
|
-
import { ApplyGuardrailCommand, ConverseCommand, ConverseStreamCommand, GetAsyncInvokeCommand, InvokeModelCommand, InvokeModelWithResponseStreamCommand, ListAsyncInvokesCommand, StartAsyncInvokeCommand, } from "@aws-sdk/client-bedrock-runtime";
|
|
4
|
+
import { ApplyGuardrailCommand, ConverseCommand, ConverseStreamCommand, GetAsyncInvokeCommand, InvokeModelCommand, InvokeModelWithBidirectionalStreamCommand, InvokeModelWithResponseStreamCommand, ListAsyncInvokesCommand, StartAsyncInvokeCommand, } from "@aws-sdk/client-bedrock-runtime";
|
|
5
5
|
import { Service } from "@effect-aws/commons";
|
|
6
6
|
import { Effect, Layer } from "effect";
|
|
7
7
|
import * as Instance from "./BedrockRuntimeClientInstance.js";
|
|
@@ -13,6 +13,7 @@ const commands = {
|
|
|
13
13
|
ConverseStreamCommand,
|
|
14
14
|
GetAsyncInvokeCommand,
|
|
15
15
|
InvokeModelCommand,
|
|
16
|
+
InvokeModelWithBidirectionalStreamCommand,
|
|
16
17
|
InvokeModelWithResponseStreamCommand,
|
|
17
18
|
ListAsyncInvokesCommand,
|
|
18
19
|
StartAsyncInvokeCommand,
|
|
@@ -23,7 +24,7 @@ const commands = {
|
|
|
23
24
|
*/
|
|
24
25
|
export const makeBedrockRuntimeService = Effect.gen(function* () {
|
|
25
26
|
const client = yield* Instance.BedrockRuntimeClientInstance;
|
|
26
|
-
return Service.fromClientAndCommands(client, commands, {
|
|
27
|
+
return yield* Service.fromClientAndCommands(client, commands, {
|
|
27
28
|
errorTags: AllServiceErrors,
|
|
28
29
|
resolveClientConfig: BedrockRuntimeServiceConfig.toBedrockRuntimeClientConfig,
|
|
29
30
|
});
|
|
@@ -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,qBAAqB,EAGrB,kBAAkB,EAGlB,oCAAoC,EAGpC,uBAAuB,EAGvB,uBAAuB,GAGxB,MAAM,iCAAiC,CAAC;AAEzC,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"BedrockRuntimeService.js","sourceRoot":"","sources":["../../src/BedrockRuntimeService.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EACL,qBAAqB,EAKrB,eAAe,EAGf,qBAAqB,EAGrB,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,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAC;AACvC,OAAO,KAAK,QAAQ,MAAM,mCAAmC,CAAC;AAC9D,OAAO,KAAK,2BAA2B,MAAM,kCAAkC,CAAC;AAehF,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAE/C,MAAM,QAAQ,GAAG;IACf,qBAAqB;IACrB,eAAe;IACf,qBAAqB;IACrB,qBAAqB;IACrB,kBAAk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ACF,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@effect-aws/client-bedrock-runtime",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.10.0",
|
|
4
4
|
"description": "Effectful AWS Bedrock Runtime client",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -16,7 +16,7 @@
|
|
|
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": "^0.3.0"
|
|
20
20
|
},
|
|
21
21
|
"peerDependencies": {
|
|
22
22
|
"effect": ">=3.0.4 <4.0.0"
|
|
@@ -19,6 +19,9 @@ import {
|
|
|
19
19
|
InvokeModelCommand,
|
|
20
20
|
type InvokeModelCommandInput,
|
|
21
21
|
type InvokeModelCommandOutput,
|
|
22
|
+
InvokeModelWithBidirectionalStreamCommand,
|
|
23
|
+
type InvokeModelWithBidirectionalStreamCommandInput,
|
|
24
|
+
type InvokeModelWithBidirectionalStreamCommandOutput,
|
|
22
25
|
InvokeModelWithResponseStreamCommand,
|
|
23
26
|
type InvokeModelWithResponseStreamCommandInput,
|
|
24
27
|
type InvokeModelWithResponseStreamCommandOutput,
|
|
@@ -31,6 +34,7 @@ import {
|
|
|
31
34
|
} from "@aws-sdk/client-bedrock-runtime";
|
|
32
35
|
import type { HttpHandlerOptions, SdkError, ServiceLogger } from "@effect-aws/commons";
|
|
33
36
|
import { Service } from "@effect-aws/commons";
|
|
37
|
+
import type { Cause } from "effect";
|
|
34
38
|
import { Effect, Layer } from "effect";
|
|
35
39
|
import * as Instance from "./BedrockRuntimeClientInstance.js";
|
|
36
40
|
import * as BedrockRuntimeServiceConfig from "./BedrockRuntimeServiceConfig.js";
|
|
@@ -56,6 +60,7 @@ const commands = {
|
|
|
56
60
|
ConverseStreamCommand,
|
|
57
61
|
GetAsyncInvokeCommand,
|
|
58
62
|
InvokeModelCommand,
|
|
63
|
+
InvokeModelWithBidirectionalStreamCommand,
|
|
59
64
|
InvokeModelWithResponseStreamCommand,
|
|
60
65
|
ListAsyncInvokesCommand,
|
|
61
66
|
StartAsyncInvokeCommand,
|
|
@@ -72,6 +77,7 @@ interface BedrockRuntimeService$ {
|
|
|
72
77
|
options?: HttpHandlerOptions,
|
|
73
78
|
): Effect.Effect<
|
|
74
79
|
ApplyGuardrailCommandOutput,
|
|
80
|
+
| Cause.TimeoutException
|
|
75
81
|
| SdkError
|
|
76
82
|
| AccessDeniedError
|
|
77
83
|
| InternalServerError
|
|
@@ -89,6 +95,7 @@ interface BedrockRuntimeService$ {
|
|
|
89
95
|
options?: HttpHandlerOptions,
|
|
90
96
|
): Effect.Effect<
|
|
91
97
|
ConverseCommandOutput,
|
|
98
|
+
| Cause.TimeoutException
|
|
92
99
|
| SdkError
|
|
93
100
|
| AccessDeniedError
|
|
94
101
|
| InternalServerError
|
|
@@ -109,6 +116,7 @@ interface BedrockRuntimeService$ {
|
|
|
109
116
|
options?: HttpHandlerOptions,
|
|
110
117
|
): Effect.Effect<
|
|
111
118
|
ConverseStreamCommandOutput,
|
|
119
|
+
| Cause.TimeoutException
|
|
112
120
|
| SdkError
|
|
113
121
|
| AccessDeniedError
|
|
114
122
|
| InternalServerError
|
|
@@ -129,7 +137,7 @@ interface BedrockRuntimeService$ {
|
|
|
129
137
|
options?: HttpHandlerOptions,
|
|
130
138
|
): Effect.Effect<
|
|
131
139
|
GetAsyncInvokeCommandOutput,
|
|
132
|
-
SdkError | AccessDeniedError | InternalServerError | ThrottlingError | ValidationError
|
|
140
|
+
Cause.TimeoutException | SdkError | AccessDeniedError | InternalServerError | ThrottlingError | ValidationError
|
|
133
141
|
>;
|
|
134
142
|
|
|
135
143
|
/**
|
|
@@ -140,6 +148,7 @@ interface BedrockRuntimeService$ {
|
|
|
140
148
|
options?: HttpHandlerOptions,
|
|
141
149
|
): Effect.Effect<
|
|
142
150
|
InvokeModelCommandOutput,
|
|
151
|
+
| Cause.TimeoutException
|
|
143
152
|
| SdkError
|
|
144
153
|
| AccessDeniedError
|
|
145
154
|
| InternalServerError
|
|
@@ -153,6 +162,29 @@ interface BedrockRuntimeService$ {
|
|
|
153
162
|
| ValidationError
|
|
154
163
|
>;
|
|
155
164
|
|
|
165
|
+
/**
|
|
166
|
+
* @see {@link InvokeModelWithBidirectionalStreamCommand}
|
|
167
|
+
*/
|
|
168
|
+
invokeModelWithBidirectionalStream(
|
|
169
|
+
args: InvokeModelWithBidirectionalStreamCommandInput,
|
|
170
|
+
options?: HttpHandlerOptions,
|
|
171
|
+
): Effect.Effect<
|
|
172
|
+
InvokeModelWithBidirectionalStreamCommandOutput,
|
|
173
|
+
| Cause.TimeoutException
|
|
174
|
+
| SdkError
|
|
175
|
+
| AccessDeniedError
|
|
176
|
+
| InternalServerError
|
|
177
|
+
| ModelError
|
|
178
|
+
| ModelNotReadyError
|
|
179
|
+
| ModelStreamError
|
|
180
|
+
| ModelTimeoutError
|
|
181
|
+
| ResourceNotFoundError
|
|
182
|
+
| ServiceQuotaExceededError
|
|
183
|
+
| ServiceUnavailableError
|
|
184
|
+
| ThrottlingError
|
|
185
|
+
| ValidationError
|
|
186
|
+
>;
|
|
187
|
+
|
|
156
188
|
/**
|
|
157
189
|
* @see {@link InvokeModelWithResponseStreamCommand}
|
|
158
190
|
*/
|
|
@@ -161,6 +193,7 @@ interface BedrockRuntimeService$ {
|
|
|
161
193
|
options?: HttpHandlerOptions,
|
|
162
194
|
): Effect.Effect<
|
|
163
195
|
InvokeModelWithResponseStreamCommandOutput,
|
|
196
|
+
| Cause.TimeoutException
|
|
164
197
|
| SdkError
|
|
165
198
|
| AccessDeniedError
|
|
166
199
|
| InternalServerError
|
|
@@ -183,7 +216,7 @@ interface BedrockRuntimeService$ {
|
|
|
183
216
|
options?: HttpHandlerOptions,
|
|
184
217
|
): Effect.Effect<
|
|
185
218
|
ListAsyncInvokesCommandOutput,
|
|
186
|
-
SdkError | AccessDeniedError | InternalServerError | ThrottlingError | ValidationError
|
|
219
|
+
Cause.TimeoutException | SdkError | AccessDeniedError | InternalServerError | ThrottlingError | ValidationError
|
|
187
220
|
>;
|
|
188
221
|
|
|
189
222
|
/**
|
|
@@ -194,6 +227,7 @@ interface BedrockRuntimeService$ {
|
|
|
194
227
|
options?: HttpHandlerOptions,
|
|
195
228
|
): Effect.Effect<
|
|
196
229
|
StartAsyncInvokeCommandOutput,
|
|
230
|
+
| Cause.TimeoutException
|
|
197
231
|
| SdkError
|
|
198
232
|
| AccessDeniedError
|
|
199
233
|
| ConflictError
|
|
@@ -213,7 +247,7 @@ interface BedrockRuntimeService$ {
|
|
|
213
247
|
export const makeBedrockRuntimeService = Effect.gen(function*() {
|
|
214
248
|
const client = yield* Instance.BedrockRuntimeClientInstance;
|
|
215
249
|
|
|
216
|
-
return Service.fromClientAndCommands<BedrockRuntimeService$>(
|
|
250
|
+
return yield* Service.fromClientAndCommands<BedrockRuntimeService$>(
|
|
217
251
|
client,
|
|
218
252
|
commands,
|
|
219
253
|
{
|