@effect/ai-amazon-bedrock 0.1.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/AmazonBedrockClient/package.json +6 -0
- package/AmazonBedrockConfig/package.json +6 -0
- package/AmazonBedrockLanguageModel/package.json +6 -0
- package/AmazonBedrockSchema/package.json +6 -0
- package/EventStreamEncoding/package.json +6 -0
- package/LICENSE +21 -0
- package/README.md +5 -0
- package/dist/cjs/AmazonBedrockClient.js +255 -0
- package/dist/cjs/AmazonBedrockClient.js.map +1 -0
- package/dist/cjs/AmazonBedrockConfig.js +30 -0
- package/dist/cjs/AmazonBedrockConfig.js.map +1 -0
- package/dist/cjs/AmazonBedrockLanguageModel.js +507 -0
- package/dist/cjs/AmazonBedrockLanguageModel.js.map +1 -0
- package/dist/cjs/AmazonBedrockSchema.js +745 -0
- package/dist/cjs/AmazonBedrockSchema.js.map +1 -0
- package/dist/cjs/EventStreamEncoding.js +85 -0
- package/dist/cjs/EventStreamEncoding.js.map +1 -0
- package/dist/cjs/index.js +18 -0
- package/dist/cjs/index.js.map +1 -0
- package/dist/cjs/internal/utilities.js +25 -0
- package/dist/cjs/internal/utilities.js.map +1 -0
- package/dist/dts/AmazonBedrockClient.d.ts +95 -0
- package/dist/dts/AmazonBedrockClient.d.ts.map +1 -0
- package/dist/dts/AmazonBedrockConfig.d.ts +47 -0
- package/dist/dts/AmazonBedrockConfig.d.ts.map +1 -0
- package/dist/dts/AmazonBedrockLanguageModel.d.ts +95 -0
- package/dist/dts/AmazonBedrockLanguageModel.d.ts.map +1 -0
- package/dist/dts/AmazonBedrockSchema.d.ts +1434 -0
- package/dist/dts/AmazonBedrockSchema.d.ts.map +1 -0
- package/dist/dts/EventStreamEncoding.d.ts +16 -0
- package/dist/dts/EventStreamEncoding.d.ts.map +1 -0
- package/dist/dts/index.d.ts +21 -0
- package/dist/dts/index.d.ts.map +1 -0
- package/dist/dts/internal/utilities.d.ts +2 -0
- package/dist/dts/internal/utilities.d.ts.map +1 -0
- package/dist/esm/AmazonBedrockClient.js +242 -0
- package/dist/esm/AmazonBedrockClient.js.map +1 -0
- package/dist/esm/AmazonBedrockConfig.js +22 -0
- package/dist/esm/AmazonBedrockConfig.js.map +1 -0
- package/dist/esm/AmazonBedrockLanguageModel.js +495 -0
- package/dist/esm/AmazonBedrockLanguageModel.js.map +1 -0
- package/dist/esm/AmazonBedrockSchema.js +675 -0
- package/dist/esm/AmazonBedrockSchema.js.map +1 -0
- package/dist/esm/EventStreamEncoding.js +76 -0
- package/dist/esm/EventStreamEncoding.js.map +1 -0
- package/dist/esm/index.js +21 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/internal/utilities.js +17 -0
- package/dist/esm/internal/utilities.js.map +1 -0
- package/dist/esm/package.json +4 -0
- package/index/package.json +6 -0
- package/package.json +91 -0
- package/src/AmazonBedrockClient.ts +409 -0
- package/src/AmazonBedrockConfig.ts +78 -0
- package/src/AmazonBedrockLanguageModel.ts +623 -0
- package/src/AmazonBedrockSchema.ts +1038 -0
- package/src/EventStreamEncoding.ts +111 -0
- package/src/index.ts +24 -0
- package/src/internal/utilities.ts +21 -0
|
@@ -0,0 +1,745 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.VideoBlock = exports.ToolUseBlockStart = exports.ToolUseBlockDelta = exports.ToolUseBlock = exports.ToolSpecification = exports.ToolResultBlock = exports.ToolConfiguration = exports.ToolChoice = exports.Tool = exports.TokenUsage = exports.SystemContentBlock = exports.StopReason = exports.ReasoningContentBlockDelta = exports.ReasoningContentBlock = exports.PromptRouterTrace = exports.PerformanceConfiguration = exports.MessageStopEvent = exports.MessageStartEvent = exports.Message = exports.JsonBlock = exports.IntZeroOrGreater = exports.InferenceConfiguration = exports.ImageFormat = exports.ImageBlock = exports.GuardrailWordPolicyAssessment = exports.GuardrailUsage = exports.GuardrailTraceAssessment = exports.GuardrailTopicPolicyAssessment = exports.GuardrailTopic = exports.GuardrailTextCharactersCoverage = exports.GuardrailSensitiveInformationPolicyAssessment = exports.GuardrailRegexFilter = exports.GuardrailPiiEntityFilter = exports.GuardrailManagedWord = exports.GuardrailInvocationMetrics = exports.GuardrailImageCoverage = exports.GuardrailCustomWord = exports.GuardrailCoverage = exports.GuardrailConverseTextBlock = exports.GuardrailConverseImageBlock = exports.GuardrailConverseContentBlock = exports.GuardrailContextualGroundingPolicyAssessment = exports.GuardrailContextualGroundingFilter = exports.GuardrailContentPolicyAssessment = exports.GuardrailContentFilter = exports.GuardrailConfiguration = exports.GuardrailAssessment = exports.DocumentFormat = exports.DocumentBlock = exports.ConverseTrace = exports.ConverseStreamTrace = exports.ConverseStreamResponse = exports.ConverseStreamMetrics = exports.ConverseStreamMetadataEvent = exports.ConverseResponse = exports.ConverseRequest = exports.ConverseOutput = exports.ConverseMetrics = exports.ContentBlockStopEvent = exports.ContentBlockStartEvent = exports.ContentBlockStart = exports.ContentBlockDeltaEvent = exports.ContentBlockDelta = exports.ContentBlock = exports.CachePointBlock = exports.BedrockFoundationModelId = void 0;
|
|
7
|
+
var Schema = _interopRequireWildcard(require("effect/Schema"));
|
|
8
|
+
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
9
|
+
/**
|
|
10
|
+
* @since 1.0.0
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
const prefix = "@effect/ai-amazon-bedrock";
|
|
14
|
+
const makeIdentifier = name => `${prefix}/${name}`;
|
|
15
|
+
/**
|
|
16
|
+
* The foundation models supported by Amazon Bedrock.
|
|
17
|
+
*
|
|
18
|
+
* An up-to-date list can be generated with the following command:
|
|
19
|
+
*
|
|
20
|
+
* ```sh
|
|
21
|
+
* aws bedrock list-foundation-models --output json | jq '[.modelSummaries[].modelId]'
|
|
22
|
+
* ```
|
|
23
|
+
*
|
|
24
|
+
* @since 1.0.0
|
|
25
|
+
* @category Schemas
|
|
26
|
+
*/
|
|
27
|
+
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") {}
|
|
28
|
+
/**
|
|
29
|
+
* @since 1.0.0
|
|
30
|
+
* @category Schemas
|
|
31
|
+
*/
|
|
32
|
+
exports.BedrockFoundationModelId = BedrockFoundationModelId;
|
|
33
|
+
class CachePointBlock extends /*#__PURE__*/Schema.Class(makeIdentifier("CachePointBlock"))({
|
|
34
|
+
type: /*#__PURE__*/Schema.Literal("default")
|
|
35
|
+
}) {}
|
|
36
|
+
/**
|
|
37
|
+
* @since 1.0.0
|
|
38
|
+
* @category Schemas
|
|
39
|
+
*/
|
|
40
|
+
exports.CachePointBlock = CachePointBlock;
|
|
41
|
+
const DocumentFormat = exports.DocumentFormat = /*#__PURE__*/Schema.Literal("csv", "doc", "docx", "html", "md", "pdf", "txt", "xls", "xlsx");
|
|
42
|
+
/**
|
|
43
|
+
* @since 1.0.0
|
|
44
|
+
* @category Schemas
|
|
45
|
+
*/
|
|
46
|
+
class DocumentBlock extends /*#__PURE__*/Schema.Class(makeIdentifier("DocumentBlock"))({
|
|
47
|
+
name: /*#__PURE__*/Schema.String.pipe(/*#__PURE__*/Schema.pattern(/^[a-zA-Z0-9()[\]-]+(?: [a-zA-Z0-9()[\]-]+)*$/), /*#__PURE__*/Schema.minLength(1), /*#__PURE__*/Schema.maxLength(200)),
|
|
48
|
+
format: DocumentFormat,
|
|
49
|
+
source: /*#__PURE__*/Schema.Struct({
|
|
50
|
+
bytes: Schema.NonEmptyString
|
|
51
|
+
})
|
|
52
|
+
}) {}
|
|
53
|
+
/**
|
|
54
|
+
* @since 1.0.0
|
|
55
|
+
* @category Schemas
|
|
56
|
+
*/
|
|
57
|
+
exports.DocumentBlock = DocumentBlock;
|
|
58
|
+
class GuardrailConverseImageBlock extends /*#__PURE__*/Schema.Class(makeIdentifier("GuardrailConverseImageBlock"))({
|
|
59
|
+
format: /*#__PURE__*/Schema.Literal("png", "jpg"),
|
|
60
|
+
source: /*#__PURE__*/Schema.Struct({
|
|
61
|
+
bytes: Schema.NonEmptyString
|
|
62
|
+
})
|
|
63
|
+
}) {}
|
|
64
|
+
/**
|
|
65
|
+
* @since 1.0.0
|
|
66
|
+
* @category Schemas
|
|
67
|
+
*/
|
|
68
|
+
exports.GuardrailConverseImageBlock = GuardrailConverseImageBlock;
|
|
69
|
+
class GuardrailConverseTextBlock extends /*#__PURE__*/Schema.Class(makeIdentifier("GuardrailConverseTextBlock"))({
|
|
70
|
+
text: Schema.String,
|
|
71
|
+
qualifiers: /*#__PURE__*/Schema.optional(/*#__PURE__*/Schema.Array(/*#__PURE__*/Schema.Literal("guard_content", "grounding_source", "query")))
|
|
72
|
+
}) {}
|
|
73
|
+
/**
|
|
74
|
+
* @since 1.0.0
|
|
75
|
+
* @category Schemas
|
|
76
|
+
*/
|
|
77
|
+
exports.GuardrailConverseTextBlock = GuardrailConverseTextBlock;
|
|
78
|
+
class GuardrailConverseContentBlock extends /*#__PURE__*/Schema.Union(GuardrailConverseImageBlock, GuardrailConverseTextBlock) {}
|
|
79
|
+
/**
|
|
80
|
+
* @since 1.0.0
|
|
81
|
+
* @category Schemas
|
|
82
|
+
*/
|
|
83
|
+
exports.GuardrailConverseContentBlock = GuardrailConverseContentBlock;
|
|
84
|
+
const ImageFormat = exports.ImageFormat = /*#__PURE__*/Schema.Literal("gif", "jpeg", "png", "webp");
|
|
85
|
+
/**
|
|
86
|
+
* @since 1.0.0
|
|
87
|
+
* @category Schemas
|
|
88
|
+
*/
|
|
89
|
+
class ImageBlock extends /*#__PURE__*/Schema.Class(makeIdentifier("ImageBlock"))({
|
|
90
|
+
format: ImageFormat,
|
|
91
|
+
source: /*#__PURE__*/Schema.Struct({
|
|
92
|
+
bytes: Schema.NonEmptyString
|
|
93
|
+
})
|
|
94
|
+
}) {}
|
|
95
|
+
/**
|
|
96
|
+
* @since 1.0.0
|
|
97
|
+
* @category Schemas
|
|
98
|
+
*/
|
|
99
|
+
exports.ImageBlock = ImageBlock;
|
|
100
|
+
class JsonBlock extends /*#__PURE__*/Schema.Class(makeIdentifier("JsonBlock"))({
|
|
101
|
+
json: Schema.Unknown
|
|
102
|
+
}) {}
|
|
103
|
+
/**
|
|
104
|
+
* @since 1.0.0
|
|
105
|
+
* @category Schemas
|
|
106
|
+
*/
|
|
107
|
+
exports.JsonBlock = JsonBlock;
|
|
108
|
+
class ReasoningContentBlock extends /*#__PURE__*/Schema.Union(/*#__PURE__*/Schema.Struct({
|
|
109
|
+
reasoningText: /*#__PURE__*/Schema.Struct({
|
|
110
|
+
text: Schema.String,
|
|
111
|
+
signature: /*#__PURE__*/Schema.optional(Schema.String)
|
|
112
|
+
})
|
|
113
|
+
}), /*#__PURE__*/Schema.Struct({
|
|
114
|
+
redactedContent: Schema.Uint8ArrayFromBase64
|
|
115
|
+
})) {}
|
|
116
|
+
/**
|
|
117
|
+
* @since 1.0.0
|
|
118
|
+
* @category Schemas
|
|
119
|
+
*/
|
|
120
|
+
exports.ReasoningContentBlock = ReasoningContentBlock;
|
|
121
|
+
class VideoBlock extends /*#__PURE__*/Schema.Class(makeIdentifier("VideoBlock"))({
|
|
122
|
+
format: /*#__PURE__*/Schema.Literal("flv", "mkv", "mov", "mp4", "mpg", "mpeg", "three_gp", "webm"),
|
|
123
|
+
source: /*#__PURE__*/Schema.Union(/*#__PURE__*/Schema.Struct({
|
|
124
|
+
bytes: Schema.NonEmptyString
|
|
125
|
+
}), /*#__PURE__*/Schema.Struct({
|
|
126
|
+
s3Location: /*#__PURE__*/Schema.Struct({
|
|
127
|
+
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)),
|
|
128
|
+
bucketOwner: /*#__PURE__*/Schema.String.pipe(/*#__PURE__*/Schema.pattern(/^[0-9]{12}$/), Schema.optional)
|
|
129
|
+
})
|
|
130
|
+
}))
|
|
131
|
+
}) {}
|
|
132
|
+
/**
|
|
133
|
+
* @since 1.0.0
|
|
134
|
+
* @category Schemas
|
|
135
|
+
*/
|
|
136
|
+
exports.VideoBlock = VideoBlock;
|
|
137
|
+
class ToolResultBlock extends /*#__PURE__*/Schema.Class(makeIdentifier("ToolResultBlock"))({
|
|
138
|
+
content: /*#__PURE__*/Schema.Array(/*#__PURE__*/Schema.Union(/*#__PURE__*/Schema.Struct({
|
|
139
|
+
document: DocumentBlock
|
|
140
|
+
}), /*#__PURE__*/Schema.Struct({
|
|
141
|
+
image: ImageBlock
|
|
142
|
+
}), /*#__PURE__*/Schema.Struct({
|
|
143
|
+
text: Schema.String
|
|
144
|
+
}), /*#__PURE__*/Schema.Struct({
|
|
145
|
+
json: JsonBlock
|
|
146
|
+
}), /*#__PURE__*/Schema.Struct({
|
|
147
|
+
video: VideoBlock
|
|
148
|
+
}))),
|
|
149
|
+
toolUseId: /*#__PURE__*/Schema.String.pipe(/*#__PURE__*/Schema.pattern(/^[a-zA-Z0-9_-]+$/), /*#__PURE__*/Schema.minLength(1), /*#__PURE__*/Schema.maxLength(64)),
|
|
150
|
+
status: /*#__PURE__*/Schema.optional(/*#__PURE__*/Schema.Literal("success", "error"))
|
|
151
|
+
}) {}
|
|
152
|
+
/**
|
|
153
|
+
* @since 1.0.0
|
|
154
|
+
* @category Schemas
|
|
155
|
+
*/
|
|
156
|
+
exports.ToolResultBlock = ToolResultBlock;
|
|
157
|
+
class ToolUseBlock extends /*#__PURE__*/Schema.Class(makeIdentifier("ToolUseBlock"))({
|
|
158
|
+
name: /*#__PURE__*/Schema.String.pipe(/*#__PURE__*/Schema.pattern(/^[a-zA-Z0-9_-]+$/), /*#__PURE__*/Schema.minLength(1), /*#__PURE__*/Schema.maxLength(64)),
|
|
159
|
+
input: Schema.Unknown,
|
|
160
|
+
toolUseId: /*#__PURE__*/Schema.String.pipe(/*#__PURE__*/Schema.pattern(/^[a-zA-Z0-9_-]+$/), /*#__PURE__*/Schema.minLength(1), /*#__PURE__*/Schema.maxLength(64))
|
|
161
|
+
}) {}
|
|
162
|
+
/**
|
|
163
|
+
* @since 1.0.0
|
|
164
|
+
* @category Schemas
|
|
165
|
+
*/
|
|
166
|
+
exports.ToolUseBlock = ToolUseBlock;
|
|
167
|
+
class ContentBlock extends /*#__PURE__*/Schema.Union(/*#__PURE__*/Schema.Struct({
|
|
168
|
+
cachePoint: CachePointBlock
|
|
169
|
+
}), /*#__PURE__*/Schema.Struct({
|
|
170
|
+
document: DocumentBlock
|
|
171
|
+
}), /*#__PURE__*/Schema.Struct({
|
|
172
|
+
guardContent: GuardrailConverseContentBlock
|
|
173
|
+
}), /*#__PURE__*/Schema.Struct({
|
|
174
|
+
image: ImageBlock
|
|
175
|
+
}), /*#__PURE__*/Schema.Struct({
|
|
176
|
+
reasoningContent: ReasoningContentBlock
|
|
177
|
+
}), /*#__PURE__*/Schema.Struct({
|
|
178
|
+
text: Schema.String
|
|
179
|
+
}), /*#__PURE__*/Schema.Struct({
|
|
180
|
+
toolResult: ToolResultBlock
|
|
181
|
+
}), /*#__PURE__*/Schema.Struct({
|
|
182
|
+
toolUse: ToolUseBlock
|
|
183
|
+
}), /*#__PURE__*/Schema.Struct({
|
|
184
|
+
video: VideoBlock
|
|
185
|
+
})) {}
|
|
186
|
+
/**
|
|
187
|
+
* @since 1.0.0
|
|
188
|
+
* @category Schemas
|
|
189
|
+
*/
|
|
190
|
+
exports.ContentBlock = ContentBlock;
|
|
191
|
+
class Message extends /*#__PURE__*/Schema.Class(makeIdentifier("Message"))({
|
|
192
|
+
role: /*#__PURE__*/Schema.Literal("user", "assistant"),
|
|
193
|
+
content: /*#__PURE__*/Schema.Array(ContentBlock)
|
|
194
|
+
}) {}
|
|
195
|
+
/**
|
|
196
|
+
* @since 1.0.0
|
|
197
|
+
* @category Schemas
|
|
198
|
+
*/
|
|
199
|
+
exports.Message = Message;
|
|
200
|
+
class ConverseOutput extends /*#__PURE__*/Schema.Class(makeIdentifier("ConverseOutput"))({
|
|
201
|
+
message: Message
|
|
202
|
+
}) {}
|
|
203
|
+
/**
|
|
204
|
+
* @since 1.0.0
|
|
205
|
+
* @category Schemas
|
|
206
|
+
*/
|
|
207
|
+
exports.ConverseOutput = ConverseOutput;
|
|
208
|
+
class ConverseMetrics extends /*#__PURE__*/Schema.Class(makeIdentifier("ConverseMetrics"))({
|
|
209
|
+
latencyMs: Schema.DurationFromMillis
|
|
210
|
+
}) {}
|
|
211
|
+
/**
|
|
212
|
+
* @since 1.0.0
|
|
213
|
+
* @category Schemas
|
|
214
|
+
*/
|
|
215
|
+
exports.ConverseMetrics = ConverseMetrics;
|
|
216
|
+
class GuardrailContentFilter extends /*#__PURE__*/Schema.Class(makeIdentifier("GuardrailContentFilter"))({
|
|
217
|
+
type: /*#__PURE__*/Schema.Literal("HATE", "INSULTS", "MISCONDUCT", "PROMPT_ATTACK", "SEXUAL", "VIOLENCE"),
|
|
218
|
+
action: /*#__PURE__*/Schema.Literal("BLOCKED", "NONE"),
|
|
219
|
+
confidence: /*#__PURE__*/Schema.Literal("NONE", "LOW", "MEDIUM", "HIGH"),
|
|
220
|
+
detected: /*#__PURE__*/Schema.optional(Schema.Boolean),
|
|
221
|
+
filterStrength: /*#__PURE__*/Schema.optional(/*#__PURE__*/Schema.Literal("NONE", "LOW", "MEDIUM", "HIGH"))
|
|
222
|
+
}) {}
|
|
223
|
+
/**
|
|
224
|
+
* @since 1.0.0
|
|
225
|
+
* @category Schemas
|
|
226
|
+
*/
|
|
227
|
+
exports.GuardrailContentFilter = GuardrailContentFilter;
|
|
228
|
+
class GuardrailContentPolicyAssessment extends /*#__PURE__*/Schema.Class(makeIdentifier("GuardrailContentPolicyAssessment"))({
|
|
229
|
+
filters: /*#__PURE__*/Schema.Array(GuardrailContentFilter)
|
|
230
|
+
}) {}
|
|
231
|
+
/**
|
|
232
|
+
* @since 1.0.0
|
|
233
|
+
* @category Schemas
|
|
234
|
+
*/
|
|
235
|
+
exports.GuardrailContentPolicyAssessment = GuardrailContentPolicyAssessment;
|
|
236
|
+
class GuardrailContextualGroundingFilter extends /*#__PURE__*/Schema.Class(makeIdentifier("GuardrailContextualGroundingFilter"))({
|
|
237
|
+
type: /*#__PURE__*/Schema.Literal("GROUNDING", "RELEVANCE"),
|
|
238
|
+
action: /*#__PURE__*/Schema.Literal("BLOCKED", "NONE"),
|
|
239
|
+
score: /*#__PURE__*/Schema.Number.pipe(/*#__PURE__*/Schema.between(0, 1)),
|
|
240
|
+
threshold: /*#__PURE__*/Schema.Number.pipe(/*#__PURE__*/Schema.between(0, 1)),
|
|
241
|
+
detected: /*#__PURE__*/Schema.optional(Schema.Boolean)
|
|
242
|
+
}) {}
|
|
243
|
+
/**
|
|
244
|
+
* @since 1.0.0
|
|
245
|
+
* @category Schemas
|
|
246
|
+
*/
|
|
247
|
+
exports.GuardrailContextualGroundingFilter = GuardrailContextualGroundingFilter;
|
|
248
|
+
class GuardrailContextualGroundingPolicyAssessment extends /*#__PURE__*/Schema.Class(makeIdentifier("GuardrailContextualGroundingPolicyAssessment"))({
|
|
249
|
+
filters: /*#__PURE__*/Schema.optional(/*#__PURE__*/Schema.Array(GuardrailContextualGroundingFilter))
|
|
250
|
+
}) {}
|
|
251
|
+
/**
|
|
252
|
+
* @since 1.0.0
|
|
253
|
+
* @category Schemas
|
|
254
|
+
*/
|
|
255
|
+
exports.GuardrailContextualGroundingPolicyAssessment = GuardrailContextualGroundingPolicyAssessment;
|
|
256
|
+
class GuardrailImageCoverage extends /*#__PURE__*/Schema.Class(makeIdentifier("GuardrailImageCoverage"))({
|
|
257
|
+
guarded: /*#__PURE__*/Schema.optional(Schema.Int),
|
|
258
|
+
total: /*#__PURE__*/Schema.optional(Schema.Int)
|
|
259
|
+
}) {}
|
|
260
|
+
/**
|
|
261
|
+
* @since 1.0.0
|
|
262
|
+
* @category Schemas
|
|
263
|
+
*/
|
|
264
|
+
exports.GuardrailImageCoverage = GuardrailImageCoverage;
|
|
265
|
+
class GuardrailTextCharactersCoverage extends /*#__PURE__*/Schema.Class(makeIdentifier("GuardrailTextCharactersCoverage"))({
|
|
266
|
+
guarded: /*#__PURE__*/Schema.optional(Schema.Int),
|
|
267
|
+
total: /*#__PURE__*/Schema.optional(Schema.Int)
|
|
268
|
+
}) {}
|
|
269
|
+
/**
|
|
270
|
+
* @since 1.0.0
|
|
271
|
+
* @category Schemas
|
|
272
|
+
*/
|
|
273
|
+
exports.GuardrailTextCharactersCoverage = GuardrailTextCharactersCoverage;
|
|
274
|
+
class GuardrailCoverage extends /*#__PURE__*/Schema.Class(makeIdentifier("GuardrailCoverage"))({
|
|
275
|
+
images: /*#__PURE__*/Schema.optional(GuardrailImageCoverage),
|
|
276
|
+
textCharacters: /*#__PURE__*/Schema.optional(GuardrailTextCharactersCoverage)
|
|
277
|
+
}) {}
|
|
278
|
+
/**
|
|
279
|
+
* @since 1.0.0
|
|
280
|
+
* @category Schemas
|
|
281
|
+
*/
|
|
282
|
+
exports.GuardrailCoverage = GuardrailCoverage;
|
|
283
|
+
class GuardrailUsage extends /*#__PURE__*/Schema.Class(makeIdentifier("GuardrailUsage"))({
|
|
284
|
+
contentPolicyUnits: Schema.Int,
|
|
285
|
+
contextualGroundingPolicyUnits: Schema.Int,
|
|
286
|
+
sensitiveInformationPolicyFreeUnits: Schema.Int,
|
|
287
|
+
sensitiveInformationPolicyUnits: Schema.Int,
|
|
288
|
+
topicPolicyUnits: Schema.Int,
|
|
289
|
+
wordPolicyUnits: Schema.Int,
|
|
290
|
+
contentPolicyImageUnits: /*#__PURE__*/Schema.optional(Schema.Int)
|
|
291
|
+
}) {}
|
|
292
|
+
/**
|
|
293
|
+
* @since 1.0.0
|
|
294
|
+
* @category Schemas
|
|
295
|
+
*/
|
|
296
|
+
exports.GuardrailUsage = GuardrailUsage;
|
|
297
|
+
class GuardrailInvocationMetrics extends /*#__PURE__*/Schema.Class(makeIdentifier("GuardrailInvocationMetrics"))({
|
|
298
|
+
guardrailCoverage: /*#__PURE__*/Schema.optional(GuardrailCoverage),
|
|
299
|
+
guardrailProcessingLatency: /*#__PURE__*/Schema.optional(Schema.Number),
|
|
300
|
+
usage: /*#__PURE__*/Schema.optional(GuardrailUsage)
|
|
301
|
+
}) {}
|
|
302
|
+
/**
|
|
303
|
+
* @since 1.0.0
|
|
304
|
+
* @category Schemas
|
|
305
|
+
*/
|
|
306
|
+
exports.GuardrailInvocationMetrics = GuardrailInvocationMetrics;
|
|
307
|
+
class GuardrailPiiEntityFilter extends /*#__PURE__*/Schema.Class(makeIdentifier("GuardrailPiiEntityFilter"))({
|
|
308
|
+
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"),
|
|
309
|
+
action: /*#__PURE__*/Schema.Literal("ANONYMIZED", "BLOCKED", "NONE"),
|
|
310
|
+
match: Schema.String,
|
|
311
|
+
detected: /*#__PURE__*/Schema.optional(Schema.Boolean)
|
|
312
|
+
}) {}
|
|
313
|
+
/**
|
|
314
|
+
* @since 1.0.0
|
|
315
|
+
* @category Schemas
|
|
316
|
+
*/
|
|
317
|
+
exports.GuardrailPiiEntityFilter = GuardrailPiiEntityFilter;
|
|
318
|
+
class GuardrailRegexFilter extends /*#__PURE__*/Schema.Class(makeIdentifier("GuardrailRegexFilter"))({
|
|
319
|
+
action: /*#__PURE__*/Schema.Literal("ANONYMIZED", "BLOCKED", "NONE"),
|
|
320
|
+
name: /*#__PURE__*/Schema.optional(Schema.String),
|
|
321
|
+
match: /*#__PURE__*/Schema.optional(Schema.String),
|
|
322
|
+
regex: /*#__PURE__*/Schema.optional(Schema.String),
|
|
323
|
+
detected: /*#__PURE__*/Schema.optional(Schema.Boolean)
|
|
324
|
+
}) {}
|
|
325
|
+
/**
|
|
326
|
+
* @since 1.0.0
|
|
327
|
+
* @category Schemas
|
|
328
|
+
*/
|
|
329
|
+
exports.GuardrailRegexFilter = GuardrailRegexFilter;
|
|
330
|
+
class GuardrailSensitiveInformationPolicyAssessment extends /*#__PURE__*/Schema.Class(makeIdentifier("GuardrailSensitiveInformationPolicyAssessment"))({
|
|
331
|
+
piiEntities: /*#__PURE__*/Schema.Array(GuardrailPiiEntityFilter),
|
|
332
|
+
regexes: /*#__PURE__*/Schema.Array(GuardrailRegexFilter)
|
|
333
|
+
}) {}
|
|
334
|
+
/**
|
|
335
|
+
* @since 1.0.0
|
|
336
|
+
* @category Schemas
|
|
337
|
+
*/
|
|
338
|
+
exports.GuardrailSensitiveInformationPolicyAssessment = GuardrailSensitiveInformationPolicyAssessment;
|
|
339
|
+
class GuardrailTopic extends /*#__PURE__*/Schema.Class(makeIdentifier("GuardrailTopic"))({
|
|
340
|
+
action: /*#__PURE__*/Schema.Literal("BLOCKED", "NONE"),
|
|
341
|
+
name: Schema.String,
|
|
342
|
+
type: /*#__PURE__*/Schema.Literal("DENY"),
|
|
343
|
+
detected: /*#__PURE__*/Schema.optional(Schema.Boolean)
|
|
344
|
+
}) {}
|
|
345
|
+
/**
|
|
346
|
+
* @since 1.0.0
|
|
347
|
+
* @category Schemas
|
|
348
|
+
*/
|
|
349
|
+
exports.GuardrailTopic = GuardrailTopic;
|
|
350
|
+
class GuardrailTopicPolicyAssessment extends /*#__PURE__*/Schema.Class(makeIdentifier("GuardrailTopicPolicyAssessment"))({
|
|
351
|
+
topics: /*#__PURE__*/Schema.Array(GuardrailTopic)
|
|
352
|
+
}) {}
|
|
353
|
+
/**
|
|
354
|
+
* @since 1.0.0
|
|
355
|
+
* @category Schemas
|
|
356
|
+
*/
|
|
357
|
+
exports.GuardrailTopicPolicyAssessment = GuardrailTopicPolicyAssessment;
|
|
358
|
+
class GuardrailCustomWord extends /*#__PURE__*/Schema.Class(makeIdentifier("GuardrailCustomWord"))({
|
|
359
|
+
action: /*#__PURE__*/Schema.Literal("BLOCKED", "NONE"),
|
|
360
|
+
match: Schema.String,
|
|
361
|
+
detected: /*#__PURE__*/Schema.optional(Schema.Boolean)
|
|
362
|
+
}) {}
|
|
363
|
+
/**
|
|
364
|
+
* @since 1.0.0
|
|
365
|
+
* @category Schemas
|
|
366
|
+
*/
|
|
367
|
+
exports.GuardrailCustomWord = GuardrailCustomWord;
|
|
368
|
+
class GuardrailManagedWord extends /*#__PURE__*/Schema.Class(makeIdentifier("GuardrailManagedWord"))({
|
|
369
|
+
action: /*#__PURE__*/Schema.Literal("BLOCKED", "NONE"),
|
|
370
|
+
match: Schema.String,
|
|
371
|
+
type: /*#__PURE__*/Schema.Literal("PROFANITY"),
|
|
372
|
+
detected: /*#__PURE__*/Schema.optional(Schema.Boolean)
|
|
373
|
+
}) {}
|
|
374
|
+
/**
|
|
375
|
+
* @since 1.0.0
|
|
376
|
+
* @category Schemas
|
|
377
|
+
*/
|
|
378
|
+
exports.GuardrailManagedWord = GuardrailManagedWord;
|
|
379
|
+
class GuardrailWordPolicyAssessment extends /*#__PURE__*/Schema.Class(makeIdentifier("GuardrailWordPolicyAssessment"))({
|
|
380
|
+
customWords: GuardrailCustomWord,
|
|
381
|
+
managedWordLists: GuardrailManagedWord
|
|
382
|
+
}) {}
|
|
383
|
+
/**
|
|
384
|
+
* @since 1.0.0
|
|
385
|
+
* @category Schemas
|
|
386
|
+
*/
|
|
387
|
+
exports.GuardrailWordPolicyAssessment = GuardrailWordPolicyAssessment;
|
|
388
|
+
class GuardrailAssessment extends /*#__PURE__*/Schema.Class(makeIdentifier("GuardrailAssessment"))({
|
|
389
|
+
contentPolicy: /*#__PURE__*/Schema.optional(GuardrailContentPolicyAssessment),
|
|
390
|
+
contextualGroundingPolicy: /*#__PURE__*/Schema.optional(GuardrailContextualGroundingPolicyAssessment),
|
|
391
|
+
invocationMetrics: /*#__PURE__*/Schema.optional(GuardrailInvocationMetrics),
|
|
392
|
+
sensitiveInformationPolicy: /*#__PURE__*/Schema.optional(GuardrailSensitiveInformationPolicyAssessment),
|
|
393
|
+
topicPolicy: /*#__PURE__*/Schema.optional(GuardrailTopicPolicyAssessment),
|
|
394
|
+
wordPolicy: /*#__PURE__*/Schema.optional(GuardrailWordPolicyAssessment)
|
|
395
|
+
}) {}
|
|
396
|
+
/**
|
|
397
|
+
* @since 1.0.0
|
|
398
|
+
* @category Schemas
|
|
399
|
+
*/
|
|
400
|
+
exports.GuardrailAssessment = GuardrailAssessment;
|
|
401
|
+
class GuardrailTraceAssessment extends /*#__PURE__*/Schema.Class(makeIdentifier("GuardrailTraceAssessment"))({
|
|
402
|
+
actionReason: /*#__PURE__*/Schema.optional(Schema.String),
|
|
403
|
+
inputAssessment: /*#__PURE__*/Schema.optional(/*#__PURE__*/Schema.Record({
|
|
404
|
+
key: Schema.String,
|
|
405
|
+
value: GuardrailAssessment
|
|
406
|
+
})),
|
|
407
|
+
modelOutput: /*#__PURE__*/Schema.optional(/*#__PURE__*/Schema.Array(Schema.String)),
|
|
408
|
+
outputAssessments: /*#__PURE__*/Schema.optional(/*#__PURE__*/Schema.Record({
|
|
409
|
+
key: Schema.String,
|
|
410
|
+
value: GuardrailAssessment
|
|
411
|
+
}))
|
|
412
|
+
}) {}
|
|
413
|
+
/**
|
|
414
|
+
* @since 1.0.0
|
|
415
|
+
* @category Schemas
|
|
416
|
+
*/
|
|
417
|
+
exports.GuardrailTraceAssessment = GuardrailTraceAssessment;
|
|
418
|
+
class PromptRouterTrace extends /*#__PURE__*/Schema.Class(makeIdentifier("PromptRouterTrace"))({
|
|
419
|
+
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)
|
|
420
|
+
}) {}
|
|
421
|
+
/**
|
|
422
|
+
* @since 1.0.0
|
|
423
|
+
* @category Schemas
|
|
424
|
+
*/
|
|
425
|
+
exports.PromptRouterTrace = PromptRouterTrace;
|
|
426
|
+
class ConverseTrace extends /*#__PURE__*/Schema.Class(makeIdentifier("ConverseTrace"))({
|
|
427
|
+
guardrail: /*#__PURE__*/Schema.optional(GuardrailTraceAssessment),
|
|
428
|
+
promptRouter: /*#__PURE__*/Schema.optional(PromptRouterTrace)
|
|
429
|
+
}) {}
|
|
430
|
+
/**
|
|
431
|
+
* @since 1.0.0
|
|
432
|
+
* @category Schemas
|
|
433
|
+
*/
|
|
434
|
+
exports.ConverseTrace = ConverseTrace;
|
|
435
|
+
const IntZeroOrGreater = exports.IntZeroOrGreater = /*#__PURE__*/Schema.Int.pipe(/*#__PURE__*/Schema.greaterThanOrEqualTo(0));
|
|
436
|
+
/**
|
|
437
|
+
* @since 1.0.0
|
|
438
|
+
* @category Schemas
|
|
439
|
+
*/
|
|
440
|
+
class TokenUsage extends /*#__PURE__*/Schema.Class(makeIdentifier("TokenUsage"))({
|
|
441
|
+
inputTokens: IntZeroOrGreater,
|
|
442
|
+
outputTokens: IntZeroOrGreater,
|
|
443
|
+
totalTokens: IntZeroOrGreater,
|
|
444
|
+
cacheReadInputTokens: /*#__PURE__*/Schema.optional(IntZeroOrGreater),
|
|
445
|
+
cacheWriteInputTokens: /*#__PURE__*/Schema.optional(IntZeroOrGreater)
|
|
446
|
+
}) {}
|
|
447
|
+
/**
|
|
448
|
+
* @since 1.0.0
|
|
449
|
+
* @category Schemas
|
|
450
|
+
*/
|
|
451
|
+
exports.TokenUsage = TokenUsage;
|
|
452
|
+
class SystemContentBlock extends /*#__PURE__*/Schema.Union(/*#__PURE__*/Schema.Struct({
|
|
453
|
+
cachePoint: CachePointBlock
|
|
454
|
+
}), /*#__PURE__*/Schema.Struct({
|
|
455
|
+
guardContent: GuardrailConverseContentBlock
|
|
456
|
+
}), /*#__PURE__*/Schema.Struct({
|
|
457
|
+
text: /*#__PURE__*/Schema.String.pipe(/*#__PURE__*/Schema.minLength(1))
|
|
458
|
+
})) {}
|
|
459
|
+
/**
|
|
460
|
+
* @since 1.0.0
|
|
461
|
+
* @category Schemas
|
|
462
|
+
*/
|
|
463
|
+
exports.SystemContentBlock = SystemContentBlock;
|
|
464
|
+
class GuardrailConfiguration extends /*#__PURE__*/Schema.Class(makeIdentifier("GuardrailConfiguration"))({
|
|
465
|
+
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]+))$/)),
|
|
466
|
+
guardrailVersion: /*#__PURE__*/Schema.String.pipe(/*#__PURE__*/Schema.pattern(/^(([1-9][0-9]{0,7})|(DRAFT))$/)),
|
|
467
|
+
trace: /*#__PURE__*/Schema.optional(/*#__PURE__*/Schema.Literal("enabled", "disabled", "enabled_full"))
|
|
468
|
+
}) {}
|
|
469
|
+
/**
|
|
470
|
+
* @since 1.0.0
|
|
471
|
+
* @category Schemas
|
|
472
|
+
*/
|
|
473
|
+
exports.GuardrailConfiguration = GuardrailConfiguration;
|
|
474
|
+
class InferenceConfiguration extends /*#__PURE__*/Schema.Class(makeIdentifier("InferenceConfiguration"))({
|
|
475
|
+
maxTokens: /*#__PURE__*/Schema.optional(/*#__PURE__*/Schema.Int.pipe(/*#__PURE__*/Schema.greaterThanOrEqualTo(1))),
|
|
476
|
+
stopSequences: /*#__PURE__*/Schema.optional(/*#__PURE__*/Schema.Array(Schema.String.pipe(Schema.minLength(1))).pipe(/*#__PURE__*/Schema.maxItems(4))),
|
|
477
|
+
temperature: /*#__PURE__*/Schema.Number.pipe(/*#__PURE__*/Schema.between(0, 1)),
|
|
478
|
+
topP: /*#__PURE__*/Schema.Number.pipe(/*#__PURE__*/Schema.between(0, 1))
|
|
479
|
+
}) {}
|
|
480
|
+
/**
|
|
481
|
+
* @since 1.0.0
|
|
482
|
+
* @category Schemas
|
|
483
|
+
*/
|
|
484
|
+
exports.InferenceConfiguration = InferenceConfiguration;
|
|
485
|
+
class PerformanceConfiguration extends /*#__PURE__*/Schema.Class(makeIdentifier("PerformanceConfiguration"))({
|
|
486
|
+
latency: /*#__PURE__*/Schema.optional(/*#__PURE__*/Schema.Literal("standard", "optimized"))
|
|
487
|
+
}) {}
|
|
488
|
+
/**
|
|
489
|
+
* @since 1.0.0
|
|
490
|
+
* @category Schemas
|
|
491
|
+
*/
|
|
492
|
+
exports.PerformanceConfiguration = PerformanceConfiguration;
|
|
493
|
+
class ToolSpecification extends /*#__PURE__*/Schema.Class(makeIdentifier("ToolSpecification"))({
|
|
494
|
+
name: /*#__PURE__*/Schema.String.pipe(/*#__PURE__*/Schema.minLength(1), /*#__PURE__*/Schema.maxLength(64), /*#__PURE__*/Schema.pattern(/^[a-zA-Z0-9_-]+$/)),
|
|
495
|
+
inputSchema: /*#__PURE__*/Schema.Struct({
|
|
496
|
+
json: /*#__PURE__*/Schema.Record({
|
|
497
|
+
key: Schema.String,
|
|
498
|
+
value: Schema.Unknown
|
|
499
|
+
})
|
|
500
|
+
}),
|
|
501
|
+
description: /*#__PURE__*/Schema.optional(/*#__PURE__*/Schema.String.pipe(/*#__PURE__*/Schema.minLength(1)))
|
|
502
|
+
}) {}
|
|
503
|
+
/**
|
|
504
|
+
* @since 1.0.0
|
|
505
|
+
* @category Schemas
|
|
506
|
+
*/
|
|
507
|
+
exports.ToolSpecification = ToolSpecification;
|
|
508
|
+
class Tool extends /*#__PURE__*/Schema.Class(makeIdentifier("Tool"))({
|
|
509
|
+
cachePoint: /*#__PURE__*/Schema.optional(CachePointBlock),
|
|
510
|
+
toolSpec: /*#__PURE__*/Schema.optional(ToolSpecification)
|
|
511
|
+
}) {}
|
|
512
|
+
/**
|
|
513
|
+
* @since 1.0.0
|
|
514
|
+
* @category Schemas
|
|
515
|
+
*/
|
|
516
|
+
exports.Tool = Tool;
|
|
517
|
+
class ToolChoice extends /*#__PURE__*/Schema.Union(/*#__PURE__*/Schema.Struct({
|
|
518
|
+
any: /*#__PURE__*/Schema.Struct({})
|
|
519
|
+
}), /*#__PURE__*/Schema.Struct({
|
|
520
|
+
auto: /*#__PURE__*/Schema.Struct({})
|
|
521
|
+
}), /*#__PURE__*/Schema.Struct({
|
|
522
|
+
tool: /*#__PURE__*/Schema.Struct({
|
|
523
|
+
name: /*#__PURE__*/Schema.String.pipe(/*#__PURE__*/Schema.minLength(1), /*#__PURE__*/Schema.maxLength(64), /*#__PURE__*/Schema.pattern(/^[a-zA-Z0-9_-]+$/))
|
|
524
|
+
})
|
|
525
|
+
})) {}
|
|
526
|
+
/**
|
|
527
|
+
* @since 1.0.0
|
|
528
|
+
* @category Schemas
|
|
529
|
+
*/
|
|
530
|
+
exports.ToolChoice = ToolChoice;
|
|
531
|
+
class ToolConfiguration extends /*#__PURE__*/Schema.Class(makeIdentifier("ToolConfiguration"))({
|
|
532
|
+
tools: /*#__PURE__*/Schema.Array(Tool).pipe(/*#__PURE__*/Schema.minItems(1)),
|
|
533
|
+
toolChoice: /*#__PURE__*/Schema.optional(ToolChoice)
|
|
534
|
+
}) {}
|
|
535
|
+
/**
|
|
536
|
+
* @since 1.0.0
|
|
537
|
+
* @category Schemas
|
|
538
|
+
*/
|
|
539
|
+
exports.ToolConfiguration = ToolConfiguration;
|
|
540
|
+
class ConverseRequest extends /*#__PURE__*/Schema.Class(makeIdentifier("ConverseRequest"))({
|
|
541
|
+
modelId: Schema.String,
|
|
542
|
+
messages: /*#__PURE__*/Schema.Array(Message),
|
|
543
|
+
system: /*#__PURE__*/Schema.optional(/*#__PURE__*/Schema.Array(SystemContentBlock)),
|
|
544
|
+
toolConfig: /*#__PURE__*/Schema.optional(ToolConfiguration),
|
|
545
|
+
guardrailConfig: /*#__PURE__*/Schema.optional(GuardrailConfiguration),
|
|
546
|
+
inferenceConfig: /*#__PURE__*/Schema.optional(InferenceConfiguration),
|
|
547
|
+
performanceConfig: /*#__PURE__*/Schema.optional(PerformanceConfiguration),
|
|
548
|
+
promptVariables: /*#__PURE__*/Schema.optional(/*#__PURE__*/Schema.Record({
|
|
549
|
+
key: Schema.String,
|
|
550
|
+
value: /*#__PURE__*/Schema.Struct({
|
|
551
|
+
text: Schema.String
|
|
552
|
+
})
|
|
553
|
+
})),
|
|
554
|
+
requestMetadata: /*#__PURE__*/Schema.optional(/*#__PURE__*/Schema.Record({
|
|
555
|
+
key: /*#__PURE__*/Schema.String.pipe(/*#__PURE__*/Schema.minLength(1), /*#__PURE__*/Schema.maxLength(256), /*#__PURE__*/Schema.pattern(/^[a-zA-Z0-9\s:_@$#=/+,-.]{1,256}$/)),
|
|
556
|
+
value: /*#__PURE__*/Schema.String.pipe(/*#__PURE__*/Schema.minLength(0), /*#__PURE__*/Schema.maxLength(256), /*#__PURE__*/Schema.pattern(/^[a-zA-Z0-9\s:_@$#=/+,-.]{0,256}$/))
|
|
557
|
+
})),
|
|
558
|
+
additionalModelRequestFields: /*#__PURE__*/Schema.optional(/*#__PURE__*/Schema.Record({
|
|
559
|
+
key: Schema.String,
|
|
560
|
+
value: Schema.Unknown
|
|
561
|
+
})),
|
|
562
|
+
additionalModelResponseFieldPaths: /*#__PURE__*/Schema.optional(/*#__PURE__*/Schema.Array(Schema.String.pipe(Schema.minLength(1), Schema.maxLength(256))).pipe(/*#__PURE__*/Schema.maxItems(10)))
|
|
563
|
+
}) {}
|
|
564
|
+
/**
|
|
565
|
+
* @since 1.0.0
|
|
566
|
+
* @category Schemas
|
|
567
|
+
*/
|
|
568
|
+
exports.ConverseRequest = ConverseRequest;
|
|
569
|
+
class ConverseResponse extends /*#__PURE__*/Schema.Class(makeIdentifier("ConverseResponse"))({
|
|
570
|
+
output: ConverseOutput,
|
|
571
|
+
metrics: ConverseMetrics,
|
|
572
|
+
usage: TokenUsage,
|
|
573
|
+
stopReason: /*#__PURE__*/Schema.Literal("content_filtered", "end_turn", "tool_use", "max_tokens", "stop_sequence", "guardrail_intervened"),
|
|
574
|
+
trace: /*#__PURE__*/Schema.optional(ConverseTrace),
|
|
575
|
+
performanceConfig: /*#__PURE__*/Schema.optional(/*#__PURE__*/Schema.Struct({
|
|
576
|
+
latency: /*#__PURE__*/Schema.Literal("standard", "optimized")
|
|
577
|
+
})),
|
|
578
|
+
additionalModelResponseFields: /*#__PURE__*/Schema.optional(/*#__PURE__*/Schema.Record({
|
|
579
|
+
key: Schema.String,
|
|
580
|
+
value: Schema.Unknown
|
|
581
|
+
}))
|
|
582
|
+
}) {}
|
|
583
|
+
/**
|
|
584
|
+
* @since 1.0.0
|
|
585
|
+
* @category Schemas
|
|
586
|
+
*/
|
|
587
|
+
exports.ConverseResponse = ConverseResponse;
|
|
588
|
+
class ReasoningContentBlockDelta extends /*#__PURE__*/Schema.Union(/*#__PURE__*/Schema.Struct({
|
|
589
|
+
redactedContent: Schema.Uint8ArrayFromBase64
|
|
590
|
+
}), /*#__PURE__*/Schema.Struct({
|
|
591
|
+
signature: Schema.String
|
|
592
|
+
}), /*#__PURE__*/Schema.Struct({
|
|
593
|
+
text: Schema.String
|
|
594
|
+
})) {}
|
|
595
|
+
/**
|
|
596
|
+
* @since 1.0.0
|
|
597
|
+
* @category Schemas
|
|
598
|
+
*/
|
|
599
|
+
exports.ReasoningContentBlockDelta = ReasoningContentBlockDelta;
|
|
600
|
+
class ToolUseBlockStart extends /*#__PURE__*/Schema.Class(makeIdentifier("ToolUseBlockStart"))({
|
|
601
|
+
name: /*#__PURE__*/Schema.String.pipe(/*#__PURE__*/Schema.minLength(1), /*#__PURE__*/Schema.maxLength(64), /*#__PURE__*/Schema.pattern(/^[a-zA-Z0-9_-]+$/)),
|
|
602
|
+
toolUseId: /*#__PURE__*/Schema.String.pipe(/*#__PURE__*/Schema.minLength(1), /*#__PURE__*/Schema.maxLength(64), /*#__PURE__*/Schema.pattern(/^[a-zA-Z0-9_-]+$/))
|
|
603
|
+
}) {}
|
|
604
|
+
/**
|
|
605
|
+
* @since 1.0.0
|
|
606
|
+
* @category Schemas
|
|
607
|
+
*/
|
|
608
|
+
exports.ToolUseBlockStart = ToolUseBlockStart;
|
|
609
|
+
class ContentBlockStart extends /*#__PURE__*/Schema.Class(makeIdentifier("ContentBlockStart"))({
|
|
610
|
+
toolUse: ToolUseBlockStart
|
|
611
|
+
}) {}
|
|
612
|
+
/**
|
|
613
|
+
* @since 1.0.0
|
|
614
|
+
* @category Schemas
|
|
615
|
+
*/
|
|
616
|
+
exports.ContentBlockStart = ContentBlockStart;
|
|
617
|
+
class ContentBlockStartEvent extends /*#__PURE__*/Schema.Class(makeIdentifier("ContentBlockStartEvent"))({
|
|
618
|
+
contentBlockIndex: /*#__PURE__*/Schema.Int.pipe(/*#__PURE__*/Schema.greaterThanOrEqualTo(0)),
|
|
619
|
+
start: ContentBlockStart
|
|
620
|
+
}) {}
|
|
621
|
+
/**
|
|
622
|
+
* @since 1.0.0
|
|
623
|
+
* @category Schemas
|
|
624
|
+
*/
|
|
625
|
+
exports.ContentBlockStartEvent = ContentBlockStartEvent;
|
|
626
|
+
class ContentBlockStopEvent extends /*#__PURE__*/Schema.Class(makeIdentifier("ContentBlockStopEvent"))({
|
|
627
|
+
contentBlockIndex: /*#__PURE__*/Schema.Int.pipe(/*#__PURE__*/Schema.greaterThanOrEqualTo(0))
|
|
628
|
+
}) {}
|
|
629
|
+
/**
|
|
630
|
+
* @since 1.0.0
|
|
631
|
+
* @category Schemas
|
|
632
|
+
*/
|
|
633
|
+
exports.ContentBlockStopEvent = ContentBlockStopEvent;
|
|
634
|
+
class ToolUseBlockDelta extends /*#__PURE__*/Schema.Class(makeIdentifier("ToolUseBlockDelta"))({
|
|
635
|
+
input: Schema.String
|
|
636
|
+
}) {}
|
|
637
|
+
/**
|
|
638
|
+
* @since 1.0.0
|
|
639
|
+
* @category Schemas
|
|
640
|
+
*/
|
|
641
|
+
exports.ToolUseBlockDelta = ToolUseBlockDelta;
|
|
642
|
+
class ContentBlockDelta extends /*#__PURE__*/Schema.Union(/*#__PURE__*/Schema.Struct({
|
|
643
|
+
reasoningContent: ReasoningContentBlockDelta
|
|
644
|
+
}), /*#__PURE__*/Schema.Struct({
|
|
645
|
+
text: Schema.String
|
|
646
|
+
}), /*#__PURE__*/Schema.Struct({
|
|
647
|
+
toolUse: ToolUseBlockDelta
|
|
648
|
+
})) {}
|
|
649
|
+
/**
|
|
650
|
+
* @since 1.0.0
|
|
651
|
+
* @category Schemas
|
|
652
|
+
*/
|
|
653
|
+
exports.ContentBlockDelta = ContentBlockDelta;
|
|
654
|
+
class ContentBlockDeltaEvent extends /*#__PURE__*/Schema.Class(makeIdentifier("ContentBlockDeltaEvent"))({
|
|
655
|
+
contentBlockIndex: /*#__PURE__*/Schema.Int.pipe(/*#__PURE__*/Schema.greaterThanOrEqualTo(0)),
|
|
656
|
+
delta: ContentBlockDelta
|
|
657
|
+
}) {}
|
|
658
|
+
/**
|
|
659
|
+
* @since 1.0.0
|
|
660
|
+
* @category Schemas
|
|
661
|
+
*/
|
|
662
|
+
exports.ContentBlockDeltaEvent = ContentBlockDeltaEvent;
|
|
663
|
+
class MessageStartEvent extends /*#__PURE__*/Schema.Class(makeIdentifier("MessageStartEvent"))({
|
|
664
|
+
role: /*#__PURE__*/Schema.Literal("user", "assistant")
|
|
665
|
+
}) {}
|
|
666
|
+
/**
|
|
667
|
+
* @since 1.0.0
|
|
668
|
+
* @category Schemas
|
|
669
|
+
*/
|
|
670
|
+
exports.MessageStartEvent = MessageStartEvent;
|
|
671
|
+
const StopReason = exports.StopReason = /*#__PURE__*/Schema.Literal("end_turn", "tool_use", "max_tokens", "stop_sequence", "guardrail_intervened", "content_filtered");
|
|
672
|
+
/**
|
|
673
|
+
* @since 1.0.0
|
|
674
|
+
* @category Schemas
|
|
675
|
+
*/
|
|
676
|
+
class MessageStopEvent extends /*#__PURE__*/Schema.Class(makeIdentifier("MessageStopEvent"))({
|
|
677
|
+
stopReason: StopReason,
|
|
678
|
+
additionalModelResponseFields: /*#__PURE__*/Schema.optional(/*#__PURE__*/Schema.Record({
|
|
679
|
+
key: Schema.String,
|
|
680
|
+
value: Schema.Unknown
|
|
681
|
+
}))
|
|
682
|
+
}) {}
|
|
683
|
+
/**
|
|
684
|
+
* @since 1.0.0
|
|
685
|
+
* @category Schemas
|
|
686
|
+
*/
|
|
687
|
+
exports.MessageStopEvent = MessageStopEvent;
|
|
688
|
+
class ConverseStreamMetrics extends /*#__PURE__*/Schema.Class(makeIdentifier("ConverseStreamMetrics"))({
|
|
689
|
+
latencyMs: Schema.DurationFromMillis
|
|
690
|
+
}) {}
|
|
691
|
+
/**
|
|
692
|
+
* @since 1.0.0
|
|
693
|
+
* @category Schemas
|
|
694
|
+
*/
|
|
695
|
+
exports.ConverseStreamMetrics = ConverseStreamMetrics;
|
|
696
|
+
class ConverseStreamTrace extends /*#__PURE__*/Schema.Class(makeIdentifier("ConverseStreamTrace"))({
|
|
697
|
+
guardrail: /*#__PURE__*/Schema.optional(GuardrailTraceAssessment),
|
|
698
|
+
promptRouter: /*#__PURE__*/Schema.optional(PromptRouterTrace)
|
|
699
|
+
}) {}
|
|
700
|
+
/**
|
|
701
|
+
* @since 1.0.0
|
|
702
|
+
* @category Schemas
|
|
703
|
+
*/
|
|
704
|
+
exports.ConverseStreamTrace = ConverseStreamTrace;
|
|
705
|
+
class ConverseStreamMetadataEvent extends /*#__PURE__*/Schema.Class(makeIdentifier("ConverseStreamMetadataEvent"))({
|
|
706
|
+
metrics: ConverseStreamMetrics,
|
|
707
|
+
usage: TokenUsage,
|
|
708
|
+
performanceConfig: /*#__PURE__*/Schema.optional(PerformanceConfiguration),
|
|
709
|
+
trace: /*#__PURE__*/Schema.optional(ConverseStreamTrace)
|
|
710
|
+
}) {}
|
|
711
|
+
/**
|
|
712
|
+
* @since 1.0.0
|
|
713
|
+
* @category Schemas
|
|
714
|
+
*/
|
|
715
|
+
exports.ConverseStreamMetadataEvent = ConverseStreamMetadataEvent;
|
|
716
|
+
class ConverseStreamResponse extends /*#__PURE__*/Schema.Class(makeIdentifier("ConverseStreamResponse"))({
|
|
717
|
+
contentBlockStart: /*#__PURE__*/Schema.optional(ContentBlockStartEvent),
|
|
718
|
+
contentBlockStop: /*#__PURE__*/Schema.optional(ContentBlockStopEvent),
|
|
719
|
+
contentBlockDelta: /*#__PURE__*/Schema.optional(ContentBlockDeltaEvent),
|
|
720
|
+
messageStart: /*#__PURE__*/Schema.optional(MessageStartEvent),
|
|
721
|
+
messageStop: /*#__PURE__*/Schema.optional(MessageStopEvent),
|
|
722
|
+
metadata: /*#__PURE__*/Schema.optional(ConverseStreamMetadataEvent),
|
|
723
|
+
internalServerException: /*#__PURE__*/Schema.optional(/*#__PURE__*/Schema.Record({
|
|
724
|
+
key: Schema.String,
|
|
725
|
+
value: Schema.Unknown
|
|
726
|
+
})),
|
|
727
|
+
modelStreamErrorException: /*#__PURE__*/Schema.optional(/*#__PURE__*/Schema.Record({
|
|
728
|
+
key: Schema.String,
|
|
729
|
+
value: Schema.Unknown
|
|
730
|
+
})),
|
|
731
|
+
serviceUnavailableException: /*#__PURE__*/Schema.optional(/*#__PURE__*/Schema.Record({
|
|
732
|
+
key: Schema.String,
|
|
733
|
+
value: Schema.Unknown
|
|
734
|
+
})),
|
|
735
|
+
throttlingException: /*#__PURE__*/Schema.optional(/*#__PURE__*/Schema.Record({
|
|
736
|
+
key: Schema.String,
|
|
737
|
+
value: Schema.Unknown
|
|
738
|
+
})),
|
|
739
|
+
validationException: /*#__PURE__*/Schema.optional(/*#__PURE__*/Schema.Record({
|
|
740
|
+
key: Schema.String,
|
|
741
|
+
value: Schema.Unknown
|
|
742
|
+
}))
|
|
743
|
+
}) {}
|
|
744
|
+
exports.ConverseStreamResponse = ConverseStreamResponse;
|
|
745
|
+
//# sourceMappingURL=AmazonBedrockSchema.js.map
|