@ai-sdk/amazon-bedrock 4.0.199 → 4.0.201
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 +22 -0
- package/dist/anthropic/index.js +8 -4
- package/dist/anthropic/index.js.map +1 -1
- package/dist/anthropic/index.mjs +10 -4
- package/dist/anthropic/index.mjs.map +1 -1
- package/dist/index.d.mts +12 -30
- package/dist/index.d.ts +12 -30
- package/dist/index.js +289 -239
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +236 -167
- package/dist/index.mjs.map +1 -1
- package/dist/mantle/index.js +1 -1
- package/dist/mantle/index.mjs +1 -1
- package/package.json +4 -4
- package/src/anthropic/bedrock-anthropic-fetch.ts +9 -3
- package/src/bedrock-chat-language-model.ts +82 -68
- package/src/bedrock-chat-options.ts +22 -13
- package/src/bedrock-embedding-model.ts +30 -24
- package/src/bedrock-embedding-options.ts +84 -60
- package/src/bedrock-error.ts +13 -5
- package/src/bedrock-image-model.ts +18 -12
- package/src/bedrock-reasoning-metadata.ts +15 -6
package/dist/index.mjs
CHANGED
|
@@ -9,6 +9,8 @@ import {
|
|
|
9
9
|
|
|
10
10
|
// src/bedrock-chat-language-model.ts
|
|
11
11
|
import {
|
|
12
|
+
lazySchema as lazySchema4,
|
|
13
|
+
zodSchema as zodSchema4,
|
|
12
14
|
combineHeaders,
|
|
13
15
|
createJsonErrorResponseHandler as createJsonErrorResponseHandler2,
|
|
14
16
|
createJsonResponseHandler,
|
|
@@ -55,19 +57,27 @@ var BEDROCK_DOCUMENT_MIME_TYPES = {
|
|
|
55
57
|
};
|
|
56
58
|
|
|
57
59
|
// src/bedrock-chat-options.ts
|
|
60
|
+
import {
|
|
61
|
+
lazySchema,
|
|
62
|
+
zodSchema
|
|
63
|
+
} from "@ai-sdk/provider-utils";
|
|
58
64
|
import { z } from "zod/v4";
|
|
59
|
-
var bedrockFilePartProviderOptions =
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
65
|
+
var bedrockFilePartProviderOptions = lazySchema(
|
|
66
|
+
() => zodSchema(
|
|
67
|
+
z.object({
|
|
68
|
+
/**
|
|
69
|
+
* Citation configuration for this document.
|
|
70
|
+
* When enabled, this document will generate citations in the response.
|
|
71
|
+
*/
|
|
72
|
+
citations: z.object({
|
|
73
|
+
/**
|
|
74
|
+
* Enable citations for this document
|
|
75
|
+
*/
|
|
76
|
+
enabled: z.boolean()
|
|
77
|
+
}).optional()
|
|
78
|
+
})
|
|
79
|
+
)
|
|
80
|
+
);
|
|
71
81
|
var amazonBedrockLanguageModelOptions = z.object({
|
|
72
82
|
/**
|
|
73
83
|
* Determines how structured outputs are generated for Anthropic models.
|
|
@@ -133,12 +143,20 @@ var MODELS_WITH_STRICT_TOOL_SUPPORT = [
|
|
|
133
143
|
];
|
|
134
144
|
|
|
135
145
|
// src/bedrock-error.ts
|
|
136
|
-
import {
|
|
146
|
+
import {
|
|
147
|
+
lazySchema as lazySchema2,
|
|
148
|
+
zodSchema as zodSchema2,
|
|
149
|
+
createJsonErrorResponseHandler
|
|
150
|
+
} from "@ai-sdk/provider-utils";
|
|
137
151
|
import { z as z2 } from "zod/v4";
|
|
138
|
-
var BedrockErrorSchema =
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
152
|
+
var BedrockErrorSchema = lazySchema2(
|
|
153
|
+
() => zodSchema2(
|
|
154
|
+
z2.object({
|
|
155
|
+
message: z2.string(),
|
|
156
|
+
type: z2.string().nullish()
|
|
157
|
+
})
|
|
158
|
+
)
|
|
159
|
+
);
|
|
142
160
|
var bedrockFailedResponseHandler = createJsonErrorResponseHandler({
|
|
143
161
|
errorSchema: BedrockErrorSchema,
|
|
144
162
|
errorToMessage: (error) => error.type == null ? error.message : `${error.type}: ${error.message}`
|
|
@@ -456,12 +474,20 @@ import {
|
|
|
456
474
|
} from "@ai-sdk/provider-utils";
|
|
457
475
|
|
|
458
476
|
// src/bedrock-reasoning-metadata.ts
|
|
477
|
+
import {
|
|
478
|
+
lazySchema as lazySchema3,
|
|
479
|
+
zodSchema as zodSchema3
|
|
480
|
+
} from "@ai-sdk/provider-utils";
|
|
459
481
|
import { z as z3 } from "zod/v4";
|
|
460
|
-
var bedrockReasoningMetadataSchema =
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
482
|
+
var bedrockReasoningMetadataSchema = lazySchema3(
|
|
483
|
+
() => zodSchema3(
|
|
484
|
+
z3.object({
|
|
485
|
+
signature: z3.string().optional(),
|
|
486
|
+
redactedData: z3.string().optional(),
|
|
487
|
+
redactedContent: z3.string().optional()
|
|
488
|
+
})
|
|
489
|
+
)
|
|
490
|
+
);
|
|
465
491
|
|
|
466
492
|
// src/normalize-tool-call-id.ts
|
|
467
493
|
function isMistralModel(modelId) {
|
|
@@ -941,10 +967,14 @@ function mapBedrockFinishReason(finishReason, isJsonResponseFromTool) {
|
|
|
941
967
|
function isJsonResponseToolName(name) {
|
|
942
968
|
return name === "json" || name === "json<|channel|>commentary";
|
|
943
969
|
}
|
|
944
|
-
var anthropicProviderOptions =
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
970
|
+
var anthropicProviderOptions = lazySchema4(
|
|
971
|
+
() => zodSchema4(
|
|
972
|
+
z4.object({
|
|
973
|
+
disableParallelToolUse: z4.boolean().optional(),
|
|
974
|
+
structuredOutputMode: z4.enum(["outputFormat", "jsonTool", "auto"]).optional()
|
|
975
|
+
})
|
|
976
|
+
)
|
|
977
|
+
);
|
|
948
978
|
var BedrockChatLanguageModel = class {
|
|
949
979
|
constructor(modelId, config) {
|
|
950
980
|
this.modelId = modelId;
|
|
@@ -1826,68 +1856,72 @@ var BedrockToolUseSchema = z4.object({
|
|
|
1826
1856
|
name: z4.string(),
|
|
1827
1857
|
input: z4.unknown().optional()
|
|
1828
1858
|
});
|
|
1829
|
-
var BedrockReasoningTextSchema = z4.object({
|
|
1859
|
+
var BedrockReasoningTextSchema = () => z4.object({
|
|
1830
1860
|
signature: z4.string().nullish(),
|
|
1831
1861
|
text: z4.string()
|
|
1832
1862
|
});
|
|
1833
|
-
var BedrockRedactedReasoningSchema = z4.object({
|
|
1863
|
+
var BedrockRedactedReasoningSchema = () => z4.object({
|
|
1834
1864
|
data: z4.string()
|
|
1835
1865
|
});
|
|
1836
1866
|
var AmazonBedrockCacheDetailSchema = z4.object({
|
|
1837
1867
|
inputTokens: z4.number(),
|
|
1838
1868
|
ttl: z4.string()
|
|
1839
1869
|
}).catchall(z4.json());
|
|
1840
|
-
var BedrockResponseSchema =
|
|
1841
|
-
|
|
1842
|
-
|
|
1843
|
-
|
|
1844
|
-
|
|
1845
|
-
|
|
1846
|
-
|
|
1847
|
-
z4.object({
|
|
1848
|
-
|
|
1849
|
-
citationsContent: z4.object({
|
|
1850
|
-
content: z4.array(
|
|
1851
|
-
z4.object({
|
|
1852
|
-
text: z4.string().nullish()
|
|
1853
|
-
})
|
|
1854
|
-
).nullish()
|
|
1855
|
-
}).nullish(),
|
|
1856
|
-
toolUse: BedrockToolUseSchema.nullish(),
|
|
1857
|
-
reasoningContent: z4.union([
|
|
1858
|
-
z4.object({
|
|
1859
|
-
reasoningText: BedrockReasoningTextSchema
|
|
1860
|
-
}),
|
|
1861
|
-
z4.object({
|
|
1862
|
-
redactedReasoning: BedrockRedactedReasoningSchema
|
|
1863
|
-
}),
|
|
1864
|
-
// `redactedContent` is a member of the documented
|
|
1865
|
-
// ReasoningContentBlock union. OpenAI models on Bedrock
|
|
1866
|
-
// (e.g. `us.openai.gpt-5.6-luna`) return their encrypted
|
|
1867
|
-
// reasoning in this shape.
|
|
1870
|
+
var BedrockResponseSchema = lazySchema4(
|
|
1871
|
+
() => zodSchema4(
|
|
1872
|
+
z4.object({
|
|
1873
|
+
metrics: z4.object({
|
|
1874
|
+
latencyMs: z4.number()
|
|
1875
|
+
}).nullish(),
|
|
1876
|
+
output: z4.object({
|
|
1877
|
+
message: z4.object({
|
|
1878
|
+
content: z4.array(
|
|
1868
1879
|
z4.object({
|
|
1869
|
-
|
|
1880
|
+
text: z4.string().nullish(),
|
|
1881
|
+
citationsContent: z4.object({
|
|
1882
|
+
content: z4.array(
|
|
1883
|
+
z4.object({
|
|
1884
|
+
text: z4.string().nullish()
|
|
1885
|
+
})
|
|
1886
|
+
).nullish()
|
|
1887
|
+
}).nullish(),
|
|
1888
|
+
toolUse: BedrockToolUseSchema.nullish(),
|
|
1889
|
+
reasoningContent: z4.union([
|
|
1890
|
+
z4.object({
|
|
1891
|
+
reasoningText: BedrockReasoningTextSchema()
|
|
1892
|
+
}),
|
|
1893
|
+
z4.object({
|
|
1894
|
+
redactedReasoning: BedrockRedactedReasoningSchema()
|
|
1895
|
+
}),
|
|
1896
|
+
// `redactedContent` is a member of the documented
|
|
1897
|
+
// ReasoningContentBlock union. OpenAI models on Bedrock
|
|
1898
|
+
// (e.g. `us.openai.gpt-5.6-luna`) return their encrypted
|
|
1899
|
+
// reasoning in this shape.
|
|
1900
|
+
z4.object({
|
|
1901
|
+
redactedContent: z4.string()
|
|
1902
|
+
})
|
|
1903
|
+
]).nullish()
|
|
1870
1904
|
})
|
|
1871
|
-
|
|
1905
|
+
),
|
|
1906
|
+
role: z4.string()
|
|
1872
1907
|
})
|
|
1873
|
-
),
|
|
1874
|
-
|
|
1908
|
+
}),
|
|
1909
|
+
stopReason: BedrockStopReasonSchema,
|
|
1910
|
+
additionalModelResponseFields: BedrockAdditionalModelResponseFieldsSchema.nullish(),
|
|
1911
|
+
trace: z4.unknown().nullish(),
|
|
1912
|
+
performanceConfig: z4.object({ latency: z4.string() }).nullish(),
|
|
1913
|
+
serviceTier: z4.object({ type: z4.string() }).nullish(),
|
|
1914
|
+
usage: z4.object({
|
|
1915
|
+
inputTokens: z4.number(),
|
|
1916
|
+
outputTokens: z4.number(),
|
|
1917
|
+
totalTokens: z4.number(),
|
|
1918
|
+
cacheReadInputTokens: z4.number().nullish(),
|
|
1919
|
+
cacheWriteInputTokens: z4.number().nullish(),
|
|
1920
|
+
cacheDetails: z4.array(AmazonBedrockCacheDetailSchema).nullish()
|
|
1921
|
+
}).catchall(z4.json())
|
|
1875
1922
|
})
|
|
1876
|
-
|
|
1877
|
-
|
|
1878
|
-
additionalModelResponseFields: BedrockAdditionalModelResponseFieldsSchema.nullish(),
|
|
1879
|
-
trace: z4.unknown().nullish(),
|
|
1880
|
-
performanceConfig: z4.object({ latency: z4.string() }).nullish(),
|
|
1881
|
-
serviceTier: z4.object({ type: z4.string() }).nullish(),
|
|
1882
|
-
usage: z4.object({
|
|
1883
|
-
inputTokens: z4.number(),
|
|
1884
|
-
outputTokens: z4.number(),
|
|
1885
|
-
totalTokens: z4.number(),
|
|
1886
|
-
cacheReadInputTokens: z4.number().nullish(),
|
|
1887
|
-
cacheWriteInputTokens: z4.number().nullish(),
|
|
1888
|
-
cacheDetails: z4.array(AmazonBedrockCacheDetailSchema).nullish()
|
|
1889
|
-
}).catchall(z4.json())
|
|
1890
|
-
});
|
|
1923
|
+
)
|
|
1924
|
+
);
|
|
1891
1925
|
var BedrockStreamSchema = z4.object({
|
|
1892
1926
|
contentBlockDelta: z4.object({
|
|
1893
1927
|
contentBlockIndex: z4.number(),
|
|
@@ -1954,6 +1988,8 @@ import {
|
|
|
1954
1988
|
TooManyEmbeddingValuesForCallError
|
|
1955
1989
|
} from "@ai-sdk/provider";
|
|
1956
1990
|
import {
|
|
1991
|
+
lazySchema as lazySchema6,
|
|
1992
|
+
zodSchema as zodSchema6,
|
|
1957
1993
|
combineHeaders as combineHeaders2,
|
|
1958
1994
|
createJsonResponseHandler as createJsonResponseHandler2,
|
|
1959
1995
|
parseProviderOptions as parseProviderOptions3,
|
|
@@ -1962,56 +1998,79 @@ import {
|
|
|
1962
1998
|
} from "@ai-sdk/provider-utils";
|
|
1963
1999
|
|
|
1964
2000
|
// src/bedrock-embedding-options.ts
|
|
2001
|
+
import {
|
|
2002
|
+
lazySchema as lazySchema5,
|
|
2003
|
+
zodSchema as zodSchema5
|
|
2004
|
+
} from "@ai-sdk/provider-utils";
|
|
1965
2005
|
import { z as z5 } from "zod/v4";
|
|
1966
|
-
var amazonBedrockEmbeddingModelOptionsSchema =
|
|
1967
|
-
|
|
1968
|
-
|
|
1969
|
-
|
|
1970
|
-
|
|
1971
|
-
|
|
1972
|
-
|
|
1973
|
-
|
|
1974
|
-
|
|
1975
|
-
|
|
1976
|
-
|
|
1977
|
-
|
|
1978
|
-
|
|
1979
|
-
|
|
1980
|
-
|
|
1981
|
-
|
|
1982
|
-
|
|
1983
|
-
|
|
1984
|
-
|
|
1985
|
-
|
|
1986
|
-
|
|
1987
|
-
|
|
1988
|
-
|
|
1989
|
-
|
|
1990
|
-
|
|
1991
|
-
|
|
1992
|
-
|
|
1993
|
-
|
|
1994
|
-
|
|
1995
|
-
|
|
1996
|
-
|
|
1997
|
-
|
|
1998
|
-
|
|
1999
|
-
|
|
2000
|
-
|
|
2001
|
-
|
|
2002
|
-
|
|
2003
|
-
|
|
2004
|
-
|
|
2005
|
-
|
|
2006
|
-
|
|
2007
|
-
|
|
2008
|
-
|
|
2009
|
-
|
|
2010
|
-
|
|
2011
|
-
|
|
2012
|
-
|
|
2013
|
-
|
|
2014
|
-
|
|
2006
|
+
var amazonBedrockEmbeddingModelOptionsSchema = lazySchema5(
|
|
2007
|
+
() => zodSchema5(
|
|
2008
|
+
z5.object({
|
|
2009
|
+
/**
|
|
2010
|
+
* The number of dimensions the resulting output embeddings should have (defaults to 1024).
|
|
2011
|
+
* Only supported in amazon.titan-embed-text-v2:0.
|
|
2012
|
+
*/
|
|
2013
|
+
dimensions: z5.union([z5.literal(1024), z5.literal(512), z5.literal(256)]).optional(),
|
|
2014
|
+
/**
|
|
2015
|
+
* Flag indicating whether or not to normalize the output embeddings. Defaults to true.
|
|
2016
|
+
* Only supported in amazon.titan-embed-text-v2:0.
|
|
2017
|
+
*/
|
|
2018
|
+
normalize: z5.boolean().optional(),
|
|
2019
|
+
/**
|
|
2020
|
+
* The number of dimensions for Nova embedding models (defaults to 1024).
|
|
2021
|
+
* Supported values: 256, 384, 1024, 3072.
|
|
2022
|
+
* Only supported in amazon.nova-* embedding models.
|
|
2023
|
+
*/
|
|
2024
|
+
embeddingDimension: z5.union([
|
|
2025
|
+
z5.literal(256),
|
|
2026
|
+
z5.literal(384),
|
|
2027
|
+
z5.literal(1024),
|
|
2028
|
+
z5.literal(3072)
|
|
2029
|
+
]).optional(),
|
|
2030
|
+
/**
|
|
2031
|
+
* The purpose of the embedding. Defaults to 'GENERIC_INDEX'.
|
|
2032
|
+
* Only supported in amazon.nova-* embedding models.
|
|
2033
|
+
*/
|
|
2034
|
+
embeddingPurpose: z5.enum([
|
|
2035
|
+
"GENERIC_INDEX",
|
|
2036
|
+
"TEXT_RETRIEVAL",
|
|
2037
|
+
"IMAGE_RETRIEVAL",
|
|
2038
|
+
"VIDEO_RETRIEVAL",
|
|
2039
|
+
"DOCUMENT_RETRIEVAL",
|
|
2040
|
+
"AUDIO_RETRIEVAL",
|
|
2041
|
+
"GENERIC_RETRIEVAL",
|
|
2042
|
+
"CLASSIFICATION",
|
|
2043
|
+
"CLUSTERING"
|
|
2044
|
+
]).optional(),
|
|
2045
|
+
/**
|
|
2046
|
+
* Input type for Cohere embedding models on Bedrock.
|
|
2047
|
+
* Common values: `search_document`, `search_query`, `classification`, `clustering`.
|
|
2048
|
+
* If not set, the provider defaults to `search_query`.
|
|
2049
|
+
*/
|
|
2050
|
+
inputType: z5.enum([
|
|
2051
|
+
"search_document",
|
|
2052
|
+
"search_query",
|
|
2053
|
+
"classification",
|
|
2054
|
+
"clustering"
|
|
2055
|
+
]).optional(),
|
|
2056
|
+
/**
|
|
2057
|
+
* Truncation behavior when input exceeds the model's context length.
|
|
2058
|
+
* Supported in Cohere and Nova embedding models. Defaults to 'END' for Nova models.
|
|
2059
|
+
*/
|
|
2060
|
+
truncate: z5.enum(["NONE", "START", "END"]).optional(),
|
|
2061
|
+
/**
|
|
2062
|
+
* The number of dimensions the resulting output embeddings should have (defaults to 1536).
|
|
2063
|
+
* Only supported in cohere.embed-v4:0 and newer Cohere embedding models.
|
|
2064
|
+
*/
|
|
2065
|
+
outputDimension: z5.union([
|
|
2066
|
+
z5.literal(256),
|
|
2067
|
+
z5.literal(512),
|
|
2068
|
+
z5.literal(1024),
|
|
2069
|
+
z5.literal(1536)
|
|
2070
|
+
]).optional()
|
|
2071
|
+
})
|
|
2072
|
+
)
|
|
2073
|
+
);
|
|
2015
2074
|
|
|
2016
2075
|
// src/bedrock-embedding-model.ts
|
|
2017
2076
|
import { z as z6 } from "zod/v4";
|
|
@@ -2124,36 +2183,42 @@ function isNovaEmbeddingModel(modelId) {
|
|
|
2124
2183
|
function detectEmbeddingModelFamily(modelId) {
|
|
2125
2184
|
return isNovaEmbeddingModel(modelId) ? "nova" : isCohereEmbeddingModel(modelId) ? "cohere" : "titan";
|
|
2126
2185
|
}
|
|
2127
|
-
var BedrockEmbeddingResponseSchema =
|
|
2128
|
-
|
|
2129
|
-
|
|
2130
|
-
|
|
2131
|
-
|
|
2132
|
-
|
|
2133
|
-
|
|
2134
|
-
|
|
2135
|
-
|
|
2186
|
+
var BedrockEmbeddingResponseSchema = lazySchema6(
|
|
2187
|
+
() => zodSchema6(
|
|
2188
|
+
z6.union([
|
|
2189
|
+
// Titan-style response
|
|
2190
|
+
z6.object({
|
|
2191
|
+
embedding: z6.array(z6.number()),
|
|
2192
|
+
inputTextTokenCount: z6.number()
|
|
2193
|
+
}),
|
|
2194
|
+
// Nova-style response
|
|
2195
|
+
z6.object({
|
|
2196
|
+
embeddings: z6.array(
|
|
2197
|
+
z6.object({
|
|
2198
|
+
embeddingType: z6.string(),
|
|
2199
|
+
embedding: z6.array(z6.number())
|
|
2200
|
+
})
|
|
2201
|
+
),
|
|
2202
|
+
inputTokenCount: z6.number().optional()
|
|
2203
|
+
}),
|
|
2204
|
+
// Cohere v3-style response
|
|
2205
|
+
z6.object({
|
|
2206
|
+
embeddings: z6.array(z6.array(z6.number()))
|
|
2207
|
+
}),
|
|
2208
|
+
// Cohere v4-style response
|
|
2136
2209
|
z6.object({
|
|
2137
|
-
|
|
2138
|
-
|
|
2210
|
+
embeddings: z6.object({
|
|
2211
|
+
float: z6.array(z6.array(z6.number()))
|
|
2212
|
+
})
|
|
2139
2213
|
})
|
|
2140
|
-
)
|
|
2141
|
-
|
|
2142
|
-
|
|
2143
|
-
// Cohere v3-style response
|
|
2144
|
-
z6.object({
|
|
2145
|
-
embeddings: z6.array(z6.array(z6.number()))
|
|
2146
|
-
}),
|
|
2147
|
-
// Cohere v4-style response
|
|
2148
|
-
z6.object({
|
|
2149
|
-
embeddings: z6.object({
|
|
2150
|
-
float: z6.array(z6.array(z6.number()))
|
|
2151
|
-
})
|
|
2152
|
-
})
|
|
2153
|
-
]);
|
|
2214
|
+
])
|
|
2215
|
+
)
|
|
2216
|
+
);
|
|
2154
2217
|
|
|
2155
2218
|
// src/bedrock-image-model.ts
|
|
2156
2219
|
import {
|
|
2220
|
+
lazySchema as lazySchema7,
|
|
2221
|
+
zodSchema as zodSchema7,
|
|
2157
2222
|
combineHeaders as combineHeaders3,
|
|
2158
2223
|
convertUint8ArrayToBase64,
|
|
2159
2224
|
createJsonResponseHandler as createJsonResponseHandler3,
|
|
@@ -2350,17 +2415,21 @@ function getBase64Data(file) {
|
|
|
2350
2415
|
}
|
|
2351
2416
|
return file.data;
|
|
2352
2417
|
}
|
|
2353
|
-
var bedrockImageResponseSchema =
|
|
2354
|
-
|
|
2355
|
-
|
|
2356
|
-
|
|
2357
|
-
|
|
2358
|
-
|
|
2359
|
-
|
|
2360
|
-
|
|
2361
|
-
|
|
2362
|
-
|
|
2363
|
-
|
|
2418
|
+
var bedrockImageResponseSchema = lazySchema7(
|
|
2419
|
+
() => zodSchema7(
|
|
2420
|
+
z7.object({
|
|
2421
|
+
// Normal successful response
|
|
2422
|
+
images: z7.array(z7.string()).optional(),
|
|
2423
|
+
// Moderation response fields
|
|
2424
|
+
id: z7.string().optional(),
|
|
2425
|
+
status: z7.string().optional(),
|
|
2426
|
+
result: z7.unknown().optional(),
|
|
2427
|
+
progress: z7.unknown().optional(),
|
|
2428
|
+
details: z7.record(z7.string(), z7.unknown()).optional(),
|
|
2429
|
+
preview: z7.unknown().optional()
|
|
2430
|
+
})
|
|
2431
|
+
)
|
|
2432
|
+
);
|
|
2364
2433
|
|
|
2365
2434
|
// src/bedrock-sigv4-fetch.ts
|
|
2366
2435
|
import {
|
|
@@ -2372,7 +2441,7 @@ import {
|
|
|
2372
2441
|
import { AwsV4Signer } from "aws4fetch";
|
|
2373
2442
|
|
|
2374
2443
|
// src/version.ts
|
|
2375
|
-
var VERSION = true ? "4.0.
|
|
2444
|
+
var VERSION = true ? "4.0.201" : "0.0.0-test";
|
|
2376
2445
|
|
|
2377
2446
|
// src/bedrock-sigv4-fetch.ts
|
|
2378
2447
|
function createSigV4FetchFunction(getCredentials, fetch, service = "bedrock") {
|
|
@@ -2472,10 +2541,10 @@ import {
|
|
|
2472
2541
|
} from "@ai-sdk/provider-utils";
|
|
2473
2542
|
|
|
2474
2543
|
// src/reranking/bedrock-reranking-api.ts
|
|
2475
|
-
import { lazySchema, zodSchema } from "@ai-sdk/provider-utils";
|
|
2544
|
+
import { lazySchema as lazySchema8, zodSchema as zodSchema8 } from "@ai-sdk/provider-utils";
|
|
2476
2545
|
import { z as z8 } from "zod/v4";
|
|
2477
|
-
var bedrockRerankingResponseSchema =
|
|
2478
|
-
() =>
|
|
2546
|
+
var bedrockRerankingResponseSchema = lazySchema8(
|
|
2547
|
+
() => zodSchema8(
|
|
2479
2548
|
z8.object({
|
|
2480
2549
|
results: z8.array(
|
|
2481
2550
|
z8.object({
|
|
@@ -2489,10 +2558,10 @@ var bedrockRerankingResponseSchema = lazySchema(
|
|
|
2489
2558
|
);
|
|
2490
2559
|
|
|
2491
2560
|
// src/reranking/bedrock-reranking-options.ts
|
|
2492
|
-
import { lazySchema as
|
|
2561
|
+
import { lazySchema as lazySchema9, zodSchema as zodSchema9 } from "@ai-sdk/provider-utils";
|
|
2493
2562
|
import { z as z9 } from "zod/v4";
|
|
2494
|
-
var amazonBedrockRerankingModelOptionsSchema =
|
|
2495
|
-
() =>
|
|
2563
|
+
var amazonBedrockRerankingModelOptionsSchema = lazySchema9(
|
|
2564
|
+
() => zodSchema9(
|
|
2496
2565
|
z9.object({
|
|
2497
2566
|
/**
|
|
2498
2567
|
* If the total number of results was greater than could fit in a response, a token is returned in the nextToken field. You can enter that token in this field to return the next batch of results.
|