@effect/ai-amazon-bedrock 0.17.0 → 4.1.4
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/AGENTS.md +434 -0
- package/CLAUDE.md +434 -0
- package/README.md +76 -3
- package/ai-docs/README.md +44 -0
- package/ai-docs/package.json +36 -0
- package/ai-docs/src/01_effect/01_basics/01_effect-gen.ts +30 -0
- package/ai-docs/src/01_effect/01_basics/02_effect-fn.ts +52 -0
- package/ai-docs/src/01_effect/01_basics/10_creating-effects.ts +74 -0
- package/ai-docs/src/01_effect/01_basics/index.md +7 -0
- package/ai-docs/src/01_effect/02_schema/10_schema-basics.ts +43 -0
- package/ai-docs/src/01_effect/02_schema/index.md +7 -0
- package/ai-docs/src/01_effect/03_services/01_service.ts +45 -0
- package/ai-docs/src/01_effect/03_services/10_reference.ts +10 -0
- package/ai-docs/src/01_effect/03_services/20_layer-composition.ts +70 -0
- package/ai-docs/src/01_effect/03_services/20_layer-unwrap.ts +66 -0
- package/ai-docs/src/01_effect/03_services/index.md +5 -0
- package/ai-docs/src/01_effect/04_errors/01_error-handling.ts +30 -0
- package/ai-docs/src/01_effect/04_errors/10_catch-tags.ts +24 -0
- package/ai-docs/src/01_effect/04_errors/20_reason-errors.ts +64 -0
- package/ai-docs/src/01_effect/04_errors/index.md +1 -0
- package/ai-docs/src/01_effect/05_resources/10_acquire-release.ts +105 -0
- package/ai-docs/src/01_effect/05_resources/20_layer-side-effects.ts +31 -0
- package/ai-docs/src/01_effect/05_resources/30_layer-map.ts +86 -0
- package/ai-docs/src/01_effect/05_resources/index.md +3 -0
- package/ai-docs/src/01_effect/06_running/10_run-main.ts +30 -0
- package/ai-docs/src/01_effect/06_running/20_layer-launch.ts +27 -0
- package/ai-docs/src/01_effect/06_running/index.md +1 -0
- package/ai-docs/src/01_effect/07_pubsub/10_pubsub.ts +56 -0
- package/ai-docs/src/01_effect/07_pubsub/index.md +3 -0
- package/ai-docs/src/03_stream/10_creating-streams.ts +103 -0
- package/ai-docs/src/03_stream/20_consuming-streams.ts +137 -0
- package/ai-docs/src/03_stream/30_encoding.ts +163 -0
- package/ai-docs/src/03_stream/index.md +4 -0
- package/ai-docs/src/04_integration/10_managed-runtime.ts +129 -0
- package/ai-docs/src/04_integration/index.md +5 -0
- package/ai-docs/src/05_batching/10_request-resolver.ts +89 -0
- package/ai-docs/src/05_batching/index.md +3 -0
- package/ai-docs/src/06_schedule/10_schedules.ts +111 -0
- package/ai-docs/src/06_schedule/index.md +3 -0
- package/ai-docs/src/07_datetime/10_creating-and-formatting.ts +30 -0
- package/ai-docs/src/07_datetime/20_time-zones.ts +44 -0
- package/ai-docs/src/07_datetime/index.md +5 -0
- package/ai-docs/src/08_observability/10_logging.ts +66 -0
- package/ai-docs/src/08_observability/20_otlp-tracing.ts +95 -0
- package/ai-docs/src/08_observability/index.md +7 -0
- package/ai-docs/src/09_testing/10_effect-tests.ts +55 -0
- package/ai-docs/src/09_testing/20_layer-tests.ts +138 -0
- package/ai-docs/src/09_testing/index.md +1 -0
- package/ai-docs/src/10_predicate/01_basics.ts +14 -0
- package/ai-docs/src/10_predicate/index.md +9 -0
- package/ai-docs/src/40_sql/10_basics.ts +175 -0
- package/ai-docs/src/40_sql/index.md +6 -0
- package/ai-docs/src/50_http-client/10_basics.ts +102 -0
- package/ai-docs/src/50_http-client/index.md +3 -0
- package/ai-docs/src/51_http-server/10_basics.ts +118 -0
- package/ai-docs/src/51_http-server/20_testing.ts +100 -0
- package/ai-docs/src/51_http-server/fixtures/api/Api.ts +14 -0
- package/ai-docs/src/51_http-server/fixtures/api/Authorization.ts +36 -0
- package/ai-docs/src/51_http-server/fixtures/api/System.ts +10 -0
- package/ai-docs/src/51_http-server/fixtures/api/Users.ts +107 -0
- package/ai-docs/src/51_http-server/fixtures/domain/User.ts +21 -0
- package/ai-docs/src/51_http-server/fixtures/domain/UserErrors.ts +22 -0
- package/ai-docs/src/51_http-server/fixtures/server/Authorization.ts +37 -0
- package/ai-docs/src/51_http-server/fixtures/server/Users/http.ts +80 -0
- package/ai-docs/src/51_http-server/fixtures/server/Users.ts +183 -0
- package/ai-docs/src/51_http-server/index.md +3 -0
- package/ai-docs/src/52_graphql/10_basics.ts +117 -0
- package/ai-docs/src/52_graphql/20_testing.ts +45 -0
- package/ai-docs/src/52_graphql/30_batching.ts +118 -0
- package/ai-docs/src/52_graphql/40_aliased-batching.ts +124 -0
- package/ai-docs/src/52_graphql/50_errors-and-retries.ts +74 -0
- package/ai-docs/src/52_graphql/index.md +6 -0
- package/ai-docs/src/60_child-process/10_working-with-child-processes.ts +117 -0
- package/ai-docs/src/60_child-process/index.md +3 -0
- package/ai-docs/src/70_cli/10_basics.ts +162 -0
- package/ai-docs/src/70_cli/index.md +5 -0
- package/ai-docs/src/71_ai/10_language-model.ts +156 -0
- package/ai-docs/src/71_ai/20_tools.ts +226 -0
- package/ai-docs/src/71_ai/30_chat.ts +158 -0
- package/ai-docs/src/71_ai/fixtures/domain/LaunchPlan.ts +9 -0
- package/ai-docs/src/71_ai/index.md +5 -0
- package/ai-docs/src/80_cluster/10_entities.ts +97 -0
- package/ai-docs/src/80_cluster/index.md +4 -0
- package/ai-docs/src/index.md +10 -0
- package/ai-docs/tsconfig.json +28 -0
- package/dist/AmazonBedrockClient.d.ts +227 -0
- package/dist/AmazonBedrockClient.d.ts.map +1 -0
- package/dist/AmazonBedrockClient.js +281 -0
- package/dist/AmazonBedrockClient.js.map +1 -0
- package/dist/AmazonBedrockConfig.d.ts +76 -0
- package/dist/AmazonBedrockConfig.d.ts.map +1 -0
- package/dist/AmazonBedrockConfig.js +41 -0
- package/dist/AmazonBedrockConfig.js.map +1 -0
- package/dist/AmazonBedrockLanguageModel.d.ts +315 -0
- package/dist/AmazonBedrockLanguageModel.d.ts.map +1 -0
- package/dist/AmazonBedrockLanguageModel.js +991 -0
- package/dist/AmazonBedrockLanguageModel.js.map +1 -0
- package/dist/AmazonBedrockSchema.d.ts +918 -0
- package/dist/AmazonBedrockSchema.d.ts.map +1 -0
- package/dist/AmazonBedrockSchema.js +536 -0
- package/dist/AmazonBedrockSchema.js.map +1 -0
- package/dist/index.d.ts +25 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/{esm/index.js → index.js} +13 -12
- package/dist/index.js.map +1 -0
- package/dist/internal/errors.d.ts +2 -0
- package/dist/internal/errors.d.ts.map +1 -0
- package/dist/internal/errors.js +185 -0
- package/dist/internal/errors.js.map +1 -0
- package/dist/internal/eventStream.d.ts +2 -0
- package/dist/internal/eventStream.d.ts.map +1 -0
- package/dist/internal/eventStream.js +180 -0
- package/dist/internal/eventStream.js.map +1 -0
- package/dist/internal/sigv4.d.ts +2 -0
- package/dist/internal/sigv4.d.ts.map +1 -0
- package/dist/internal/sigv4.js +115 -0
- package/dist/internal/sigv4.js.map +1 -0
- package/dist/{dts/internal → internal}/utilities.d.ts.map +1 -1
- package/dist/internal/utilities.js +17 -0
- package/dist/internal/utilities.js.map +1 -0
- package/package.json +45 -84
- package/src/AmazonBedrockClient.ts +447 -263
- package/src/AmazonBedrockConfig.ts +55 -40
- package/src/AmazonBedrockLanguageModel.ts +950 -929
- package/src/AmazonBedrockSchema.ts +526 -970
- package/src/index.ts +15 -14
- package/src/internal/errors.ts +207 -0
- package/src/internal/eventStream.ts +208 -0
- package/src/internal/sigv4.ts +154 -0
- package/src/internal/utilities.ts +15 -17
- package/AmazonBedrockClient/package.json +0 -6
- package/AmazonBedrockConfig/package.json +0 -6
- package/AmazonBedrockLanguageModel/package.json +0 -6
- package/AmazonBedrockSchema/package.json +0 -6
- package/AmazonBedrockTool/package.json +0 -6
- package/EventStreamEncoding/package.json +0 -6
- package/dist/cjs/AmazonBedrockClient.js +0 -191
- package/dist/cjs/AmazonBedrockClient.js.map +0 -1
- package/dist/cjs/AmazonBedrockConfig.js +0 -30
- package/dist/cjs/AmazonBedrockConfig.js.map +0 -1
- package/dist/cjs/AmazonBedrockLanguageModel.js +0 -1051
- package/dist/cjs/AmazonBedrockLanguageModel.js.map +0 -1
- package/dist/cjs/AmazonBedrockSchema.js +0 -800
- package/dist/cjs/AmazonBedrockSchema.js.map +0 -1
- package/dist/cjs/AmazonBedrockTool.js +0 -53
- package/dist/cjs/AmazonBedrockTool.js.map +0 -1
- package/dist/cjs/EventStreamEncoding.js +0 -86
- package/dist/cjs/EventStreamEncoding.js.map +0 -1
- package/dist/cjs/index.js +0 -20
- package/dist/cjs/index.js.map +0 -1
- package/dist/cjs/internal/utilities.js +0 -27
- package/dist/cjs/internal/utilities.js.map +0 -1
- package/dist/dts/AmazonBedrockClient.d.ts +0 -95
- package/dist/dts/AmazonBedrockClient.d.ts.map +0 -1
- package/dist/dts/AmazonBedrockConfig.d.ts +0 -47
- package/dist/dts/AmazonBedrockConfig.d.ts.map +0 -1
- package/dist/dts/AmazonBedrockLanguageModel.d.ts +0 -147
- package/dist/dts/AmazonBedrockLanguageModel.d.ts.map +0 -1
- package/dist/dts/AmazonBedrockSchema.d.ts +0 -1875
- package/dist/dts/AmazonBedrockSchema.d.ts.map +0 -1
- package/dist/dts/AmazonBedrockTool.d.ts +0 -206
- package/dist/dts/AmazonBedrockTool.d.ts.map +0 -1
- package/dist/dts/EventStreamEncoding.d.ts +0 -16
- package/dist/dts/EventStreamEncoding.d.ts.map +0 -1
- package/dist/dts/index.d.ts +0 -25
- package/dist/dts/index.d.ts.map +0 -1
- package/dist/esm/AmazonBedrockClient.js +0 -179
- package/dist/esm/AmazonBedrockClient.js.map +0 -1
- package/dist/esm/AmazonBedrockConfig.js +0 -22
- package/dist/esm/AmazonBedrockConfig.js.map +0 -1
- package/dist/esm/AmazonBedrockLanguageModel.js +0 -1040
- package/dist/esm/AmazonBedrockLanguageModel.js.map +0 -1
- package/dist/esm/AmazonBedrockSchema.js +0 -731
- package/dist/esm/AmazonBedrockSchema.js.map +0 -1
- package/dist/esm/AmazonBedrockTool.js +0 -45
- package/dist/esm/AmazonBedrockTool.js.map +0 -1
- package/dist/esm/EventStreamEncoding.js +0 -78
- package/dist/esm/EventStreamEncoding.js.map +0 -1
- package/dist/esm/index.js.map +0 -1
- package/dist/esm/internal/utilities.js +0 -19
- package/dist/esm/internal/utilities.js.map +0 -1
- package/dist/esm/package.json +0 -4
- package/index/package.json +0 -6
- package/src/AmazonBedrockTool.ts +0 -273
- package/src/EventStreamEncoding.ts +0 -118
- /package/dist/{dts/internal → internal}/utilities.d.ts +0 -0
|
@@ -1,731 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @since 1.0.0
|
|
3
|
-
*/
|
|
4
|
-
import * as Schema from "effect/Schema";
|
|
5
|
-
const prefix = "@effect/ai-amazon-bedrock";
|
|
6
|
-
const makeIdentifier = name => `${prefix}/${name}`;
|
|
7
|
-
/**
|
|
8
|
-
* The foundation models supported by Amazon Bedrock.
|
|
9
|
-
*
|
|
10
|
-
* An up-to-date list can be generated with the following command:
|
|
11
|
-
*
|
|
12
|
-
* ```sh
|
|
13
|
-
* aws bedrock list-foundation-models --output json | jq '[.modelSummaries[].modelId]'
|
|
14
|
-
* ```
|
|
15
|
-
*
|
|
16
|
-
* @since 1.0.0
|
|
17
|
-
* @category Schemas
|
|
18
|
-
*/
|
|
19
|
-
export class BedrockFoundationModelId extends /*#__PURE__*/Schema.Literal("amazon.titan-tg1-large", "amazon.titan-image-generator-v1:0", "amazon.titan-image-generator-v1", "amazon.titan-image-generator-v2:0", "amazon.nova-premier-v1:0:8k", "amazon.nova-premier-v1:0:20k", "amazon.nova-premier-v1:0:1000k", "amazon.nova-premier-v1:0:mm", "amazon.nova-premier-v1:0", "amazon.titan-text-premier-v1:0", "amazon.nova-pro-v1:0:24k", "amazon.nova-pro-v1:0:300k", "amazon.nova-pro-v1:0", "amazon.nova-lite-v1:0:24k", "amazon.nova-lite-v1:0:300k", "amazon.nova-lite-v1:0", "amazon.nova-canvas-v1:0", "amazon.nova-reel-v1:0", "amazon.nova-reel-v1:1", "amazon.nova-micro-v1:0:24k", "amazon.nova-micro-v1:0:128k", "amazon.nova-micro-v1:0", "amazon.nova-sonic-v1:0", "amazon.titan-embed-g1-text-02", "amazon.titan-text-lite-v1:0:4k", "amazon.titan-text-lite-v1", "amazon.titan-text-express-v1:0:8k", "amazon.titan-text-express-v1", "amazon.titan-embed-text-v1:2:8k", "amazon.titan-embed-text-v1", "amazon.titan-embed-text-v2:0:8k", "amazon.titan-embed-text-v2:0", "amazon.titan-embed-image-v1:0", "amazon.titan-embed-image-v1", "stability.stable-diffusion-xl-v1:0", "stability.stable-diffusion-xl-v1", "ai21.jamba-instruct-v1:0", "ai21.jamba-1-5-large-v1:0", "ai21.jamba-1-5-mini-v1:0", "anthropic.claude-instant-v1:2:100k", "anthropic.claude-instant-v1", "anthropic.claude-v2:0:18k", "anthropic.claude-v2:0:100k", "anthropic.claude-v2:1:18k", "anthropic.claude-v2:1:200k", "anthropic.claude-v2:1", "anthropic.claude-v2", "anthropic.claude-3-sonnet-20240229-v1:0:28k", "anthropic.claude-3-sonnet-20240229-v1:0:200k", "anthropic.claude-3-sonnet-20240229-v1:0", "anthropic.claude-3-haiku-20240307-v1:0:48k", "anthropic.claude-3-haiku-20240307-v1:0:200k", "anthropic.claude-3-haiku-20240307-v1:0", "anthropic.claude-3-opus-20240229-v1:0:12k", "anthropic.claude-3-opus-20240229-v1:0:28k", "anthropic.claude-3-opus-20240229-v1:0:200k", "anthropic.claude-3-opus-20240229-v1:0", "anthropic.claude-3-5-sonnet-20240620-v1:0", "anthropic.claude-3-5-sonnet-20241022-v2:0", "anthropic.claude-3-7-sonnet-20250219-v1:0", "anthropic.claude-3-5-haiku-20241022-v1:0", "anthropic.claude-opus-4-20250514-v1:0", "anthropic.claude-sonnet-4-20250514-v1:0", "cohere.command-text-v14:7:4k", "cohere.command-text-v14", "cohere.command-r-v1:0", "cohere.command-r-plus-v1:0", "cohere.command-light-text-v14:7:4k", "cohere.command-light-text-v14", "cohere.embed-english-v3:0:512", "cohere.embed-english-v3", "cohere.embed-multilingual-v3:0:512", "cohere.embed-multilingual-v3", "deepseek.r1-v1:0", "meta.llama3-8b-instruct-v1:0", "meta.llama3-70b-instruct-v1:0", "meta.llama3-1-8b-instruct-v1:0", "meta.llama3-1-70b-instruct-v1:0", "meta.llama3-2-11b-instruct-v1:0", "meta.llama3-2-90b-instruct-v1:0", "meta.llama3-2-1b-instruct-v1:0", "meta.llama3-2-3b-instruct-v1:0", "meta.llama3-3-70b-instruct-v1:0", "meta.llama4-scout-17b-instruct-v1:0", "meta.llama4-maverick-17b-instruct-v1:0", "mistral.mistral-7b-instruct-v0:2", "mistral.mixtral-8x7b-instruct-v0:1", "mistral.mistral-large-2402-v1:0", "mistral.mistral-small-2402-v1:0", "mistral.pixtral-large-2502-v1:0") {}
|
|
20
|
-
/**
|
|
21
|
-
* @since 1.0.0
|
|
22
|
-
* @category Schemas
|
|
23
|
-
*/
|
|
24
|
-
export class CachePointBlock extends /*#__PURE__*/Schema.Class(makeIdentifier("CachePointBlock"))({
|
|
25
|
-
type: /*#__PURE__*/Schema.Literal("default")
|
|
26
|
-
}) {}
|
|
27
|
-
/**
|
|
28
|
-
* @since 1.0.0
|
|
29
|
-
* @category Schemas
|
|
30
|
-
*/
|
|
31
|
-
export const DocumentFormat = /*#__PURE__*/Schema.Literal("csv", "doc", "docx", "html", "md", "pdf", "txt", "xls", "xlsx");
|
|
32
|
-
/**
|
|
33
|
-
* @since 1.0.0
|
|
34
|
-
* @category Schemas
|
|
35
|
-
*/
|
|
36
|
-
export class DocumentBlock extends /*#__PURE__*/Schema.Class(makeIdentifier("DocumentBlock"))({
|
|
37
|
-
name: /*#__PURE__*/Schema.String.pipe(/*#__PURE__*/Schema.pattern(/^[a-zA-Z0-9()[\]-]+(?: [a-zA-Z0-9()[\]-]+)*$/), /*#__PURE__*/Schema.minLength(1), /*#__PURE__*/Schema.maxLength(200)),
|
|
38
|
-
format: DocumentFormat,
|
|
39
|
-
source: /*#__PURE__*/Schema.Struct({
|
|
40
|
-
bytes: Schema.NonEmptyString
|
|
41
|
-
})
|
|
42
|
-
}) {}
|
|
43
|
-
/**
|
|
44
|
-
* @since 1.0.0
|
|
45
|
-
* @category Schemas
|
|
46
|
-
*/
|
|
47
|
-
export class GuardrailConverseImageBlock extends /*#__PURE__*/Schema.Class(makeIdentifier("GuardrailConverseImageBlock"))({
|
|
48
|
-
format: /*#__PURE__*/Schema.Literal("png", "jpg"),
|
|
49
|
-
source: /*#__PURE__*/Schema.Struct({
|
|
50
|
-
bytes: Schema.NonEmptyString
|
|
51
|
-
})
|
|
52
|
-
}) {}
|
|
53
|
-
/**
|
|
54
|
-
* @since 1.0.0
|
|
55
|
-
* @category Schemas
|
|
56
|
-
*/
|
|
57
|
-
export class GuardrailConverseTextBlock extends /*#__PURE__*/Schema.Class(makeIdentifier("GuardrailConverseTextBlock"))({
|
|
58
|
-
text: Schema.String,
|
|
59
|
-
qualifiers: /*#__PURE__*/Schema.optional(/*#__PURE__*/Schema.Array(/*#__PURE__*/Schema.Literal("guard_content", "grounding_source", "query")))
|
|
60
|
-
}) {}
|
|
61
|
-
/**
|
|
62
|
-
* @since 1.0.0
|
|
63
|
-
* @category Schemas
|
|
64
|
-
*/
|
|
65
|
-
export class GuardrailConverseContentBlock extends /*#__PURE__*/Schema.Union(GuardrailConverseImageBlock, GuardrailConverseTextBlock) {}
|
|
66
|
-
/**
|
|
67
|
-
* @since 1.0.0
|
|
68
|
-
* @category Schemas
|
|
69
|
-
*/
|
|
70
|
-
export const ImageFormat = /*#__PURE__*/Schema.Literal("gif", "jpeg", "png", "webp");
|
|
71
|
-
/**
|
|
72
|
-
* @since 1.0.0
|
|
73
|
-
* @category Schemas
|
|
74
|
-
*/
|
|
75
|
-
export class ImageBlock extends /*#__PURE__*/Schema.Class(makeIdentifier("ImageBlock"))({
|
|
76
|
-
format: ImageFormat,
|
|
77
|
-
source: /*#__PURE__*/Schema.Struct({
|
|
78
|
-
bytes: Schema.NonEmptyString
|
|
79
|
-
})
|
|
80
|
-
}) {}
|
|
81
|
-
/**
|
|
82
|
-
* @since 1.0.0
|
|
83
|
-
* @category Schemas
|
|
84
|
-
*/
|
|
85
|
-
export class JsonBlock extends /*#__PURE__*/Schema.Class(makeIdentifier("JsonBlock"))({
|
|
86
|
-
json: Schema.Unknown
|
|
87
|
-
}) {}
|
|
88
|
-
/**
|
|
89
|
-
* @since 1.0.0
|
|
90
|
-
* @category Schemas
|
|
91
|
-
*/
|
|
92
|
-
export class ReasoningContentBlock extends /*#__PURE__*/Schema.Union(/*#__PURE__*/Schema.Struct({
|
|
93
|
-
reasoningText: Schema.Struct({
|
|
94
|
-
text: Schema.String,
|
|
95
|
-
signature: Schema.optional(Schema.String)
|
|
96
|
-
})
|
|
97
|
-
}).pipe(/*#__PURE__*/Schema.attachPropertySignature("type", "reasoning"), /*#__PURE__*/Schema.annotations({
|
|
98
|
-
identifier: "ReasoningTextContentBlock"
|
|
99
|
-
})), /*#__PURE__*/Schema.Struct({
|
|
100
|
-
redactedContent: Schema.String
|
|
101
|
-
}).pipe(/*#__PURE__*/Schema.attachPropertySignature("type", "redacted-reasoning"), /*#__PURE__*/Schema.annotations({
|
|
102
|
-
identifier: "RedactedReasoningContentBlock"
|
|
103
|
-
}))) {}
|
|
104
|
-
/**
|
|
105
|
-
* @since 1.0.0
|
|
106
|
-
* @category Schemas
|
|
107
|
-
*/
|
|
108
|
-
export class VideoBlock extends /*#__PURE__*/Schema.Class(makeIdentifier("VideoBlock"))({
|
|
109
|
-
format: /*#__PURE__*/Schema.Literal("flv", "mkv", "mov", "mp4", "mpg", "mpeg", "three_gp", "webm"),
|
|
110
|
-
source: /*#__PURE__*/Schema.Union(/*#__PURE__*/Schema.Struct({
|
|
111
|
-
bytes: Schema.NonEmptyString
|
|
112
|
-
}), /*#__PURE__*/Schema.Struct({
|
|
113
|
-
s3Location: /*#__PURE__*/Schema.Struct({
|
|
114
|
-
uri: /*#__PURE__*/Schema.String.pipe(/*#__PURE__*/Schema.pattern(/^s3:\/\/[a-z0-9][.\-a-z0-9]{1,61}[a-z0-9](\/.*)?$/), /*#__PURE__*/Schema.minLength(1), /*#__PURE__*/Schema.maxLength(1024)),
|
|
115
|
-
bucketOwner: /*#__PURE__*/Schema.String.pipe(/*#__PURE__*/Schema.pattern(/^[0-9]{12}$/), Schema.optional)
|
|
116
|
-
})
|
|
117
|
-
}))
|
|
118
|
-
}) {}
|
|
119
|
-
/**
|
|
120
|
-
* @since 1.0.0
|
|
121
|
-
* @category Schemas
|
|
122
|
-
*/
|
|
123
|
-
export class ToolResultBlock extends /*#__PURE__*/Schema.Class(makeIdentifier("ToolResultBlock"))({
|
|
124
|
-
content: /*#__PURE__*/Schema.Array(/*#__PURE__*/Schema.Union(/*#__PURE__*/Schema.Struct({
|
|
125
|
-
document: DocumentBlock
|
|
126
|
-
}), /*#__PURE__*/Schema.Struct({
|
|
127
|
-
image: ImageBlock
|
|
128
|
-
}), /*#__PURE__*/Schema.Struct({
|
|
129
|
-
text: Schema.String
|
|
130
|
-
}), /*#__PURE__*/Schema.Struct({
|
|
131
|
-
json: JsonBlock
|
|
132
|
-
}), /*#__PURE__*/Schema.Struct({
|
|
133
|
-
video: VideoBlock
|
|
134
|
-
}))),
|
|
135
|
-
toolUseId: /*#__PURE__*/Schema.String.pipe(/*#__PURE__*/Schema.pattern(/^[a-zA-Z0-9_-]+$/), /*#__PURE__*/Schema.minLength(1), /*#__PURE__*/Schema.maxLength(64)),
|
|
136
|
-
status: /*#__PURE__*/Schema.optional(/*#__PURE__*/Schema.Literal("success", "error"))
|
|
137
|
-
}) {}
|
|
138
|
-
/**
|
|
139
|
-
* @since 1.0.0
|
|
140
|
-
* @category Schemas
|
|
141
|
-
*/
|
|
142
|
-
export class ToolUseBlock extends /*#__PURE__*/Schema.Class(makeIdentifier("ToolUseBlock"))({
|
|
143
|
-
name: /*#__PURE__*/Schema.String.pipe(/*#__PURE__*/Schema.pattern(/^[a-zA-Z0-9_-]+$/), /*#__PURE__*/Schema.minLength(1), /*#__PURE__*/Schema.maxLength(64)),
|
|
144
|
-
input: Schema.Unknown,
|
|
145
|
-
toolUseId: /*#__PURE__*/Schema.String.pipe(/*#__PURE__*/Schema.pattern(/^[a-zA-Z0-9_-]+$/), /*#__PURE__*/Schema.minLength(1), /*#__PURE__*/Schema.maxLength(64))
|
|
146
|
-
}) {}
|
|
147
|
-
/**
|
|
148
|
-
* @since 1.0.0
|
|
149
|
-
* @category Schemas
|
|
150
|
-
*/
|
|
151
|
-
export class ContentBlock extends /*#__PURE__*/Schema.Union(/*#__PURE__*/Schema.Struct({
|
|
152
|
-
cachePoint: CachePointBlock
|
|
153
|
-
}).pipe(/*#__PURE__*/Schema.attachPropertySignature("type", "cachePoint"), /*#__PURE__*/Schema.annotations({
|
|
154
|
-
identifier: "CachePointContentBlock"
|
|
155
|
-
})), /*#__PURE__*/Schema.Struct({
|
|
156
|
-
document: DocumentBlock
|
|
157
|
-
}).pipe(/*#__PURE__*/Schema.attachPropertySignature("type", "document"), /*#__PURE__*/Schema.annotations({
|
|
158
|
-
identifier: "DocumentContentBlock"
|
|
159
|
-
})), /*#__PURE__*/Schema.Struct({
|
|
160
|
-
guardContent: GuardrailConverseContentBlock
|
|
161
|
-
}).pipe(/*#__PURE__*/Schema.attachPropertySignature("type", "guardContent"), /*#__PURE__*/Schema.annotations({
|
|
162
|
-
identifier: "GuardrailContentBlock"
|
|
163
|
-
})), /*#__PURE__*/Schema.Struct({
|
|
164
|
-
image: ImageBlock
|
|
165
|
-
}).pipe(/*#__PURE__*/Schema.attachPropertySignature("type", "image"), /*#__PURE__*/Schema.annotations({
|
|
166
|
-
identifier: "ImageContentBlock"
|
|
167
|
-
})), /*#__PURE__*/Schema.Struct({
|
|
168
|
-
reasoningContent: ReasoningContentBlock
|
|
169
|
-
}).pipe(/*#__PURE__*/Schema.attachPropertySignature("type", "reasoningContent"), /*#__PURE__*/Schema.annotations({
|
|
170
|
-
identifier: "ResponseContentBlock"
|
|
171
|
-
})), /*#__PURE__*/Schema.Struct({
|
|
172
|
-
text: Schema.String
|
|
173
|
-
}).pipe(/*#__PURE__*/Schema.attachPropertySignature("type", "text"), /*#__PURE__*/Schema.annotations({
|
|
174
|
-
identifier: "TextContentBlock"
|
|
175
|
-
})), /*#__PURE__*/Schema.Struct({
|
|
176
|
-
toolResult: ToolResultBlock
|
|
177
|
-
}).pipe(/*#__PURE__*/Schema.attachPropertySignature("type", "toolResult"), /*#__PURE__*/Schema.annotations({
|
|
178
|
-
identifier: "ToolResultContentBlock"
|
|
179
|
-
})), /*#__PURE__*/Schema.Struct({
|
|
180
|
-
toolUse: ToolUseBlock
|
|
181
|
-
}).pipe(/*#__PURE__*/Schema.attachPropertySignature("type", "toolUse"), /*#__PURE__*/Schema.annotations({
|
|
182
|
-
identifier: "ToolUseContentBlock"
|
|
183
|
-
})), /*#__PURE__*/Schema.Struct({
|
|
184
|
-
video: VideoBlock
|
|
185
|
-
}).pipe(/*#__PURE__*/Schema.attachPropertySignature("type", "video"), /*#__PURE__*/Schema.annotations({
|
|
186
|
-
identifier: "VideoContentBlock"
|
|
187
|
-
}))) {}
|
|
188
|
-
/**
|
|
189
|
-
* @since 1.0.0
|
|
190
|
-
* @category Schemas
|
|
191
|
-
*/
|
|
192
|
-
export class Message extends /*#__PURE__*/Schema.Class(makeIdentifier("Message"))({
|
|
193
|
-
role: /*#__PURE__*/Schema.Literal("user", "assistant"),
|
|
194
|
-
content: /*#__PURE__*/Schema.Array(ContentBlock)
|
|
195
|
-
}) {}
|
|
196
|
-
/**
|
|
197
|
-
* @since 1.0.0
|
|
198
|
-
* @category Schemas
|
|
199
|
-
*/
|
|
200
|
-
export class ConverseOutput extends /*#__PURE__*/Schema.Class(makeIdentifier("ConverseOutput"))({
|
|
201
|
-
message: Message
|
|
202
|
-
}) {}
|
|
203
|
-
/**
|
|
204
|
-
* @since 1.0.0
|
|
205
|
-
* @category Schemas
|
|
206
|
-
*/
|
|
207
|
-
export class ConverseMetrics extends /*#__PURE__*/Schema.Class(makeIdentifier("ConverseMetrics"))({
|
|
208
|
-
latencyMs: Schema.DurationFromMillis
|
|
209
|
-
}) {}
|
|
210
|
-
/**
|
|
211
|
-
* @since 1.0.0
|
|
212
|
-
* @category Schemas
|
|
213
|
-
*/
|
|
214
|
-
export class GuardrailContentFilter extends /*#__PURE__*/Schema.Class(makeIdentifier("GuardrailContentFilter"))({
|
|
215
|
-
type: /*#__PURE__*/Schema.Literal("HATE", "INSULTS", "MISCONDUCT", "PROMPT_ATTACK", "SEXUAL", "VIOLENCE"),
|
|
216
|
-
action: /*#__PURE__*/Schema.Literal("BLOCKED", "NONE"),
|
|
217
|
-
confidence: /*#__PURE__*/Schema.Literal("NONE", "LOW", "MEDIUM", "HIGH"),
|
|
218
|
-
detected: /*#__PURE__*/Schema.optional(Schema.Boolean),
|
|
219
|
-
filterStrength: /*#__PURE__*/Schema.optional(/*#__PURE__*/Schema.Literal("NONE", "LOW", "MEDIUM", "HIGH"))
|
|
220
|
-
}) {}
|
|
221
|
-
/**
|
|
222
|
-
* @since 1.0.0
|
|
223
|
-
* @category Schemas
|
|
224
|
-
*/
|
|
225
|
-
export class GuardrailContentPolicyAssessment extends /*#__PURE__*/Schema.Class(makeIdentifier("GuardrailContentPolicyAssessment"))({
|
|
226
|
-
filters: /*#__PURE__*/Schema.Array(GuardrailContentFilter)
|
|
227
|
-
}) {}
|
|
228
|
-
/**
|
|
229
|
-
* @since 1.0.0
|
|
230
|
-
* @category Schemas
|
|
231
|
-
*/
|
|
232
|
-
export class GuardrailContextualGroundingFilter extends /*#__PURE__*/Schema.Class(makeIdentifier("GuardrailContextualGroundingFilter"))({
|
|
233
|
-
type: /*#__PURE__*/Schema.Literal("GROUNDING", "RELEVANCE"),
|
|
234
|
-
action: /*#__PURE__*/Schema.Literal("BLOCKED", "NONE"),
|
|
235
|
-
score: /*#__PURE__*/Schema.Number.pipe(/*#__PURE__*/Schema.between(0, 1)),
|
|
236
|
-
threshold: /*#__PURE__*/Schema.Number.pipe(/*#__PURE__*/Schema.between(0, 1)),
|
|
237
|
-
detected: /*#__PURE__*/Schema.optional(Schema.Boolean)
|
|
238
|
-
}) {}
|
|
239
|
-
/**
|
|
240
|
-
* @since 1.0.0
|
|
241
|
-
* @category Schemas
|
|
242
|
-
*/
|
|
243
|
-
export class GuardrailContextualGroundingPolicyAssessment extends /*#__PURE__*/Schema.Class(makeIdentifier("GuardrailContextualGroundingPolicyAssessment"))({
|
|
244
|
-
filters: /*#__PURE__*/Schema.optional(/*#__PURE__*/Schema.Array(GuardrailContextualGroundingFilter))
|
|
245
|
-
}) {}
|
|
246
|
-
/**
|
|
247
|
-
* @since 1.0.0
|
|
248
|
-
* @category Schemas
|
|
249
|
-
*/
|
|
250
|
-
export class GuardrailImageCoverage extends /*#__PURE__*/Schema.Class(makeIdentifier("GuardrailImageCoverage"))({
|
|
251
|
-
guarded: /*#__PURE__*/Schema.optional(Schema.Int),
|
|
252
|
-
total: /*#__PURE__*/Schema.optional(Schema.Int)
|
|
253
|
-
}) {}
|
|
254
|
-
/**
|
|
255
|
-
* @since 1.0.0
|
|
256
|
-
* @category Schemas
|
|
257
|
-
*/
|
|
258
|
-
export class GuardrailTextCharactersCoverage extends /*#__PURE__*/Schema.Class(makeIdentifier("GuardrailTextCharactersCoverage"))({
|
|
259
|
-
guarded: /*#__PURE__*/Schema.optional(Schema.Int),
|
|
260
|
-
total: /*#__PURE__*/Schema.optional(Schema.Int)
|
|
261
|
-
}) {}
|
|
262
|
-
/**
|
|
263
|
-
* @since 1.0.0
|
|
264
|
-
* @category Schemas
|
|
265
|
-
*/
|
|
266
|
-
export class GuardrailCoverage extends /*#__PURE__*/Schema.Class(makeIdentifier("GuardrailCoverage"))({
|
|
267
|
-
images: /*#__PURE__*/Schema.optional(GuardrailImageCoverage),
|
|
268
|
-
textCharacters: /*#__PURE__*/Schema.optional(GuardrailTextCharactersCoverage)
|
|
269
|
-
}) {}
|
|
270
|
-
/**
|
|
271
|
-
* @since 1.0.0
|
|
272
|
-
* @category Schemas
|
|
273
|
-
*/
|
|
274
|
-
export class GuardrailUsage extends /*#__PURE__*/Schema.Class(makeIdentifier("GuardrailUsage"))({
|
|
275
|
-
contentPolicyUnits: Schema.Int,
|
|
276
|
-
contextualGroundingPolicyUnits: Schema.Int,
|
|
277
|
-
sensitiveInformationPolicyFreeUnits: Schema.Int,
|
|
278
|
-
sensitiveInformationPolicyUnits: Schema.Int,
|
|
279
|
-
topicPolicyUnits: Schema.Int,
|
|
280
|
-
wordPolicyUnits: Schema.Int,
|
|
281
|
-
contentPolicyImageUnits: /*#__PURE__*/Schema.optional(Schema.Int)
|
|
282
|
-
}) {}
|
|
283
|
-
/**
|
|
284
|
-
* @since 1.0.0
|
|
285
|
-
* @category Schemas
|
|
286
|
-
*/
|
|
287
|
-
export class GuardrailInvocationMetrics extends /*#__PURE__*/Schema.Class(makeIdentifier("GuardrailInvocationMetrics"))({
|
|
288
|
-
guardrailCoverage: /*#__PURE__*/Schema.optional(GuardrailCoverage),
|
|
289
|
-
guardrailProcessingLatency: /*#__PURE__*/Schema.optional(Schema.Number),
|
|
290
|
-
usage: /*#__PURE__*/Schema.optional(GuardrailUsage)
|
|
291
|
-
}) {}
|
|
292
|
-
/**
|
|
293
|
-
* @since 1.0.0
|
|
294
|
-
* @category Schemas
|
|
295
|
-
*/
|
|
296
|
-
export class GuardrailPiiEntityFilter extends /*#__PURE__*/Schema.Class(makeIdentifier("GuardrailPiiEntityFilter"))({
|
|
297
|
-
type: /*#__PURE__*/Schema.Literal("ADDRESS", "AGE", "AWS_ACCESS_KEY", "AWS_SECRET_KEY", "CA_HEALTH_NUMBER", "CA_SOCIAL_INSURANCE_NUMBER", "CREDIT_DEBIT_CARD_CVV", "CREDIT_DEBIT_CARD_EXPIRY", "CREDIT_DEBIT_CARD_NUMBER", "DRIVER_ID", "EMAIL", "INTERNATIONAL_BANK_ACCOUNT_NUMBER", "IP_ADDRESS", "LICENSE_PLATE", "MAC_ADDRESS", "NAME", "PASSWORD", "PHONE", "PIN", "SWIFT_CODE", "UK_NATIONAL_HEALTH_SERVICE_NUMBER", "UK_NATIONAL_INSURANCE_NUMBER", "UK_UNIQUE_TAXPAYER_REFERENCE_NUMBER", "URL", "USERNAME", "US_BANK_ACCOUNT_NUMBER", "US_BANK_ROUTING_NUMBER", "US_INDIVIDUAL_TAX_IDENTIFICATION_NUMBER", "US_PASSPORT_NUMBER", "US_SOCIAL_SECURITY_NUMBER", "VEHICLE_IDENTIFICATION_NUMBER"),
|
|
298
|
-
action: /*#__PURE__*/Schema.Literal("ANONYMIZED", "BLOCKED", "NONE"),
|
|
299
|
-
match: Schema.String,
|
|
300
|
-
detected: /*#__PURE__*/Schema.optional(Schema.Boolean)
|
|
301
|
-
}) {}
|
|
302
|
-
/**
|
|
303
|
-
* @since 1.0.0
|
|
304
|
-
* @category Schemas
|
|
305
|
-
*/
|
|
306
|
-
export class GuardrailRegexFilter extends /*#__PURE__*/Schema.Class(makeIdentifier("GuardrailRegexFilter"))({
|
|
307
|
-
action: /*#__PURE__*/Schema.Literal("ANONYMIZED", "BLOCKED", "NONE"),
|
|
308
|
-
name: /*#__PURE__*/Schema.optional(Schema.String),
|
|
309
|
-
match: /*#__PURE__*/Schema.optional(Schema.String),
|
|
310
|
-
regex: /*#__PURE__*/Schema.optional(Schema.String),
|
|
311
|
-
detected: /*#__PURE__*/Schema.optional(Schema.Boolean)
|
|
312
|
-
}) {}
|
|
313
|
-
/**
|
|
314
|
-
* @since 1.0.0
|
|
315
|
-
* @category Schemas
|
|
316
|
-
*/
|
|
317
|
-
export class GuardrailSensitiveInformationPolicyAssessment extends /*#__PURE__*/Schema.Class(makeIdentifier("GuardrailSensitiveInformationPolicyAssessment"))({
|
|
318
|
-
piiEntities: /*#__PURE__*/Schema.Array(GuardrailPiiEntityFilter),
|
|
319
|
-
regexes: /*#__PURE__*/Schema.Array(GuardrailRegexFilter)
|
|
320
|
-
}) {}
|
|
321
|
-
/**
|
|
322
|
-
* @since 1.0.0
|
|
323
|
-
* @category Schemas
|
|
324
|
-
*/
|
|
325
|
-
export class GuardrailTopic extends /*#__PURE__*/Schema.Class(makeIdentifier("GuardrailTopic"))({
|
|
326
|
-
action: /*#__PURE__*/Schema.Literal("BLOCKED", "NONE"),
|
|
327
|
-
name: Schema.String,
|
|
328
|
-
type: /*#__PURE__*/Schema.Literal("DENY"),
|
|
329
|
-
detected: /*#__PURE__*/Schema.optional(Schema.Boolean)
|
|
330
|
-
}) {}
|
|
331
|
-
/**
|
|
332
|
-
* @since 1.0.0
|
|
333
|
-
* @category Schemas
|
|
334
|
-
*/
|
|
335
|
-
export class GuardrailTopicPolicyAssessment extends /*#__PURE__*/Schema.Class(makeIdentifier("GuardrailTopicPolicyAssessment"))({
|
|
336
|
-
topics: /*#__PURE__*/Schema.Array(GuardrailTopic)
|
|
337
|
-
}) {}
|
|
338
|
-
/**
|
|
339
|
-
* @since 1.0.0
|
|
340
|
-
* @category Schemas
|
|
341
|
-
*/
|
|
342
|
-
export class GuardrailCustomWord extends /*#__PURE__*/Schema.Class(makeIdentifier("GuardrailCustomWord"))({
|
|
343
|
-
action: /*#__PURE__*/Schema.Literal("BLOCKED", "NONE"),
|
|
344
|
-
match: Schema.String,
|
|
345
|
-
detected: /*#__PURE__*/Schema.optional(Schema.Boolean)
|
|
346
|
-
}) {}
|
|
347
|
-
/**
|
|
348
|
-
* @since 1.0.0
|
|
349
|
-
* @category Schemas
|
|
350
|
-
*/
|
|
351
|
-
export class GuardrailManagedWord extends /*#__PURE__*/Schema.Class(makeIdentifier("GuardrailManagedWord"))({
|
|
352
|
-
action: /*#__PURE__*/Schema.Literal("BLOCKED", "NONE"),
|
|
353
|
-
match: Schema.String,
|
|
354
|
-
type: /*#__PURE__*/Schema.Literal("PROFANITY"),
|
|
355
|
-
detected: /*#__PURE__*/Schema.optional(Schema.Boolean)
|
|
356
|
-
}) {}
|
|
357
|
-
/**
|
|
358
|
-
* @since 1.0.0
|
|
359
|
-
* @category Schemas
|
|
360
|
-
*/
|
|
361
|
-
export class GuardrailWordPolicyAssessment extends /*#__PURE__*/Schema.Class(makeIdentifier("GuardrailWordPolicyAssessment"))({
|
|
362
|
-
customWords: GuardrailCustomWord,
|
|
363
|
-
managedWordLists: GuardrailManagedWord
|
|
364
|
-
}) {}
|
|
365
|
-
/**
|
|
366
|
-
* @since 1.0.0
|
|
367
|
-
* @category Schemas
|
|
368
|
-
*/
|
|
369
|
-
export class GuardrailAssessment extends /*#__PURE__*/Schema.Class(makeIdentifier("GuardrailAssessment"))({
|
|
370
|
-
contentPolicy: /*#__PURE__*/Schema.optional(GuardrailContentPolicyAssessment),
|
|
371
|
-
contextualGroundingPolicy: /*#__PURE__*/Schema.optional(GuardrailContextualGroundingPolicyAssessment),
|
|
372
|
-
invocationMetrics: /*#__PURE__*/Schema.optional(GuardrailInvocationMetrics),
|
|
373
|
-
sensitiveInformationPolicy: /*#__PURE__*/Schema.optional(GuardrailSensitiveInformationPolicyAssessment),
|
|
374
|
-
topicPolicy: /*#__PURE__*/Schema.optional(GuardrailTopicPolicyAssessment),
|
|
375
|
-
wordPolicy: /*#__PURE__*/Schema.optional(GuardrailWordPolicyAssessment)
|
|
376
|
-
}) {}
|
|
377
|
-
/**
|
|
378
|
-
* @since 1.0.0
|
|
379
|
-
* @category Schemas
|
|
380
|
-
*/
|
|
381
|
-
export class GuardrailTraceAssessment extends /*#__PURE__*/Schema.Class(makeIdentifier("GuardrailTraceAssessment"))({
|
|
382
|
-
actionReason: /*#__PURE__*/Schema.optional(Schema.String),
|
|
383
|
-
inputAssessment: /*#__PURE__*/Schema.optional(/*#__PURE__*/Schema.Record({
|
|
384
|
-
key: Schema.String,
|
|
385
|
-
value: GuardrailAssessment
|
|
386
|
-
})),
|
|
387
|
-
modelOutput: /*#__PURE__*/Schema.optional(/*#__PURE__*/Schema.Array(Schema.String)),
|
|
388
|
-
outputAssessments: /*#__PURE__*/Schema.optional(/*#__PURE__*/Schema.Record({
|
|
389
|
-
key: Schema.String,
|
|
390
|
-
value: GuardrailAssessment
|
|
391
|
-
}))
|
|
392
|
-
}) {}
|
|
393
|
-
/**
|
|
394
|
-
* @since 1.0.0
|
|
395
|
-
* @category Schemas
|
|
396
|
-
*/
|
|
397
|
-
export class PromptRouterTrace extends /*#__PURE__*/Schema.Class(makeIdentifier("PromptRouterTrace"))({
|
|
398
|
-
invokedModelId: /*#__PURE__*/Schema.String.pipe(/*#__PURE__*/Schema.pattern(/^(arn:aws(-[^:]+)?:bedrock:[a-z0-9-]{1,20}::foundation-model\/[a-z0-9-]{1,63}[.]{1}[a-z0-9-]{1,63}([a-z0-9-]{1,63}[.]){0,2}[a-z0-9-]{1,63}([:][a-z0-9-]{1,63}){0,2})|(arn:aws(|-us-gov|-cn|-iso|-iso-b):bedrock:(|[0-9a-z-]{1,20}):(|[0-9]{12}):inference-profile\/[a-zA-Z0-9-:.]+)$/), Schema.optional)
|
|
399
|
-
}) {}
|
|
400
|
-
/**
|
|
401
|
-
* @since 1.0.0
|
|
402
|
-
* @category Schemas
|
|
403
|
-
*/
|
|
404
|
-
export class ConverseTrace extends /*#__PURE__*/Schema.Class(makeIdentifier("ConverseTrace"))({
|
|
405
|
-
guardrail: /*#__PURE__*/Schema.optional(GuardrailTraceAssessment),
|
|
406
|
-
promptRouter: /*#__PURE__*/Schema.optional(PromptRouterTrace)
|
|
407
|
-
}) {}
|
|
408
|
-
/**
|
|
409
|
-
* @since 1.0.0
|
|
410
|
-
* @category Schemas
|
|
411
|
-
*/
|
|
412
|
-
export const IntZeroOrGreater = /*#__PURE__*/Schema.Int.pipe(/*#__PURE__*/Schema.greaterThanOrEqualTo(0));
|
|
413
|
-
/**
|
|
414
|
-
* @since 1.0.0
|
|
415
|
-
* @category Schemas
|
|
416
|
-
*/
|
|
417
|
-
export class TokenUsage extends /*#__PURE__*/Schema.Class(makeIdentifier("TokenUsage"))({
|
|
418
|
-
inputTokens: IntZeroOrGreater,
|
|
419
|
-
outputTokens: IntZeroOrGreater,
|
|
420
|
-
totalTokens: IntZeroOrGreater,
|
|
421
|
-
cacheReadInputTokens: /*#__PURE__*/Schema.optional(IntZeroOrGreater),
|
|
422
|
-
cacheWriteInputTokens: /*#__PURE__*/Schema.optional(IntZeroOrGreater)
|
|
423
|
-
}) {}
|
|
424
|
-
/**
|
|
425
|
-
* @since 1.0.0
|
|
426
|
-
* @category Schemas
|
|
427
|
-
*/
|
|
428
|
-
export class SystemContentBlock extends /*#__PURE__*/Schema.Union(/*#__PURE__*/Schema.Struct({
|
|
429
|
-
cachePoint: CachePointBlock
|
|
430
|
-
}), /*#__PURE__*/Schema.Struct({
|
|
431
|
-
guardContent: GuardrailConverseContentBlock
|
|
432
|
-
}), /*#__PURE__*/Schema.Struct({
|
|
433
|
-
text: /*#__PURE__*/Schema.String.pipe(/*#__PURE__*/Schema.minLength(1))
|
|
434
|
-
})) {}
|
|
435
|
-
/**
|
|
436
|
-
* @since 1.0.0
|
|
437
|
-
* @category Schemas
|
|
438
|
-
*/
|
|
439
|
-
export class GuardrailConfiguration extends /*#__PURE__*/Schema.Class(makeIdentifier("GuardrailConfiguration"))({
|
|
440
|
-
guardrailIdentifier: /*#__PURE__*/Schema.String.pipe(/*#__PURE__*/Schema.minLength(0), /*#__PURE__*/Schema.maxLength(2048), /*#__PURE__*/Schema.pattern(/^(([a-z0-9]+)|(arn:aws(-[^:]+)?:bedrock:[a-z0-9-]{1,20}:[0-9]{12}:guardrail\/[a-z0-9]+))$/)),
|
|
441
|
-
guardrailVersion: /*#__PURE__*/Schema.String.pipe(/*#__PURE__*/Schema.pattern(/^(([1-9][0-9]{0,7})|(DRAFT))$/)),
|
|
442
|
-
trace: /*#__PURE__*/Schema.optional(/*#__PURE__*/Schema.Literal("enabled", "disabled", "enabled_full"))
|
|
443
|
-
}) {}
|
|
444
|
-
/**
|
|
445
|
-
* @since 1.0.0
|
|
446
|
-
* @category Schemas
|
|
447
|
-
*/
|
|
448
|
-
export class InferenceConfiguration extends /*#__PURE__*/Schema.Class(makeIdentifier("InferenceConfiguration"))({
|
|
449
|
-
maxTokens: /*#__PURE__*/Schema.optional(/*#__PURE__*/Schema.Int.pipe(/*#__PURE__*/Schema.greaterThanOrEqualTo(1))),
|
|
450
|
-
stopSequences: /*#__PURE__*/Schema.optional(/*#__PURE__*/Schema.Array(Schema.String.pipe(Schema.minLength(1))).pipe(/*#__PURE__*/Schema.maxItems(4))),
|
|
451
|
-
temperature: /*#__PURE__*/Schema.optional(/*#__PURE__*/Schema.Number.pipe(/*#__PURE__*/Schema.between(0, 1))),
|
|
452
|
-
topP: /*#__PURE__*/Schema.optional(/*#__PURE__*/Schema.Number.pipe(/*#__PURE__*/Schema.between(0, 1)))
|
|
453
|
-
}) {}
|
|
454
|
-
/**
|
|
455
|
-
* @since 1.0.0
|
|
456
|
-
* @category Schemas
|
|
457
|
-
*/
|
|
458
|
-
export class PerformanceConfiguration extends /*#__PURE__*/Schema.Class(makeIdentifier("PerformanceConfiguration"))({
|
|
459
|
-
latency: /*#__PURE__*/Schema.optional(/*#__PURE__*/Schema.Literal("standard", "optimized"))
|
|
460
|
-
}) {}
|
|
461
|
-
/**
|
|
462
|
-
* @since 1.0.0
|
|
463
|
-
* @category Schemas
|
|
464
|
-
*/
|
|
465
|
-
export class ToolSpecification extends /*#__PURE__*/Schema.Class(makeIdentifier("ToolSpecification"))({
|
|
466
|
-
name: /*#__PURE__*/Schema.String.pipe(/*#__PURE__*/Schema.minLength(1), /*#__PURE__*/Schema.maxLength(64), /*#__PURE__*/Schema.pattern(/^[a-zA-Z0-9_-]+$/)),
|
|
467
|
-
inputSchema: /*#__PURE__*/Schema.Struct({
|
|
468
|
-
json: /*#__PURE__*/Schema.Record({
|
|
469
|
-
key: Schema.String,
|
|
470
|
-
value: Schema.Unknown
|
|
471
|
-
})
|
|
472
|
-
}),
|
|
473
|
-
description: /*#__PURE__*/Schema.optional(/*#__PURE__*/Schema.String.pipe(/*#__PURE__*/Schema.minLength(1)))
|
|
474
|
-
}) {}
|
|
475
|
-
/**
|
|
476
|
-
* @since 1.0.0
|
|
477
|
-
* @category Schemas
|
|
478
|
-
*/
|
|
479
|
-
export class Tool extends /*#__PURE__*/Schema.Class(makeIdentifier("Tool"))({
|
|
480
|
-
cachePoint: /*#__PURE__*/Schema.optional(CachePointBlock),
|
|
481
|
-
toolSpec: /*#__PURE__*/Schema.optional(ToolSpecification)
|
|
482
|
-
}) {}
|
|
483
|
-
/**
|
|
484
|
-
* @since 1.0.0
|
|
485
|
-
* @category Schemas
|
|
486
|
-
*/
|
|
487
|
-
export class ToolChoice extends /*#__PURE__*/Schema.Union(/*#__PURE__*/Schema.Struct({
|
|
488
|
-
any: /*#__PURE__*/Schema.Struct({})
|
|
489
|
-
}), /*#__PURE__*/Schema.Struct({
|
|
490
|
-
auto: /*#__PURE__*/Schema.Struct({})
|
|
491
|
-
}), /*#__PURE__*/Schema.Struct({
|
|
492
|
-
tool: /*#__PURE__*/Schema.Struct({
|
|
493
|
-
name: /*#__PURE__*/Schema.String.pipe(/*#__PURE__*/Schema.minLength(1), /*#__PURE__*/Schema.maxLength(64), /*#__PURE__*/Schema.pattern(/^[a-zA-Z0-9_-]+$/))
|
|
494
|
-
})
|
|
495
|
-
})) {}
|
|
496
|
-
/**
|
|
497
|
-
* @since 1.0.0
|
|
498
|
-
* @category Schemas
|
|
499
|
-
*/
|
|
500
|
-
export class ToolConfiguration extends /*#__PURE__*/Schema.Class(makeIdentifier("ToolConfiguration"))({
|
|
501
|
-
tools: /*#__PURE__*/Schema.Array(Tool).pipe(/*#__PURE__*/Schema.minItems(1)),
|
|
502
|
-
toolChoice: /*#__PURE__*/Schema.optional(ToolChoice)
|
|
503
|
-
}) {}
|
|
504
|
-
/**
|
|
505
|
-
* @since 1.0.0
|
|
506
|
-
* @category Schemas
|
|
507
|
-
*/
|
|
508
|
-
export class ConverseRequest extends /*#__PURE__*/Schema.Class(makeIdentifier("ConverseRequest"))({
|
|
509
|
-
modelId: Schema.String,
|
|
510
|
-
messages: /*#__PURE__*/Schema.Array(Message),
|
|
511
|
-
system: /*#__PURE__*/Schema.optional(/*#__PURE__*/Schema.Array(SystemContentBlock)),
|
|
512
|
-
toolConfig: /*#__PURE__*/Schema.optional(ToolConfiguration),
|
|
513
|
-
guardrailConfig: /*#__PURE__*/Schema.optional(GuardrailConfiguration),
|
|
514
|
-
inferenceConfig: /*#__PURE__*/Schema.optional(InferenceConfiguration),
|
|
515
|
-
performanceConfig: /*#__PURE__*/Schema.optional(PerformanceConfiguration),
|
|
516
|
-
promptVariables: /*#__PURE__*/Schema.optional(/*#__PURE__*/Schema.Record({
|
|
517
|
-
key: Schema.String,
|
|
518
|
-
value: /*#__PURE__*/Schema.Struct({
|
|
519
|
-
text: Schema.String
|
|
520
|
-
})
|
|
521
|
-
})),
|
|
522
|
-
requestMetadata: /*#__PURE__*/Schema.optional(/*#__PURE__*/Schema.Record({
|
|
523
|
-
key: /*#__PURE__*/Schema.String.pipe(/*#__PURE__*/Schema.minLength(1), /*#__PURE__*/Schema.maxLength(256), /*#__PURE__*/Schema.pattern(/^[a-zA-Z0-9\s:_@$#=/+,-.]{1,256}$/)),
|
|
524
|
-
value: /*#__PURE__*/Schema.String.pipe(/*#__PURE__*/Schema.minLength(0), /*#__PURE__*/Schema.maxLength(256), /*#__PURE__*/Schema.pattern(/^[a-zA-Z0-9\s:_@$#=/+,-.]{0,256}$/))
|
|
525
|
-
})),
|
|
526
|
-
additionalModelRequestFields: /*#__PURE__*/Schema.optional(/*#__PURE__*/Schema.Record({
|
|
527
|
-
key: Schema.String,
|
|
528
|
-
value: Schema.Unknown
|
|
529
|
-
})),
|
|
530
|
-
additionalModelResponseFieldPaths: /*#__PURE__*/Schema.optional(/*#__PURE__*/Schema.Array(Schema.String.pipe(Schema.minLength(1), Schema.maxLength(256))).pipe(/*#__PURE__*/Schema.maxItems(10)))
|
|
531
|
-
}) {}
|
|
532
|
-
/**
|
|
533
|
-
* @since 1.0.0
|
|
534
|
-
* @category Schemas
|
|
535
|
-
*/
|
|
536
|
-
export class ConverseResponse extends /*#__PURE__*/Schema.Class(makeIdentifier("ConverseResponse"))({
|
|
537
|
-
output: ConverseOutput,
|
|
538
|
-
metrics: ConverseMetrics,
|
|
539
|
-
usage: TokenUsage,
|
|
540
|
-
stopReason: /*#__PURE__*/Schema.Literal("content_filtered", "end_turn", "tool_use", "max_tokens", "stop_sequence", "guardrail_intervened"),
|
|
541
|
-
trace: /*#__PURE__*/Schema.optional(ConverseTrace),
|
|
542
|
-
performanceConfig: /*#__PURE__*/Schema.optional(/*#__PURE__*/Schema.Struct({
|
|
543
|
-
latency: /*#__PURE__*/Schema.Literal("standard", "optimized")
|
|
544
|
-
})),
|
|
545
|
-
additionalModelResponseFields: /*#__PURE__*/Schema.optional(/*#__PURE__*/Schema.Record({
|
|
546
|
-
key: Schema.String,
|
|
547
|
-
value: Schema.Unknown
|
|
548
|
-
}))
|
|
549
|
-
}) {}
|
|
550
|
-
/**
|
|
551
|
-
* @since 1.0.0
|
|
552
|
-
* @category Schemas
|
|
553
|
-
*/
|
|
554
|
-
export class ReasoningContentBlockDelta extends /*#__PURE__*/Schema.Union(/*#__PURE__*/Schema.Struct({
|
|
555
|
-
redactedContent: Schema.String
|
|
556
|
-
}), /*#__PURE__*/Schema.Struct({
|
|
557
|
-
signature: Schema.String
|
|
558
|
-
}), /*#__PURE__*/Schema.Struct({
|
|
559
|
-
text: Schema.String
|
|
560
|
-
})) {}
|
|
561
|
-
/**
|
|
562
|
-
* @since 1.0.0
|
|
563
|
-
* @category Schemas
|
|
564
|
-
*/
|
|
565
|
-
export class ToolUseBlockStart extends /*#__PURE__*/Schema.Class(makeIdentifier("ToolUseBlockStart"))({
|
|
566
|
-
name: /*#__PURE__*/Schema.String.pipe(/*#__PURE__*/Schema.minLength(1), /*#__PURE__*/Schema.maxLength(64), /*#__PURE__*/Schema.pattern(/^[a-zA-Z0-9_-]+$/)),
|
|
567
|
-
toolUseId: /*#__PURE__*/Schema.String.pipe(/*#__PURE__*/Schema.minLength(1), /*#__PURE__*/Schema.maxLength(64), /*#__PURE__*/Schema.pattern(/^[a-zA-Z0-9_-]+$/))
|
|
568
|
-
}) {}
|
|
569
|
-
/**
|
|
570
|
-
* @since 1.0.0
|
|
571
|
-
* @category Schemas
|
|
572
|
-
*/
|
|
573
|
-
export class ContentBlockStart extends /*#__PURE__*/Schema.Class(makeIdentifier("ContentBlockStart"))({
|
|
574
|
-
toolUse: /*#__PURE__*/Schema.optional(ToolUseBlockStart)
|
|
575
|
-
}) {}
|
|
576
|
-
/**
|
|
577
|
-
* @since 1.0.0
|
|
578
|
-
* @category Schemas
|
|
579
|
-
*/
|
|
580
|
-
export class ContentBlockStartEvent extends /*#__PURE__*/Schema.Class(makeIdentifier("ContentBlockStartEvent"))({
|
|
581
|
-
contentBlockIndex: /*#__PURE__*/Schema.Int.pipe(/*#__PURE__*/Schema.greaterThanOrEqualTo(0)),
|
|
582
|
-
start: ContentBlockStart
|
|
583
|
-
}) {}
|
|
584
|
-
/**
|
|
585
|
-
* @since 1.0.0
|
|
586
|
-
* @category Schemas
|
|
587
|
-
*/
|
|
588
|
-
export class ContentBlockStopEvent extends /*#__PURE__*/Schema.Class(makeIdentifier("ContentBlockStopEvent"))({
|
|
589
|
-
contentBlockIndex: /*#__PURE__*/Schema.Int.pipe(/*#__PURE__*/Schema.greaterThanOrEqualTo(0))
|
|
590
|
-
}) {}
|
|
591
|
-
/**
|
|
592
|
-
* @since 1.0.0
|
|
593
|
-
* @category Schemas
|
|
594
|
-
*/
|
|
595
|
-
export class ToolUseBlockDelta extends /*#__PURE__*/Schema.Class(makeIdentifier("ToolUseBlockDelta"))({
|
|
596
|
-
input: Schema.String
|
|
597
|
-
}) {}
|
|
598
|
-
/**
|
|
599
|
-
* @since 1.0.0
|
|
600
|
-
* @category Schemas
|
|
601
|
-
*/
|
|
602
|
-
export class ContentBlockDelta extends /*#__PURE__*/Schema.Union(/*#__PURE__*/Schema.Struct({
|
|
603
|
-
reasoningContent: ReasoningContentBlockDelta
|
|
604
|
-
}).pipe(/*#__PURE__*/Schema.attachPropertySignature("type", "reasoningContent")), /*#__PURE__*/Schema.Struct({
|
|
605
|
-
text: Schema.String
|
|
606
|
-
}).pipe(/*#__PURE__*/Schema.attachPropertySignature("type", "text")), /*#__PURE__*/Schema.Struct({
|
|
607
|
-
toolUse: ToolUseBlockDelta
|
|
608
|
-
}).pipe(/*#__PURE__*/Schema.attachPropertySignature("type", "toolUse"))) {}
|
|
609
|
-
/**
|
|
610
|
-
* @since 1.0.0
|
|
611
|
-
* @category Schemas
|
|
612
|
-
*/
|
|
613
|
-
export class ContentBlockDeltaEvent extends /*#__PURE__*/Schema.Class(makeIdentifier("ContentBlockDeltaEvent"))({
|
|
614
|
-
contentBlockIndex: /*#__PURE__*/Schema.Int.pipe(/*#__PURE__*/Schema.greaterThanOrEqualTo(0)),
|
|
615
|
-
delta: ContentBlockDelta
|
|
616
|
-
}) {}
|
|
617
|
-
/**
|
|
618
|
-
* @since 1.0.0
|
|
619
|
-
* @category Schemas
|
|
620
|
-
*/
|
|
621
|
-
export class MessageStartEvent extends /*#__PURE__*/Schema.Class(makeIdentifier("MessageStartEvent"))({
|
|
622
|
-
role: /*#__PURE__*/Schema.Literal("user", "assistant")
|
|
623
|
-
}) {}
|
|
624
|
-
/**
|
|
625
|
-
* @since 1.0.0
|
|
626
|
-
* @category Schemas
|
|
627
|
-
*/
|
|
628
|
-
export const StopReason = /*#__PURE__*/Schema.Literal("end_turn", "tool_use", "max_tokens", "stop_sequence", "guardrail_intervened", "content_filtered");
|
|
629
|
-
/**
|
|
630
|
-
* @since 1.0.0
|
|
631
|
-
* @category Schemas
|
|
632
|
-
*/
|
|
633
|
-
export class MessageStopEvent extends /*#__PURE__*/Schema.Class(makeIdentifier("MessageStopEvent"))({
|
|
634
|
-
stopReason: StopReason,
|
|
635
|
-
additionalModelResponseFields: /*#__PURE__*/Schema.optional(/*#__PURE__*/Schema.Record({
|
|
636
|
-
key: Schema.String,
|
|
637
|
-
value: Schema.Unknown
|
|
638
|
-
}))
|
|
639
|
-
}) {}
|
|
640
|
-
/**
|
|
641
|
-
* @since 1.0.0
|
|
642
|
-
* @category Schemas
|
|
643
|
-
*/
|
|
644
|
-
export class ConverseStreamMetrics extends /*#__PURE__*/Schema.Class(makeIdentifier("ConverseStreamMetrics"))({
|
|
645
|
-
latencyMs: Schema.DurationFromMillis
|
|
646
|
-
}) {}
|
|
647
|
-
/**
|
|
648
|
-
* @since 1.0.0
|
|
649
|
-
* @category Schemas
|
|
650
|
-
*/
|
|
651
|
-
export class ConverseStreamTrace extends /*#__PURE__*/Schema.Class(makeIdentifier("ConverseStreamTrace"))({
|
|
652
|
-
guardrail: /*#__PURE__*/Schema.optional(GuardrailTraceAssessment),
|
|
653
|
-
promptRouter: /*#__PURE__*/Schema.optional(PromptRouterTrace)
|
|
654
|
-
}) {}
|
|
655
|
-
/**
|
|
656
|
-
* @since 1.0.0
|
|
657
|
-
* @category Schemas
|
|
658
|
-
*/
|
|
659
|
-
export class ConverseStreamMetadataEvent extends /*#__PURE__*/Schema.Class(makeIdentifier("ConverseStreamMetadataEvent"))({
|
|
660
|
-
metrics: ConverseStreamMetrics,
|
|
661
|
-
usage: TokenUsage,
|
|
662
|
-
performanceConfig: /*#__PURE__*/Schema.optional(PerformanceConfiguration),
|
|
663
|
-
trace: /*#__PURE__*/Schema.optional(ConverseStreamTrace)
|
|
664
|
-
}) {}
|
|
665
|
-
/**
|
|
666
|
-
* @since 1.0.0
|
|
667
|
-
* @category Schemas
|
|
668
|
-
*/
|
|
669
|
-
export const ConverseResponseStreamEvent = /*#__PURE__*/Schema.Union(Schema.Struct({
|
|
670
|
-
messageStart: MessageStartEvent
|
|
671
|
-
}).pipe(Schema.attachPropertySignature("type", "messageStart"), Schema.annotations({
|
|
672
|
-
identifier: "MessageStartEvent"
|
|
673
|
-
})), Schema.Struct({
|
|
674
|
-
messageStop: MessageStopEvent
|
|
675
|
-
}).pipe(Schema.attachPropertySignature("type", "messageStop"), Schema.annotations({
|
|
676
|
-
identifier: "MessageStopEvent"
|
|
677
|
-
})), Schema.Struct({
|
|
678
|
-
contentBlockStart: ContentBlockStartEvent
|
|
679
|
-
}).pipe(Schema.attachPropertySignature("type", "contentBlockStart"), Schema.annotations({
|
|
680
|
-
identifier: "ContentBlockStartEvent"
|
|
681
|
-
})), Schema.Struct({
|
|
682
|
-
contentBlockDelta: ContentBlockDeltaEvent
|
|
683
|
-
}).pipe(Schema.attachPropertySignature("type", "contentBlockDelta"), Schema.annotations({
|
|
684
|
-
identifier: "ContentBlockDeltaEvent"
|
|
685
|
-
})), Schema.Struct({
|
|
686
|
-
contentBlockStop: ContentBlockStopEvent
|
|
687
|
-
}).pipe(Schema.attachPropertySignature("type", "contentBlockStop"), Schema.annotations({
|
|
688
|
-
identifier: "ContentBlockDeltaEvent"
|
|
689
|
-
})), Schema.Struct({
|
|
690
|
-
metadata: ConverseStreamMetadataEvent
|
|
691
|
-
}).pipe(Schema.attachPropertySignature("type", "metadata"), Schema.annotations({
|
|
692
|
-
identifier: "ConverseStreamMetadataEvent"
|
|
693
|
-
})), Schema.Struct({
|
|
694
|
-
internalServerException: Schema.Record({
|
|
695
|
-
key: Schema.String,
|
|
696
|
-
value: Schema.Unknown
|
|
697
|
-
})
|
|
698
|
-
}).pipe(Schema.attachPropertySignature("type", "internalServerException"), Schema.annotations({
|
|
699
|
-
identifier: "InternalServerException"
|
|
700
|
-
})), Schema.Struct({
|
|
701
|
-
modelStreamErrorException: Schema.Record({
|
|
702
|
-
key: Schema.String,
|
|
703
|
-
value: Schema.Unknown
|
|
704
|
-
})
|
|
705
|
-
}).pipe(Schema.attachPropertySignature("type", "modelStreamErrorException"), Schema.annotations({
|
|
706
|
-
identifier: "ModelStreamErrorException"
|
|
707
|
-
})), Schema.Struct({
|
|
708
|
-
serviceUnavailableException: Schema.Record({
|
|
709
|
-
key: Schema.String,
|
|
710
|
-
value: Schema.Unknown
|
|
711
|
-
})
|
|
712
|
-
}).pipe(Schema.attachPropertySignature("type", "serviceUnavailableException"), Schema.annotations({
|
|
713
|
-
identifier: "ServiceUnavailableException"
|
|
714
|
-
})), Schema.Struct({
|
|
715
|
-
throttlingException: Schema.Record({
|
|
716
|
-
key: Schema.String,
|
|
717
|
-
value: Schema.Unknown
|
|
718
|
-
})
|
|
719
|
-
}).pipe(Schema.attachPropertySignature("type", "throttlingException"), Schema.annotations({
|
|
720
|
-
identifier: "ThrottlingException"
|
|
721
|
-
})), Schema.Struct({
|
|
722
|
-
validationException: Schema.Record({
|
|
723
|
-
key: Schema.String,
|
|
724
|
-
value: Schema.Unknown
|
|
725
|
-
})
|
|
726
|
-
}).pipe(Schema.attachPropertySignature("type", "validationException"), Schema.annotations({
|
|
727
|
-
identifier: "ValidationException"
|
|
728
|
-
}))).pipe(Schema.asSchema).annotations({
|
|
729
|
-
identifier: "ConverseResponseStreamEvent"
|
|
730
|
-
});
|
|
731
|
-
//# sourceMappingURL=AmazonBedrockSchema.js.map
|