@wmaurer/effect-ai-amazon-bedrock 0.3.0 → 0.4.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/CHANGELOG.md CHANGED
@@ -1,5 +1,16 @@
1
1
  # @wmaurer/effect-ai-amazon-bedrock
2
2
 
3
+ ## 0.4.0
4
+
5
+ Amazon Bedrock guardrails are supported. Every finish part now carries `metadata.amazonBedrock`, also without a guardrail.
6
+
7
+ - Add `guardrailConfig` to the request config. `generateText` and `generateObject` send it to Converse without `streamProcessingMode`, which only ConverseStream has, and `streamText` sends it as given. An override replaces the whole object, and `guardrailConfig: undefined` turns a layer's guardrail off for one request.
8
+ - Put `metadata.amazonBedrock` on every finish part, on `generateText` and on `streamText`. `stopReason` is the Converse stop reason as Bedrock sent it, so `guardrail_intervened` and `content_filtered` can be told apart, though both still finish with `"content-filter"`. `guardrail` says whether a guardrail blocked or masked the input and the output, read from the trace, and `trace` is the trace as Bedrock sent it. Both are `null` unless the guardrail config enables the trace.
9
+ - Fail `generateObject` with an `AiError` whose reason is `ContentPolicyError` when a guardrail intervened and the response holds no JSON. In 0.3.0 the blocked message reached the JSON decoder, which failed with a retryable `StructuredOutputError`. A guardrail that the account or organization enforces can cause this without any `guardrailConfig` in the request.
10
+ - Add the `guardContent` option to user text parts, system messages, and user PNG and JPEG file parts. Once a part has it, the guardrail evaluates only the parts that have it. On text, `qualifiers` names the role of the text in a contextual grounding check. Any other part with the option fails with `InvalidUserInputError`.
11
+ - `AmazonBedrockClient.Service.converseStream` takes the new `ConverseStreamRequest`, and `Config` is derived from it. The new schemas `GuardrailConfiguration`, `GuardrailStreamConfiguration`, and `GuardrailConverseContentBlock` follow the Smithy shapes, and `ConverseResponse` and `ConverseStreamMetadataEvent` decode `trace`.
12
+ - Name the account data retention setting in the `InvalidRequestError` when Bedrock rejects a model with `data retention mode '<mode>' is not available for this model`. Claude Fable 5 and 5.1 need the mode `aws_review`, and the Converse API has no request field for it, so the AWS message alone did not say how to make the model callable. The README section "Choose a model" explains the setting.
13
+
3
14
  ## 0.3.0
4
15
 
5
16
  `generateObject` asks models outside Anthropic for the object through a tool. In 0.2.0 it sent them `outputConfig.textFormat`, which Nova, Mistral Large 2402, Pixtral Large, Llama, and Palmyra answered with a 400 in probes in `eu-west-1` and `us-east-1`, so `generateObject` on these models failed unless you set `structuredOutputs: false`.
package/README.md CHANGED
@@ -231,6 +231,8 @@ The other options are these:
231
231
 
232
232
  Give a Bedrock model ID or an inference profile ID as the first argument of `AmazonBedrockLanguageModel.model`, or as the `model` option of `AmazonBedrockLanguageModel.layer`. Some models accept only an inference profile ID. The live suites call Claude Sonnet 4.5 through `eu.anthropic.claude-sonnet-4-5-20250929-v1:0`, and their setup notes that Bedrock rejects its bare foundation-model ID. The model must be enabled for your account in the region of the client.
233
233
 
234
+ Claude Fable 5 and 5.1 also need the account's data retention mode in that region to be `aws_review`, or the older `provider_data_share`. Under that mode AWS keeps the prompts and outputs of these models for up to 30 days and may review them, and AWS's [data retention guide](https://docs.aws.amazon.com/bedrock/latest/userguide/data-retention.html) says it does not share them with Anthropic. The Converse API has no request field for the mode. You set it once for each region through the Bedrock control plane's `PutAccountDataRetention` operation, as that guide shows. Until then Bedrock rejects every request to these models with `data retention mode 'default' is not available for this model`, and the provider adds a pointer to the setting to the `InvalidRequestError`.
235
+
234
236
  To set request defaults, give them as the second argument of `model` or as the `config` option of `layer`. The defaults take these fields:
235
237
 
236
238
  - `inferenceConfig`, `additionalModelRequestFields`, and `toolConfig`. The provider sends each one as the Converse request field of the same name.
@@ -299,7 +301,7 @@ Probes on 2026-10-17 sent one Converse request per model and path through the `e
299
301
  - Llama 3.1, 3.3, and 4 and Palmyra X4 and X5 answered `any` with a 400. The unforced tool returned the object on Llama 3.1 8B, Llama 4 Scout, Llama 4 Maverick, and Palmyra X5, and a wrong object on Llama 3.1 70B and Llama 3.3 70B.
300
302
  - No path returned the object on Magistral Small. Llama 3 70B, Mistral 7B, Mixtral 8x7B, and DeepSeek R1 reject tool use and `outputConfig`, so `generateObject` does not work on them.
301
303
 
302
- A probe on the same day sent one request per path to 17 Claude inference profiles through the `eu-west-1` endpoint. Every profile that served the probe's requests, 12 of the 17, accepted `outputConfig.textFormat`: Claude Haiku 4.5 and 5.5, Opus 4.5, 4.6, 4.7, 4.8, 5, and 5.5, and Sonnet 4.5, 4.6, 5, and 5.5. On Opus 4.8, Opus 5.5, and Sonnet 5.5 it also accepted `outputConfig.textFormat` together with `effort`, with adaptive thinking, and next to a strict tool. Fable 5 and 5.1 rejected every request, with or without `outputConfig.textFormat`, with `data retention mode 'default' is not available for this model`, and the other three profiles have reached end of life.
304
+ A probe on the same day sent one request per path to 17 Claude inference profiles through the `eu-west-1` endpoint. Every profile that served the probe's requests, 12 of the 17, accepted `outputConfig.textFormat`: Claude Haiku 4.5 and 5.5, Opus 4.5, 4.6, 4.7, 4.8, 5, and 5.5, and Sonnet 4.5, 4.6, 5, and 5.5. On Opus 4.8, Opus 5.5, and Sonnet 5.5 it also accepted `outputConfig.textFormat` together with `effort`, with adaptive thinking, and next to a strict tool. Fable 5 and 5.1 rejected every request, with or without `outputConfig.textFormat`, with `data retention mode 'default' is not available for this model`, because the probe account's data retention mode was not `aws_review`. The other three profiles have reached end of life.
303
305
 
304
306
  The provider keeps a list of Claude models that get the forced tool instead: the Claude 3 models and Claude Sonnet 4 and Opus 4. The list comes from Anthropic's table of models with structured output. The probe could not check it on Bedrock. Claude 3 Haiku, Claude 3 Sonnet, and Sonnet 4 have reached end of life in `eu-west-1`, and the probe did not try the other models on the list.
305
307
 
@@ -323,6 +325,79 @@ export const Opus = AmazonBedrockLanguageModel.model(
323
325
  )
324
326
  ```
325
327
 
328
+ ## Apply a guardrail
329
+
330
+ Create the guardrail in Amazon Bedrock first, in the region of your requests. This package does not create one. Then name it in `guardrailConfig`:
331
+
332
+ ```ts
333
+ import { AmazonBedrockLanguageModel } from "@wmaurer/effect-ai-amazon-bedrock"
334
+
335
+ export const Guarded = AmazonBedrockLanguageModel.model("eu.anthropic.claude-sonnet-4-5-20250929-v1:0", {
336
+ guardrailConfig: {
337
+ guardrailIdentifier: "abc123xyz",
338
+ guardrailVersion: "1",
339
+ trace: "enabled"
340
+ }
341
+ })
342
+ ```
343
+
344
+ `guardrailVersion` is a version number or `"DRAFT"`. `streamProcessingMode`, `"sync"` or `"async"`, applies to `streamText` only, and `generateText` does not send it. In `"async"` mode the text arrives before the guardrail has evaluated it. A live run on 2026-10-18 streamed the blocked word before the finish part reported the block. In `"sync"` mode, the default, the same request streamed only the blocked message. An override replaces the whole `guardrailConfig`, and `AmazonBedrockLanguageModel.withConfigOverride({ guardrailConfig: undefined })` turns the guardrail off for one request.
345
+
346
+ When the guardrail blocks, Bedrock answers with the blocked message that the guardrail configures as the response text, and the finish reason is `"content-filter"`. A blocked input costs no model tokens. Every finish part, on `generateText` and on `streamText`, holds `metadata.amazonBedrock`:
347
+
348
+ - `stopReason` is the Converse stop reason as Bedrock sent it. It tells `guardrail_intervened` from `content_filtered`, which both give `"content-filter"`. AWS does not define `content_filtered`. Reports from other projects say Converse sends it when the model's own classifier refuses, with no guardrail involved.
349
+ - `guardrail` is `{ input, output, policies }` when the response holds a guardrail trace, and `null` otherwise. `input` and `output` are `"blocked"`, `"masked"`, or `"none"`. A masked answer is usable, with the sensitive values replaced, and it also has the stop reason `guardrail_intervened`. `policies` names the policies that acted, such as `"wordPolicy"`.
350
+ - `trace` is the Converse trace as Bedrock sent it, or `null`.
351
+
352
+ Bedrock returns the trace only when `trace` is `"enabled"` or `"enabled_full"`. The trace holds the text that a policy matched, unmasked, so it reaches anything that logs or stores the response parts.
353
+
354
+ ```ts
355
+ import { Effect } from "effect"
356
+ import { LanguageModel } from "effect/ai"
357
+
358
+ export const answer = Effect.gen(function*() {
359
+ const response = yield* LanguageModel.generateText({ prompt: "What is the capital of Australia?" })
360
+ const bedrock = response.content.find((part) => part.type === "finish")?.metadata.amazonBedrock
361
+ if (bedrock?.guardrail?.output === "blocked") {
362
+ return "The guardrail blocked the answer."
363
+ }
364
+ return response.text
365
+ })
366
+ ```
367
+
368
+ `generateObject` fails with an `AiError` whose reason is `ContentPolicyError` when the guardrail intervened and the response holds no JSON. Its `metadata.amazonBedrock` is that of the finish part. The error is not retryable, because a retry meets the same block. A masked object is still JSON, and `generateObject` decodes it as usual.
369
+
370
+ ### Choose what the guardrail evaluates
371
+
372
+ Without `guardContent`, the guardrail evaluates every message but not the system prompt. Once any part of a request has `guardContent`, the guardrail evaluates only the parts that have it. The model still reads every part. `guardContent` goes on a user text part, a system message, or a user file part with a PNG or JPEG image given as base64 or a `Uint8Array`. Any other part with it fails with `InvalidUserInputError`. On text, `qualifiers` names the role of the text in a contextual grounding check:
373
+
374
+ ```ts
375
+ import { Prompt } from "effect/ai"
376
+
377
+ declare const policyText: string
378
+
379
+ export const prompt = Prompt.fromMessages([
380
+ Prompt.makeMessage("system", {
381
+ content: "Answer from the policy only.",
382
+ options: { amazonBedrock: { guardContent: true } }
383
+ }),
384
+ Prompt.makeMessage("user", {
385
+ content: [
386
+ Prompt.makePart("text", {
387
+ text: policyText,
388
+ options: { amazonBedrock: { guardContent: { qualifiers: ["grounding_source"] } } }
389
+ }),
390
+ Prompt.makePart("text", {
391
+ text: "Can I get a refund after 45 days?",
392
+ options: { amazonBedrock: { guardContent: { qualifiers: ["query"] } } }
393
+ })
394
+ ]
395
+ })
396
+ ])
397
+ ```
398
+
399
+ The option stays on the part, so in a `Chat` a guarded turn is evaluated again on every later turn.
400
+
326
401
  ## Set Bedrock options on a prompt
327
402
 
328
403
  The provider reads its options from the `amazonBedrock` key of the `options` field on prompt messages and parts.
@@ -400,10 +475,11 @@ Converse has features that this provider does not model yet:
400
475
  - Video blocks. A `video/*` file part fails with `InvalidUserInputError`.
401
476
  - Documents given as pre-chunked `content`.
402
477
  - The `error` field of an image block.
403
- - The `audio`, `guardContent`, `searchResult`, `toolAddition`, and `toolRemoval` content blocks, which the provider decodes and ignores.
478
+ - The `audio`, `searchResult`, `toolAddition`, and `toolRemoval` content blocks, which the provider decodes and ignores.
404
479
  - Citations with a `web` or `searchResultLocation` location, which the provider drops.
405
480
  - System tools, which run on Bedrock.
406
- - The Converse request fields `guardrailConfig`, `promptVariables`, `requestMetadata`, `performanceConfig`, and `serviceTier`. The request config has no key for them.
481
+ - The Converse request fields `promptVariables`, `requestMetadata`, `performanceConfig`, and `serviceTier`. The request config has no key for them.
482
+ - The `ApplyGuardrail` operation, which evaluates content without a model call.
407
483
 
408
484
  `LanguageModel.streamText` always asks for text, so streamed structured output is not available. That limit is in `effect/ai`, not in this provider.
409
485
 
@@ -23,7 +23,7 @@ import * as HttpClient from "effect/http/HttpClient";
23
23
  import * as Layer from "effect/Layer";
24
24
  import type * as Redacted from "effect/Redacted";
25
25
  import * as Stream from "effect/Stream";
26
- import type { ConverseRequest } from "./AmazonBedrockSchema.ts";
26
+ import type { ConverseRequest, ConverseStreamRequest } from "./AmazonBedrockSchema.ts";
27
27
  import { ConverseResponse, ConverseResponseStreamEvent } from "./AmazonBedrockSchema.ts";
28
28
  /**
29
29
  * Represents the Amazon Bedrock client service with methods for the Converse
@@ -46,7 +46,7 @@ export interface Service {
46
46
  * all errors to the unified `AiError` type.
47
47
  */
48
48
  readonly converseStream: (options: {
49
- readonly payload: typeof ConverseRequest.Encoded;
49
+ readonly payload: typeof ConverseStreamRequest.Encoded;
50
50
  }) => Stream.Stream<ConverseResponseStreamEvent, AiError.AiError>;
51
51
  }
52
52
  declare const AmazonBedrockClient_base: Context.ServiceClass<AmazonBedrockClient, "@wmaurer/effect-ai-amazon-bedrock/AmazonBedrockClient", Service>;
@@ -1 +1 @@
1
- {"version":3,"file":"AmazonBedrockClient.d.ts","sourceRoot":"","sources":["../src/AmazonBedrockClient.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AACH,OAAO,KAAK,KAAK,OAAO,MAAM,mBAAmB,CAAA;AAEjD,OAAO,KAAK,KAAK,MAAM,MAAM,eAA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,SAAS,CAAA;IAC5E,QAAQ,CAAC,kBAAkB,CAAC,EAAE,KAAK,CAAA;IACnC,QAAQ,CAAC,MAAM,CAAC,EAAE,KAAK,CAAA;CACxB,GACC,YAAY,CAAC,CAAC,CAAC,GACf;IACA,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAA;IACzD,QAAQ,CAAC,WAAW,CAAC,EAAE,KAAK,CAAA;IAC5B,QAAQ,CAAC,eAAe,CAAC,EAAE,KAAK,CAAA;IAChC,QAAQ,CAAC,YAAY,CAAC,EAAE,KAAK,CAAA;IAC7B,QAAQ,CAAC,kBAAkB,CAAC,EAAE,KAAK,CAAA;CACpC,CACF,CAAA;AAcH;;;;;;GAMG;AACH,eAAO,MAAM,IAAI,GAAI,CAAC,GAAG,KAAK,WAAW,OAAO,CAAC,CAAC,CAAC,KAAG,MAAM,CAAC,MAAM,CAAC,OAAO,EAAE,KAAK,EAAE,UAAU,CAAC,UAAU,GAAG,CAAC,CACxF,CAAA;AA8FrB;;;;;;GAMG;AACH,eAAO,MAAM,KAAK,GAAI,CAAC,GAAG,KAAK,WACpB,OAAO,CAAC,CAAC,CAAC,KAClB,KAAK,CAAC,KAAK,CAAC,mBAAmB,EAAE,KAAK,EAAE,UAAU,CAAC,UAAU,GAAG,CAAC,CAClB,CAAA;AAElD;;;;;;;GAOG;AACH,eAAO,MAAM,WAAW,GAAI,CAAC,GAAG,KAAK,WAC1B,aAAa,CAAC,CAAC,CAAC,KACxB,KAAK,CAAC,KAAK,CAAC,mBAAmB,EAAE,MAAM,CAAC,WAAW,EAAE,UAAU,CAAC,UAAU,GAAG,CAAC,CAe9E,CAAA"}
@@ -3,8 +3,9 @@ import * as AiModel from "effect/ai/Model";
3
3
  import * as Context from "effect/Context";
4
4
  import * as Effect from "effect/Effect";
5
5
  import * as Layer from "effect/Layer";
6
+ import type * as Schema from "effect/Schema";
6
7
  import { AmazonBedrockClient } from "./AmazonBedrockClient.ts";
7
- import type { CachePointBlock, CitationsConfig } from "./AmazonBedrockSchema.ts";
8
+ import type { CachePointBlock, CitationsConfig, GuardrailConverseContentQualifier, GuardrailStreamConfiguration } from "./AmazonBedrockSchema.ts";
8
9
  /**
9
10
  * A Bedrock model identifier or cross-region inference profile id (e.g.
10
11
  * `us.anthropic.claude-sonnet-4-5-20250929-v1:0`).
@@ -74,15 +75,6 @@ interface CachePointOptions {
74
75
  } | null;
75
76
  }
76
77
  declare module "effect/ai/Prompt" {
77
- /**
78
- * Amazon Bedrock options for system messages.
79
- *
80
- * @stability unstable
81
- * @category models
82
- * @since 0.1.0
83
- */
84
- interface SystemMessageOptions extends CachePointOptions {
85
- }
86
78
  /**
87
79
  * Amazon Bedrock options for user messages.
88
80
  *
@@ -110,15 +102,6 @@ declare module "effect/ai/Prompt" {
110
102
  */
111
103
  interface ToolMessageOptions extends CachePointOptions {
112
104
  }
113
- /**
114
- * Amazon Bedrock options for text prompt parts.
115
- *
116
- * @stability unstable
117
- * @category models
118
- * @since 0.1.0
119
- */
120
- interface TextPartOptions extends CachePointOptions {
121
- }
122
105
  /**
123
106
  * Amazon Bedrock options for tool call prompt parts.
124
107
  *
@@ -174,6 +157,13 @@ interface FileOptions {
174
157
  * Converse cannot cite.
175
158
  */
176
159
  readonly citations?: Citations | null;
160
+ /**
161
+ * Sends the image as a `guardContent` image block, for the guardrail to
162
+ * evaluate. Only an `image/png` or `image/jpeg` part whose data is bytes
163
+ * or base64 can be guarded. Any other file part with this option fails
164
+ * the request with `InvalidUserInputError`.
165
+ */
166
+ readonly guardContent?: true | null;
177
167
  } | null;
178
168
  }
179
169
  declare module "effect/ai/Prompt" {
@@ -292,6 +282,168 @@ declare module "effect/ai/Response" {
292
282
  } | null;
293
283
  }
294
284
  }
285
+ /**
286
+ * A guardrail to apply to every request, set as `Config.guardrailConfig`.
287
+ *
288
+ * **Details**
289
+ *
290
+ * `generateText` and `generateObject` send it to Converse without
291
+ * `streamProcessingMode`, which Converse does not have. `streamText` sends it
292
+ * to ConverseStream as given.
293
+ *
294
+ * Without `guardContent` on any part, the guardrail evaluates every message
295
+ * and not the system prompt. Set `trace` to `"enabled"` to learn from the
296
+ * finish part whether the guardrail blocked or masked. The trace holds the
297
+ * matched text unmasked.
298
+ *
299
+ * @stability unstable
300
+ * @category models
301
+ * @since 0.4.0
302
+ */
303
+ export type GuardrailConfig = typeof GuardrailStreamConfiguration.Encoded;
304
+ /**
305
+ * The role a guarded text part plays in a contextual grounding check.
306
+ *
307
+ * @stability unstable
308
+ * @category models
309
+ * @since 0.4.0
310
+ */
311
+ export type GuardContentQualifier = typeof GuardrailConverseContentQualifier.Type;
312
+ /**
313
+ * Marks a text part or a system message for the guardrail to evaluate.
314
+ *
315
+ * **Details**
316
+ *
317
+ * `true` guards the text. `qualifiers` names its role in a contextual
318
+ * grounding check: the source documents are `grounding_source`, and the
319
+ * question is `query`. Once any part of a request is guarded, the guardrail
320
+ * evaluates only the guarded parts. The model still reads every part.
321
+ *
322
+ * The option stays on the part, so in a chat a guarded turn is evaluated
323
+ * again on every later turn.
324
+ *
325
+ * @stability unstable
326
+ * @category models
327
+ * @since 0.4.0
328
+ */
329
+ export type GuardContent = true | {
330
+ readonly qualifiers: ReadonlyArray<GuardContentQualifier>;
331
+ };
332
+ interface GuardableOptions {
333
+ readonly amazonBedrock?: {
334
+ /**
335
+ * Marks the end of the reusable prefix of the request. The cache point is
336
+ * emitted after the content this is attached to.
337
+ */
338
+ readonly cachePoint?: CachePoint | null;
339
+ /**
340
+ * Sends the text as a `guardContent` block, for the guardrail to evaluate.
341
+ * Honoured on user text parts and system messages. On an assistant text
342
+ * part it fails the request with `InvalidUserInputError`.
343
+ */
344
+ readonly guardContent?: GuardContent | null;
345
+ } | null;
346
+ }
347
+ declare module "effect/ai/Prompt" {
348
+ /**
349
+ * Amazon Bedrock options for system messages.
350
+ *
351
+ * @stability unstable
352
+ * @category models
353
+ * @since 0.1.0
354
+ */
355
+ interface SystemMessageOptions extends GuardableOptions {
356
+ }
357
+ /**
358
+ * Amazon Bedrock options for text prompt parts.
359
+ *
360
+ * @stability unstable
361
+ * @category models
362
+ * @since 0.1.0
363
+ */
364
+ interface TextPartOptions extends GuardableOptions {
365
+ }
366
+ }
367
+ /**
368
+ * What a guardrail did to one side of the exchange.
369
+ *
370
+ * @stability unstable
371
+ * @category models
372
+ * @since 0.4.0
373
+ */
374
+ export type GuardrailAction = "blocked" | "masked" | "none";
375
+ /**
376
+ * What the guardrails did, read from the trace.
377
+ *
378
+ * **Details**
379
+ *
380
+ * `input` and `output` are the strongest action that any guardrail took on
381
+ * that side, `blocked` over `masked` over `none`, across every guardrail in
382
+ * the trace, enforced guardrails included. `policies` lists the trace keys of
383
+ * the policies that blocked or masked, such as `wordPolicy` or
384
+ * `sensitiveInformationPolicy`, each once, in the order the trace names them.
385
+ *
386
+ * @stability unstable
387
+ * @category models
388
+ * @since 0.4.0
389
+ */
390
+ export type GuardrailOutcome = {
391
+ readonly input: GuardrailAction;
392
+ readonly output: GuardrailAction;
393
+ readonly policies: Array<string>;
394
+ };
395
+ /**
396
+ * The Amazon Bedrock metadata on every finish part.
397
+ *
398
+ * **Details**
399
+ *
400
+ * `stopReason` is the raw Converse stop reason. It tells
401
+ * `guardrail_intervened` from `content_filtered`, which both finish with
402
+ * `"content-filter"`, and `max_tokens` from `model_context_window_exceeded`,
403
+ * which both finish with `"length"`. It is `null` only when a stream ended
404
+ * without a `messageStop` event.
405
+ *
406
+ * `guardrail` is `null` when the response carried no guardrail trace, which
407
+ * is the case unless `trace` is enabled in the guardrail config. A trace in
408
+ * which nothing acted gives `{ input: "none", output: "none", policies: [] }`.
409
+ * `trace` is the Converse trace as Bedrock sent it, or `null`. It holds the
410
+ * text that a policy matched, unmasked.
411
+ *
412
+ * @stability unstable
413
+ * @category models
414
+ * @since 0.4.0
415
+ */
416
+ export type FinishMetadata = {
417
+ readonly stopReason: string | null;
418
+ readonly guardrail: GuardrailOutcome | null;
419
+ readonly trace: Schema.MutableJson | null;
420
+ };
421
+ declare module "effect/ai/AiError" {
422
+ /**
423
+ * Amazon Bedrock metadata on the `ContentPolicyError` that `generateObject`
424
+ * fails with when a guardrail blocked the exchange. It is the metadata of
425
+ * the response's finish part.
426
+ *
427
+ * @stability unstable
428
+ * @category models
429
+ * @since 0.4.0
430
+ */
431
+ interface ContentPolicyErrorMetadata extends ProviderMetadata {
432
+ readonly amazonBedrock?: FinishMetadata | null;
433
+ }
434
+ }
435
+ declare module "effect/ai/Response" {
436
+ /**
437
+ * Amazon Bedrock metadata on the finish part.
438
+ *
439
+ * @stability unstable
440
+ * @category models
441
+ * @since 0.4.0
442
+ */
443
+ interface FinishPartMetadata extends ProviderMetadata {
444
+ readonly amazonBedrock?: FinishMetadata | null;
445
+ }
446
+ }
295
447
  declare const Config_base: Context.ServiceClass<Config, "@wmaurer/effect-ai-amazon-bedrock/AmazonBedrockLanguageModel/Config", {
296
448
  readonly modelId?: string;
297
449
  readonly toolConfig?: {
@@ -329,6 +481,12 @@ declare const Config_base: Context.ServiceClass<Config, "@wmaurer/effect-ai-amaz
329
481
  readonly additionalModelRequestFields?: {
330
482
  readonly [x: string]: unknown;
331
483
  } | undefined;
484
+ readonly guardrailConfig?: {
485
+ readonly guardrailIdentifier: string;
486
+ readonly guardrailVersion: string;
487
+ readonly trace?: "disabled" | "enabled" | "enabled_full";
488
+ readonly streamProcessingMode?: "async" | "sync";
489
+ } | undefined;
332
490
  readonly outputConfig?: {
333
491
  readonly effort?: string | undefined;
334
492
  } | undefined;
@@ -340,12 +498,17 @@ declare const Config_base: Context.ServiceClass<Config, "@wmaurer/effect-ai-amaz
340
498
  *
341
499
  * **Details**
342
500
  *
343
- * Derived from `ConverseRequest`, minus the fields built from the prompt, so
344
- * every Converse request parameter is settable per request. That includes
345
- * `additionalModelRequestFields`, which carries inference parameters specific
346
- * to the target model — among them extended thinking on Anthropic models. The
347
- * thinking budget is drawn from the same ceiling as the visible answer, so
348
- * `inferenceConfig.maxTokens` must exceed `budget_tokens`.
501
+ * Derived from `ConverseStreamRequest`, minus the fields built from the
502
+ * prompt, so every Converse request parameter is settable per request. That
503
+ * includes `additionalModelRequestFields`, which carries inference parameters
504
+ * specific to the target model — among them extended thinking on Anthropic
505
+ * models. The thinking budget is drawn from the same ceiling as the visible
506
+ * answer, so `inferenceConfig.maxTokens` must exceed `budget_tokens`.
507
+ *
508
+ * It also includes `guardrailConfig` (see {@link GuardrailConfig}). An
509
+ * override replaces the whole object, and `guardrailConfig: undefined` turns
510
+ * off a layer's guardrail for one request. `generateText` does not send
511
+ * `streamProcessingMode`.
349
512
  *
350
513
  * **Example** (Enabling extended thinking for one request)
351
514
  *
@@ -1 +1 @@
1
- {"version":3,"file":"AmazonBedrockLanguageModel.d.ts","sourceRoot":"","sources":["../src/AmazonBedrockLanguageModel.ts"],"names":[],"mappings":"AA8BA,OAAO,KAAK,aAAa,MAAM,yBAAyB,CAAA;AACxD,OAAO,KAAK,OAAO,MAAM,iBAAiB,CAAA;AAI1C,OAAO,KAAK,OAAO,MAAM,gBAAgB,CAAA;AAEzC,OAAO,KAAK,MAAM,MAAM,eAAe,CAAA;AAGvC,OAAO,KAAK,KAAK,MAAM,cAAc,CAAA;AAOrC,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAA;AAC9D,OAAO,KAAK,EACV,eAAe,EAEf,eAAe,EAehB,MAAM,0BAA0B,CAAA;AAGjC;;;;;;;GAOG;AACH,MAAM,MAAM,KAAK,GAAG,MAAM,GAAG,EAAE,CAAA;AAM/B;;;;;;;;;;;;GAYG;AACH,MAAM,MAAM,UAAU,GAAG,OAAO,eAAe,CAAC,OAAO,CAAA;AAEvD;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,eAAO,MAAM,cAAc;;;cAG1B,CAAA;AAOD;;GAEG;AACH,UAAU,iBAAiB;IACzB,QAAQ,CAAC,aAAa,CAAC,EAAE;QACvB;;;WAGG;QACH,QAAQ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