Skip to content

Commit 5aefe34

Browse files
author
awstools
committed
feat(client-bedrock-agent-runtime): Support audio and video content retrieval on Bedrock Knowledge Bases.
1 parent 4ba44e4 commit 5aefe34

File tree

13 files changed

+594
-180
lines changed

13 files changed

+594
-180
lines changed

clients/client-bedrock-agent-runtime/src/commands/InvokeAgentCommand.ts

Lines changed: 27 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -267,9 +267,17 @@ export interface InvokeAgentCommandOutput extends InvokeAgentResponse, __Metadat
267267
* // retrievedReferences: [ // RetrievedReferences
268268
* // { // RetrievedReference
269269
* // content: { // RetrievalResultContent
270-
* // type: "TEXT" || "IMAGE" || "ROW",
270+
* // type: "TEXT" || "IMAGE" || "ROW" || "AUDIO" || "VIDEO",
271271
* // text: "STRING_VALUE",
272272
* // byteContent: "STRING_VALUE",
273+
* // video: { // VideoSegment
274+
* // s3Uri: "STRING_VALUE", // required
275+
* // summary: "STRING_VALUE",
276+
* // },
277+
* // audio: { // AudioSegment
278+
* // s3Uri: "STRING_VALUE", // required
279+
* // transcription: "STRING_VALUE",
280+
* // },
273281
* // row: [ // RetrievalResultContentRow
274282
* // { // RetrievalResultContentColumn
275283
* // columnName: "STRING_VALUE",
@@ -655,9 +663,17 @@ export interface InvokeAgentCommandOutput extends InvokeAgentResponse, __Metadat
655663
* // retrievedReferences: [
656664
* // {
657665
* // content: {
658-
* // type: "TEXT" || "IMAGE" || "ROW",
666+
* // type: "TEXT" || "IMAGE" || "ROW" || "AUDIO" || "VIDEO",
659667
* // text: "STRING_VALUE",
660668
* // byteContent: "STRING_VALUE",
669+
* // video: {
670+
* // s3Uri: "STRING_VALUE", // required
671+
* // summary: "STRING_VALUE",
672+
* // },
673+
* // audio: {
674+
* // s3Uri: "STRING_VALUE", // required
675+
* // transcription: "STRING_VALUE",
676+
* // },
661677
* // row: [
662678
* // {
663679
* // columnName: "STRING_VALUE",
@@ -943,9 +959,17 @@ export interface InvokeAgentCommandOutput extends InvokeAgentResponse, __Metadat
943959
* // retrievedReferences: [
944960
* // {
945961
* // content: {
946-
* // type: "TEXT" || "IMAGE" || "ROW",
962+
* // type: "TEXT" || "IMAGE" || "ROW" || "AUDIO" || "VIDEO",
947963
* // text: "STRING_VALUE",
948964
* // byteContent: "STRING_VALUE",
965+
* // video: {
966+
* // s3Uri: "STRING_VALUE", // required
967+
* // summary: "STRING_VALUE",
968+
* // },
969+
* // audio: {
970+
* // s3Uri: "STRING_VALUE", // required
971+
* // transcription: "STRING_VALUE",
972+
* // },
949973
* // row: [
950974
* // {
951975
* // columnName: "STRING_VALUE",

clients/client-bedrock-agent-runtime/src/commands/InvokeFlowCommand.ts

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -486,9 +486,17 @@ export interface InvokeFlowCommandOutput extends InvokeFlowResponse, __MetadataB
486486
* // retrievedReferences: [ // RetrievedReferences
487487
* // { // RetrievedReference
488488
* // content: { // RetrievalResultContent
489-
* // type: "TEXT" || "IMAGE" || "ROW",
489+
* // type: "TEXT" || "IMAGE" || "ROW" || "AUDIO" || "VIDEO",
490490
* // text: "STRING_VALUE",
491491
* // byteContent: "STRING_VALUE",
492+
* // video: { // VideoSegment
493+
* // s3Uri: "STRING_VALUE", // required
494+
* // summary: "STRING_VALUE",
495+
* // },
496+
* // audio: { // AudioSegment
497+
* // s3Uri: "STRING_VALUE", // required
498+
* // transcription: "STRING_VALUE",
499+
* // },
492500
* // row: [ // RetrievalResultContentRow
493501
* // { // RetrievalResultContentColumn
494502
* // columnName: "STRING_VALUE",
@@ -774,9 +782,17 @@ export interface InvokeFlowCommandOutput extends InvokeFlowResponse, __MetadataB
774782
* // retrievedReferences: [
775783
* // {
776784
* // content: {
777-
* // type: "TEXT" || "IMAGE" || "ROW",
785+
* // type: "TEXT" || "IMAGE" || "ROW" || "AUDIO" || "VIDEO",
778786
* // text: "STRING_VALUE",
779787
* // byteContent: "STRING_VALUE",
788+
* // video: {
789+
* // s3Uri: "STRING_VALUE", // required
790+
* // summary: "STRING_VALUE",
791+
* // },
792+
* // audio: {
793+
* // s3Uri: "STRING_VALUE", // required
794+
* // transcription: "STRING_VALUE",
795+
* // },
780796
* // row: [
781797
* // {
782798
* // columnName: "STRING_VALUE",

clients/client-bedrock-agent-runtime/src/commands/InvokeInlineAgentCommand.ts

Lines changed: 29 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ import {
99
ServiceOutputTypes,
1010
} from "../BedrockAgentRuntimeClient";
1111
import { commonParams } from "../endpoint/EndpointParameters";
12-
import { InvokeInlineAgentRequest, InvokeInlineAgentResponse } from "../models/models_0";
12+
import { InvokeInlineAgentResponse } from "../models/models_0";
13+
import { InvokeInlineAgentRequest } from "../models/models_1";
1314
import { InvokeInlineAgent } from "../schemas/schemas_0";
1415

1516
/**
@@ -480,9 +481,17 @@ export interface InvokeInlineAgentCommandOutput extends InvokeInlineAgentRespons
480481
* // retrievedReferences: [ // RetrievedReferences
481482
* // { // RetrievedReference
482483
* // content: { // RetrievalResultContent
483-
* // type: "TEXT" || "IMAGE" || "ROW",
484+
* // type: "TEXT" || "IMAGE" || "ROW" || "AUDIO" || "VIDEO",
484485
* // text: "STRING_VALUE",
485486
* // byteContent: "STRING_VALUE",
487+
* // video: { // VideoSegment
488+
* // s3Uri: "STRING_VALUE", // required
489+
* // summary: "STRING_VALUE",
490+
* // },
491+
* // audio: { // AudioSegment
492+
* // s3Uri: "STRING_VALUE", // required
493+
* // transcription: "STRING_VALUE",
494+
* // },
486495
* // row: [ // RetrievalResultContentRow
487496
* // { // RetrievalResultContentColumn
488497
* // columnName: "STRING_VALUE",
@@ -868,9 +877,17 @@ export interface InvokeInlineAgentCommandOutput extends InvokeInlineAgentRespons
868877
* // retrievedReferences: [
869878
* // {
870879
* // content: {
871-
* // type: "TEXT" || "IMAGE" || "ROW",
880+
* // type: "TEXT" || "IMAGE" || "ROW" || "AUDIO" || "VIDEO",
872881
* // text: "STRING_VALUE",
873882
* // byteContent: "STRING_VALUE",
883+
* // video: {
884+
* // s3Uri: "STRING_VALUE", // required
885+
* // summary: "STRING_VALUE",
886+
* // },
887+
* // audio: {
888+
* // s3Uri: "STRING_VALUE", // required
889+
* // transcription: "STRING_VALUE",
890+
* // },
874891
* // row: [
875892
* // {
876893
* // columnName: "STRING_VALUE",
@@ -1156,9 +1173,17 @@ export interface InvokeInlineAgentCommandOutput extends InvokeInlineAgentRespons
11561173
* // retrievedReferences: [
11571174
* // {
11581175
* // content: {
1159-
* // type: "TEXT" || "IMAGE" || "ROW",
1176+
* // type: "TEXT" || "IMAGE" || "ROW" || "AUDIO" || "VIDEO",
11601177
* // text: "STRING_VALUE",
11611178
* // byteContent: "STRING_VALUE",
1179+
* // video: {
1180+
* // s3Uri: "STRING_VALUE", // required
1181+
* // summary: "STRING_VALUE",
1182+
* // },
1183+
* // audio: {
1184+
* // s3Uri: "STRING_VALUE", // required
1185+
* // transcription: "STRING_VALUE",
1186+
* // },
11621187
* // row: [
11631188
* // {
11641189
* // columnName: "STRING_VALUE",

clients/client-bedrock-agent-runtime/src/commands/ListFlowExecutionEventsCommand.ts

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -497,9 +497,17 @@ export interface ListFlowExecutionEventsCommandOutput extends ListFlowExecutionE
497497
* // retrievedReferences: [ // RetrievedReferences
498498
* // { // RetrievedReference
499499
* // content: { // RetrievalResultContent
500-
* // type: "TEXT" || "IMAGE" || "ROW",
500+
* // type: "TEXT" || "IMAGE" || "ROW" || "AUDIO" || "VIDEO",
501501
* // text: "STRING_VALUE",
502502
* // byteContent: "STRING_VALUE",
503+
* // video: { // VideoSegment
504+
* // s3Uri: "STRING_VALUE", // required
505+
* // summary: "STRING_VALUE",
506+
* // },
507+
* // audio: { // AudioSegment
508+
* // s3Uri: "STRING_VALUE", // required
509+
* // transcription: "STRING_VALUE",
510+
* // },
503511
* // row: [ // RetrievalResultContentRow
504512
* // { // RetrievalResultContentColumn
505513
* // columnName: "STRING_VALUE",
@@ -785,9 +793,17 @@ export interface ListFlowExecutionEventsCommandOutput extends ListFlowExecutionE
785793
* // retrievedReferences: [
786794
* // {
787795
* // content: {
788-
* // type: "TEXT" || "IMAGE" || "ROW",
796+
* // type: "TEXT" || "IMAGE" || "ROW" || "AUDIO" || "VIDEO",
789797
* // text: "STRING_VALUE",
790798
* // byteContent: "STRING_VALUE",
799+
* // video: {
800+
* // s3Uri: "STRING_VALUE", // required
801+
* // summary: "STRING_VALUE",
802+
* // },
803+
* // audio: {
804+
* // s3Uri: "STRING_VALUE", // required
805+
* // transcription: "STRING_VALUE",
806+
* // },
791807
* // row: [
792808
* // {
793809
* // columnName: "STRING_VALUE",

clients/client-bedrock-agent-runtime/src/commands/RetrieveAndGenerateCommand.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -262,9 +262,17 @@ export interface RetrieveAndGenerateCommandOutput extends RetrieveAndGenerateRes
262262
* // retrievedReferences: [ // RetrievedReferences
263263
* // { // RetrievedReference
264264
* // content: { // RetrievalResultContent
265-
* // type: "TEXT" || "IMAGE" || "ROW",
265+
* // type: "TEXT" || "IMAGE" || "ROW" || "AUDIO" || "VIDEO",
266266
* // text: "STRING_VALUE",
267267
* // byteContent: "STRING_VALUE",
268+
* // video: { // VideoSegment
269+
* // s3Uri: "STRING_VALUE", // required
270+
* // summary: "STRING_VALUE",
271+
* // },
272+
* // audio: { // AudioSegment
273+
* // s3Uri: "STRING_VALUE", // required
274+
* // transcription: "STRING_VALUE",
275+
* // },
268276
* // row: [ // RetrievalResultContentRow
269277
* // { // RetrievalResultContentColumn
270278
* // columnName: "STRING_VALUE",

clients/client-bedrock-agent-runtime/src/commands/RetrieveAndGenerateStreamCommand.ts

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -262,9 +262,17 @@ export interface RetrieveAndGenerateStreamCommandOutput extends RetrieveAndGener
262262
* // retrievedReferences: [ // RetrievedReferences
263263
* // { // RetrievedReference
264264
* // content: { // RetrievalResultContent
265-
* // type: "TEXT" || "IMAGE" || "ROW",
265+
* // type: "TEXT" || "IMAGE" || "ROW" || "AUDIO" || "VIDEO",
266266
* // text: "STRING_VALUE",
267267
* // byteContent: "STRING_VALUE",
268+
* // video: { // VideoSegment
269+
* // s3Uri: "STRING_VALUE", // required
270+
* // summary: "STRING_VALUE",
271+
* // },
272+
* // audio: { // AudioSegment
273+
* // s3Uri: "STRING_VALUE", // required
274+
* // transcription: "STRING_VALUE",
275+
* // },
268276
* // row: [ // RetrievalResultContentRow
269277
* // { // RetrievalResultContentColumn
270278
* // columnName: "STRING_VALUE",
@@ -318,9 +326,17 @@ export interface RetrieveAndGenerateStreamCommandOutput extends RetrieveAndGener
318326
* // retrievedReferences: [
319327
* // {
320328
* // content: {
321-
* // type: "TEXT" || "IMAGE" || "ROW",
329+
* // type: "TEXT" || "IMAGE" || "ROW" || "AUDIO" || "VIDEO",
322330
* // text: "STRING_VALUE",
323331
* // byteContent: "STRING_VALUE",
332+
* // video: {
333+
* // s3Uri: "STRING_VALUE", // required
334+
* // summary: "STRING_VALUE",
335+
* // },
336+
* // audio: {
337+
* // s3Uri: "STRING_VALUE", // required
338+
* // transcription: "STRING_VALUE",
339+
* // },
324340
* // row: [
325341
* // {
326342
* // columnName: "STRING_VALUE",

clients/client-bedrock-agent-runtime/src/commands/RetrieveCommand.ts

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,12 @@ export interface RetrieveCommandOutput extends RetrieveResponse, __MetadataBeare
4343
* const input = { // RetrieveRequest
4444
* knowledgeBaseId: "STRING_VALUE", // required
4545
* retrievalQuery: { // KnowledgeBaseQuery
46-
* text: "STRING_VALUE", // required
46+
* type: "TEXT" || "IMAGE",
47+
* text: "STRING_VALUE",
48+
* image: { // InputImage
49+
* format: "png" || "jpeg" || "gif" || "webp", // required
50+
* inlineContent: new Uint8Array(), // e.g. Buffer.from("") or new TextEncoder().encode("") // required
51+
* },
4752
* },
4853
* retrievalConfiguration: { // KnowledgeBaseRetrievalConfiguration
4954
* vectorSearchConfiguration: { // KnowledgeBaseVectorSearchConfiguration
@@ -152,9 +157,17 @@ export interface RetrieveCommandOutput extends RetrieveResponse, __MetadataBeare
152157
* // retrievalResults: [ // KnowledgeBaseRetrievalResults // required
153158
* // { // KnowledgeBaseRetrievalResult
154159
* // content: { // RetrievalResultContent
155-
* // type: "TEXT" || "IMAGE" || "ROW",
160+
* // type: "TEXT" || "IMAGE" || "ROW" || "AUDIO" || "VIDEO",
156161
* // text: "STRING_VALUE",
157162
* // byteContent: "STRING_VALUE",
163+
* // video: { // VideoSegment
164+
* // s3Uri: "STRING_VALUE", // required
165+
* // summary: "STRING_VALUE",
166+
* // },
167+
* // audio: { // AudioSegment
168+
* // s3Uri: "STRING_VALUE", // required
169+
* // transcription: "STRING_VALUE",
170+
* // },
158171
* // row: [ // RetrievalResultContentRow
159172
* // { // RetrievalResultContentColumn
160173
* // columnName: "STRING_VALUE",

clients/client-bedrock-agent-runtime/src/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,6 @@ export * from "./pagination";
1616
export * from "./models/enums";
1717
export * from "./models/errors";
1818
export type * from "./models/models_0";
19+
export type * from "./models/models_1";
1920

2021
export { BedrockAgentRuntimeServiceException } from "./models/BedrockAgentRuntimeServiceException";

clients/client-bedrock-agent-runtime/src/models/enums.ts

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -382,9 +382,11 @@ export type RetrievalResultContentColumnType =
382382
* @enum
383383
*/
384384
export const RetrievalResultContentType = {
385+
AUDIO: "AUDIO",
385386
IMAGE: "IMAGE",
386387
ROW: "ROW",
387388
TEXT: "TEXT",
389+
VIDEO: "VIDEO",
388390
} as const;
389391
/**
390392
* @public
@@ -892,6 +894,34 @@ export const GuadrailAction = {
892894
*/
893895
export type GuadrailAction = (typeof GuadrailAction)[keyof typeof GuadrailAction];
894896

897+
/**
898+
* @public
899+
* @enum
900+
*/
901+
export const InputImageFormat = {
902+
gif: "gif",
903+
jpeg: "jpeg",
904+
png: "png",
905+
webp: "webp",
906+
} as const;
907+
/**
908+
* @public
909+
*/
910+
export type InputImageFormat = (typeof InputImageFormat)[keyof typeof InputImageFormat];
911+
912+
/**
913+
* @public
914+
* @enum
915+
*/
916+
export const KnowledgeBaseQueryType = {
917+
IMAGE: "IMAGE",
918+
TEXT: "TEXT",
919+
} as const;
920+
/**
921+
* @public
922+
*/
923+
export type KnowledgeBaseQueryType = (typeof KnowledgeBaseQueryType)[keyof typeof KnowledgeBaseQueryType];
924+
895925
/**
896926
* @public
897927
* @enum

0 commit comments

Comments
 (0)