Skip to content

Commit

Permalink
feat(client-bedrock-agent-runtime): This change is to deprecate the e…
Browse files Browse the repository at this point in the history
…xisting citation field under RetrieveAndGenerateStream API response in lieu of GeneratedResponsePart and RetrievedReferences
  • Loading branch information
awstools committed Jan 31, 2025
1 parent 423ede1 commit c7b79b5
Show file tree
Hide file tree
Showing 4 changed files with 93 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -314,6 +314,61 @@ export interface RetrieveAndGenerateStreamCommandOutput extends RetrieveAndGener
* // },
* // ],
* // },
* // generatedResponsePart: {
* // textResponsePart: {
* // text: "STRING_VALUE",
* // span: {
* // start: Number("int"),
* // end: Number("int"),
* // },
* // },
* // },
* // retrievedReferences: [
* // {
* // content: {
* // type: "TEXT" || "IMAGE" || "ROW",
* // text: "STRING_VALUE",
* // byteContent: "STRING_VALUE",
* // row: [
* // {
* // columnName: "STRING_VALUE",
* // columnValue: "STRING_VALUE",
* // type: "BLOB" || "BOOLEAN" || "DOUBLE" || "NULL" || "LONG" || "STRING",
* // },
* // ],
* // },
* // location: {
* // type: "S3" || "WEB" || "CONFLUENCE" || "SALESFORCE" || "SHAREPOINT" || "CUSTOM" || "KENDRA" || "SQL", // required
* // s3Location: {
* // uri: "STRING_VALUE",
* // },
* // webLocation: {
* // url: "STRING_VALUE",
* // },
* // confluenceLocation: {
* // url: "STRING_VALUE",
* // },
* // salesforceLocation: {
* // url: "STRING_VALUE",
* // },
* // sharePointLocation: {
* // url: "STRING_VALUE",
* // },
* // customDocumentLocation: {
* // id: "STRING_VALUE",
* // },
* // kendraDocumentLocation: {
* // uri: "STRING_VALUE",
* // },
* // sqlLocation: {
* // query: "STRING_VALUE",
* // },
* // },
* // metadata: {
* // "<keys>": "DOCUMENT_VALUE",
* // },
* // },
* // ],
* // },
* // guardrail: { // GuardrailEvent
* // action: "INTERVENED" || "NONE",
Expand Down
20 changes: 20 additions & 0 deletions clients/client-bedrock-agent-runtime/src/models/models_0.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7556,10 +7556,24 @@ export interface RetrieveAndGenerateResponse {
*/
export interface CitationEvent {
/**
* @deprecated
*
* <p>The citation.</p>
* @public
*/
citation?: Citation | undefined;

/**
* <p>The generated response to the citation event.</p>
* @public
*/
generatedResponsePart?: GeneratedResponsePart | undefined;

/**
* <p>The retrieved references of the citation event.</p>
* @public
*/
retrievedReferences?: RetrievedReference[] | undefined;
}

/**
Expand Down Expand Up @@ -10222,6 +10236,12 @@ export const RetrieveAndGenerateResponseFilterSensitiveLog = (obj: RetrieveAndGe
export const CitationEventFilterSensitiveLog = (obj: CitationEvent): any => ({
...obj,
...(obj.citation && { citation: CitationFilterSensitiveLog(obj.citation) }),
...(obj.generatedResponsePart && {
generatedResponsePart: GeneratedResponsePartFilterSensitiveLog(obj.generatedResponsePart),
}),
...(obj.retrievedReferences && {
retrievedReferences: obj.retrievedReferences.map((item) => RetrievedReferenceFilterSensitiveLog(item)),
}),
});

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2255,6 +2255,8 @@ const de_Citation = (output: any, context: __SerdeContext): Citation => {
const de_CitationEvent = (output: any, context: __SerdeContext): CitationEvent => {
return take(output, {
citation: (_: any) => de_Citation(_, context),
generatedResponsePart: _json,
retrievedReferences: (_: any) => de_RetrievedReferences(_, context),
}) as any;
};

Expand Down
16 changes: 16 additions & 0 deletions codegen/sdk-codegen/aws-models/bedrock-agent-runtime.json
Original file line number Diff line number Diff line change
Expand Up @@ -1567,8 +1567,24 @@
"citation": {
"target": "com.amazonaws.bedrockagentruntime#Citation",
"traits": {
"smithy.api#deprecated": {
"since": "2024-12-17",
"message": "Citation is deprecated. Please use GeneratedResponsePart and RetrievedReferences for citation event."
},
"smithy.api#documentation": "<p>The citation.</p>"
}
},
"generatedResponsePart": {
"target": "com.amazonaws.bedrockagentruntime#GeneratedResponsePart",
"traits": {
"smithy.api#documentation": "<p>The generated response to the citation event.</p>"
}
},
"retrievedReferences": {
"target": "com.amazonaws.bedrockagentruntime#RetrievedReferences",
"traits": {
"smithy.api#documentation": "<p>The retrieved references of the citation event.</p>"
}
}
},
"traits": {
Expand Down

0 comments on commit c7b79b5

Please sign in to comment.