Skip to content

Commit c7b79b5

Browse files
author
awstools
committedJan 31, 2025
feat(client-bedrock-agent-runtime): This change is to deprecate the existing citation field under RetrieveAndGenerateStream API response in lieu of GeneratedResponsePart and RetrievedReferences
1 parent 423ede1 commit c7b79b5

File tree

4 files changed

+93
-0
lines changed

4 files changed

+93
-0
lines changed
 

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

+55
Original file line numberDiff line numberDiff line change
@@ -314,6 +314,61 @@ export interface RetrieveAndGenerateStreamCommandOutput extends RetrieveAndGener
314314
* // },
315315
* // ],
316316
* // },
317+
* // generatedResponsePart: {
318+
* // textResponsePart: {
319+
* // text: "STRING_VALUE",
320+
* // span: {
321+
* // start: Number("int"),
322+
* // end: Number("int"),
323+
* // },
324+
* // },
325+
* // },
326+
* // retrievedReferences: [
327+
* // {
328+
* // content: {
329+
* // type: "TEXT" || "IMAGE" || "ROW",
330+
* // text: "STRING_VALUE",
331+
* // byteContent: "STRING_VALUE",
332+
* // row: [
333+
* // {
334+
* // columnName: "STRING_VALUE",
335+
* // columnValue: "STRING_VALUE",
336+
* // type: "BLOB" || "BOOLEAN" || "DOUBLE" || "NULL" || "LONG" || "STRING",
337+
* // },
338+
* // ],
339+
* // },
340+
* // location: {
341+
* // type: "S3" || "WEB" || "CONFLUENCE" || "SALESFORCE" || "SHAREPOINT" || "CUSTOM" || "KENDRA" || "SQL", // required
342+
* // s3Location: {
343+
* // uri: "STRING_VALUE",
344+
* // },
345+
* // webLocation: {
346+
* // url: "STRING_VALUE",
347+
* // },
348+
* // confluenceLocation: {
349+
* // url: "STRING_VALUE",
350+
* // },
351+
* // salesforceLocation: {
352+
* // url: "STRING_VALUE",
353+
* // },
354+
* // sharePointLocation: {
355+
* // url: "STRING_VALUE",
356+
* // },
357+
* // customDocumentLocation: {
358+
* // id: "STRING_VALUE",
359+
* // },
360+
* // kendraDocumentLocation: {
361+
* // uri: "STRING_VALUE",
362+
* // },
363+
* // sqlLocation: {
364+
* // query: "STRING_VALUE",
365+
* // },
366+
* // },
367+
* // metadata: {
368+
* // "<keys>": "DOCUMENT_VALUE",
369+
* // },
370+
* // },
371+
* // ],
317372
* // },
318373
* // guardrail: { // GuardrailEvent
319374
* // action: "INTERVENED" || "NONE",

‎clients/client-bedrock-agent-runtime/src/models/models_0.ts

+20
Original file line numberDiff line numberDiff line change
@@ -7556,10 +7556,24 @@ export interface RetrieveAndGenerateResponse {
75567556
*/
75577557
export interface CitationEvent {
75587558
/**
7559+
* @deprecated
7560+
*
75597561
* <p>The citation.</p>
75607562
* @public
75617563
*/
75627564
citation?: Citation | undefined;
7565+
7566+
/**
7567+
* <p>The generated response to the citation event.</p>
7568+
* @public
7569+
*/
7570+
generatedResponsePart?: GeneratedResponsePart | undefined;
7571+
7572+
/**
7573+
* <p>The retrieved references of the citation event.</p>
7574+
* @public
7575+
*/
7576+
retrievedReferences?: RetrievedReference[] | undefined;
75637577
}
75647578

75657579
/**
@@ -10222,6 +10236,12 @@ export const RetrieveAndGenerateResponseFilterSensitiveLog = (obj: RetrieveAndGe
1022210236
export const CitationEventFilterSensitiveLog = (obj: CitationEvent): any => ({
1022310237
...obj,
1022410238
...(obj.citation && { citation: CitationFilterSensitiveLog(obj.citation) }),
10239+
...(obj.generatedResponsePart && {
10240+
generatedResponsePart: GeneratedResponsePartFilterSensitiveLog(obj.generatedResponsePart),
10241+
}),
10242+
...(obj.retrievedReferences && {
10243+
retrievedReferences: obj.retrievedReferences.map((item) => RetrievedReferenceFilterSensitiveLog(item)),
10244+
}),
1022510245
});
1022610246

1022710247
/**

‎clients/client-bedrock-agent-runtime/src/protocols/Aws_restJson1.ts

+2
Original file line numberDiff line numberDiff line change
@@ -2255,6 +2255,8 @@ const de_Citation = (output: any, context: __SerdeContext): Citation => {
22552255
const de_CitationEvent = (output: any, context: __SerdeContext): CitationEvent => {
22562256
return take(output, {
22572257
citation: (_: any) => de_Citation(_, context),
2258+
generatedResponsePart: _json,
2259+
retrievedReferences: (_: any) => de_RetrievedReferences(_, context),
22582260
}) as any;
22592261
};
22602262

‎codegen/sdk-codegen/aws-models/bedrock-agent-runtime.json

+16
Original file line numberDiff line numberDiff line change
@@ -1567,8 +1567,24 @@
15671567
"citation": {
15681568
"target": "com.amazonaws.bedrockagentruntime#Citation",
15691569
"traits": {
1570+
"smithy.api#deprecated": {
1571+
"since": "2024-12-17",
1572+
"message": "Citation is deprecated. Please use GeneratedResponsePart and RetrievedReferences for citation event."
1573+
},
15701574
"smithy.api#documentation": "<p>The citation.</p>"
15711575
}
1576+
},
1577+
"generatedResponsePart": {
1578+
"target": "com.amazonaws.bedrockagentruntime#GeneratedResponsePart",
1579+
"traits": {
1580+
"smithy.api#documentation": "<p>The generated response to the citation event.</p>"
1581+
}
1582+
},
1583+
"retrievedReferences": {
1584+
"target": "com.amazonaws.bedrockagentruntime#RetrievedReferences",
1585+
"traits": {
1586+
"smithy.api#documentation": "<p>The retrieved references of the citation event.</p>"
1587+
}
15721588
}
15731589
},
15741590
"traits": {

0 commit comments

Comments
 (0)