From 93a1fe5f9d8fbf7cd0629abc97b48e0f51dae8eb Mon Sep 17 00:00:00 2001 From: awstools Date: Fri, 1 Dec 2023 20:04:24 +0000 Subject: [PATCH] feat(client-qconnect): This release adds the PutFeedback API and allows providing feedback against the specified assistant for the specified target. --- clients/client-qconnect/README.md | 15 ++ clients/client-qconnect/src/QConnect.ts | 22 ++- clients/client-qconnect/src/QConnectClient.ts | 12 +- .../commands/CreateQuickResponseCommand.ts | 2 +- .../src/commands/PutFeedbackCommand.ts | 161 ++++++++++++++++ .../commands/SearchQuickResponsesCommand.ts | 2 +- clients/client-qconnect/src/commands/index.ts | 1 + clients/client-qconnect/src/index.ts | 9 +- .../client-qconnect/src/models/models_0.ts | 147 ++++++++++++++- .../src/protocols/Aws_restJson1.ts | 101 ++++++++++ codegen/sdk-codegen/aws-models/qconnect.json | 178 +++++++++++++++++- 11 files changed, 640 insertions(+), 10 deletions(-) create mode 100644 clients/client-qconnect/src/commands/PutFeedbackCommand.ts diff --git a/clients/client-qconnect/README.md b/clients/client-qconnect/README.md index d67cee47b0ae..0f97a12b7b7e 100644 --- a/clients/client-qconnect/README.md +++ b/clients/client-qconnect/README.md @@ -6,6 +6,13 @@ AWS SDK for JavaScript QConnect Client for Node.js, Browser and React Native. + +

+Powered by Amazon Bedrock: Amazon Web Services implements automated abuse +detection. Because Amazon Q in Connect is built on Amazon Bedrock, users can take full +advantage of the controls implemented in Amazon Bedrock to enforce safety, security, and the +responsible use of artificial intelligence (AI).

+

Amazon Q in Connect is a generative AI customer service assistant. It is an LLM-enhanced evolution of Amazon Connect Wisdom that delivers real-time recommendations to help contact center agents resolve customer issues quickly and accurately.

@@ -446,6 +453,14 @@ NotifyRecommendationsReceived [Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/qconnect/command/NotifyRecommendationsReceivedCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-qconnect/Interface/NotifyRecommendationsReceivedCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-qconnect/Interface/NotifyRecommendationsReceivedCommandOutput/) + +
+ +PutFeedback + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/qconnect/command/PutFeedbackCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-qconnect/Interface/PutFeedbackCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-qconnect/Interface/PutFeedbackCommandOutput/) +
diff --git a/clients/client-qconnect/src/QConnect.ts b/clients/client-qconnect/src/QConnect.ts index c6fbe7c2f420..e958d32c3a1a 100644 --- a/clients/client-qconnect/src/QConnect.ts +++ b/clients/client-qconnect/src/QConnect.ts @@ -139,6 +139,7 @@ import { NotifyRecommendationsReceivedCommandInput, NotifyRecommendationsReceivedCommandOutput, } from "./commands/NotifyRecommendationsReceivedCommand"; +import { PutFeedbackCommand, PutFeedbackCommandInput, PutFeedbackCommandOutput } from "./commands/PutFeedbackCommand"; import { QueryAssistantCommand, QueryAssistantCommandInput, @@ -227,6 +228,7 @@ const commands = { ListQuickResponsesCommand, ListTagsForResourceCommand, NotifyRecommendationsReceivedCommand, + PutFeedbackCommand, QueryAssistantCommand, RemoveKnowledgeBaseTemplateUriCommand, SearchContentCommand, @@ -672,6 +674,17 @@ export interface QConnect { cb: (err: any, data?: NotifyRecommendationsReceivedCommandOutput) => void ): void; + /** + * @see {@link PutFeedbackCommand} + */ + putFeedback(args: PutFeedbackCommandInput, options?: __HttpHandlerOptions): Promise; + putFeedback(args: PutFeedbackCommandInput, cb: (err: any, data?: PutFeedbackCommandOutput) => void): void; + putFeedback( + args: PutFeedbackCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: PutFeedbackCommandOutput) => void + ): void; + /** * @see {@link QueryAssistantCommand} */ @@ -846,7 +859,14 @@ export interface QConnect { /** * @public - *

Amazon Q in Connect is a generative AI customer service assistant. It is an LLM-enhanced evolution + * + *

+ * Powered by Amazon Bedrock: Amazon Web Services implements automated abuse + * detection. Because Amazon Q in Connect is built on Amazon Bedrock, users can take full + * advantage of the controls implemented in Amazon Bedrock to enforce safety, security, and the + * responsible use of artificial intelligence (AI).

+ * + *

Amazon Q in Connect is a generative AI customer service assistant. It is an LLM-enhanced evolution * of Amazon Connect Wisdom that delivers real-time recommendations to help contact center * agents resolve customer issues quickly and accurately.

*

Amazon Q automatically detects customer intent during calls and chats using diff --git a/clients/client-qconnect/src/QConnectClient.ts b/clients/client-qconnect/src/QConnectClient.ts index 80d63b71560e..20a6dca0752d 100644 --- a/clients/client-qconnect/src/QConnectClient.ts +++ b/clients/client-qconnect/src/QConnectClient.ts @@ -109,6 +109,7 @@ import { NotifyRecommendationsReceivedCommandInput, NotifyRecommendationsReceivedCommandOutput, } from "./commands/NotifyRecommendationsReceivedCommand"; +import { PutFeedbackCommandInput, PutFeedbackCommandOutput } from "./commands/PutFeedbackCommand"; import { QueryAssistantCommandInput, QueryAssistantCommandOutput } from "./commands/QueryAssistantCommand"; import { RemoveKnowledgeBaseTemplateUriCommandInput, @@ -177,6 +178,7 @@ export type ServiceInputTypes = | ListQuickResponsesCommandInput | ListTagsForResourceCommandInput | NotifyRecommendationsReceivedCommandInput + | PutFeedbackCommandInput | QueryAssistantCommandInput | RemoveKnowledgeBaseTemplateUriCommandInput | SearchContentCommandInput @@ -223,6 +225,7 @@ export type ServiceOutputTypes = | ListQuickResponsesCommandOutput | ListTagsForResourceCommandOutput | NotifyRecommendationsReceivedCommandOutput + | PutFeedbackCommandOutput | QueryAssistantCommandOutput | RemoveKnowledgeBaseTemplateUriCommandOutput | SearchContentCommandOutput @@ -408,7 +411,14 @@ export interface QConnectClientResolvedConfig extends QConnectClientResolvedConf /** * @public - *

Amazon Q in Connect is a generative AI customer service assistant. It is an LLM-enhanced evolution + * + *

+ * Powered by Amazon Bedrock: Amazon Web Services implements automated abuse + * detection. Because Amazon Q in Connect is built on Amazon Bedrock, users can take full + * advantage of the controls implemented in Amazon Bedrock to enforce safety, security, and the + * responsible use of artificial intelligence (AI).

+ * + *

Amazon Q in Connect is a generative AI customer service assistant. It is an LLM-enhanced evolution * of Amazon Connect Wisdom that delivers real-time recommendations to help contact center * agents resolve customer issues quickly and accurately.

*

Amazon Q automatically detects customer intent during calls and chats using diff --git a/clients/client-qconnect/src/commands/CreateQuickResponseCommand.ts b/clients/client-qconnect/src/commands/CreateQuickResponseCommand.ts index 8ec95de301de..29a04cdad459 100644 --- a/clients/client-qconnect/src/commands/CreateQuickResponseCommand.ts +++ b/clients/client-qconnect/src/commands/CreateQuickResponseCommand.ts @@ -42,7 +42,7 @@ export interface CreateQuickResponseCommandOutput extends CreateQuickResponseRes /** * @public - *

Creates a Amazon Q quick response.

+ *

Creates an Amazon Q quick response.

* @example * Use a bare-bones client and the command you need to make an API call. * ```javascript diff --git a/clients/client-qconnect/src/commands/PutFeedbackCommand.ts b/clients/client-qconnect/src/commands/PutFeedbackCommand.ts new file mode 100644 index 000000000000..81458310bda8 --- /dev/null +++ b/clients/client-qconnect/src/commands/PutFeedbackCommand.ts @@ -0,0 +1,161 @@ +// smithy-typescript generated code +import { EndpointParameterInstructions, getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { getSerdePlugin } from "@smithy/middleware-serde"; +import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; +import { Command as $Command } from "@smithy/smithy-client"; +import { + FinalizeHandlerArguments, + Handler, + HandlerExecutionContext, + HttpHandlerOptions as __HttpHandlerOptions, + MetadataBearer as __MetadataBearer, + MiddlewareStack, + SerdeContext as __SerdeContext, + SMITHY_CONTEXT_KEY, +} from "@smithy/types"; + +import { PutFeedbackRequest, PutFeedbackResponse } from "../models/models_0"; +import { de_PutFeedbackCommand, se_PutFeedbackCommand } from "../protocols/Aws_restJson1"; +import { QConnectClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../QConnectClient"; + +/** + * @public + */ +export { __MetadataBearer, $Command }; +/** + * @public + * + * The input for {@link PutFeedbackCommand}. + */ +export interface PutFeedbackCommandInput extends PutFeedbackRequest {} +/** + * @public + * + * The output of {@link PutFeedbackCommand}. + */ +export interface PutFeedbackCommandOutput extends PutFeedbackResponse, __MetadataBearer {} + +/** + * @public + *

Provides feedback against the specified assistant for the specified target. This API only supports generative targets.

+ * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { QConnectClient, PutFeedbackCommand } from "@aws-sdk/client-qconnect"; // ES Modules import + * // const { QConnectClient, PutFeedbackCommand } = require("@aws-sdk/client-qconnect"); // CommonJS import + * const client = new QConnectClient(config); + * const input = { // PutFeedbackRequest + * assistantId: "STRING_VALUE", // required + * targetId: "STRING_VALUE", // required + * targetType: "STRING_VALUE", // required + * contentFeedback: { // ContentFeedbackData Union: only one key present + * generativeContentFeedbackData: { // GenerativeContentFeedbackData + * relevance: "STRING_VALUE", // required + * }, + * }, + * }; + * const command = new PutFeedbackCommand(input); + * const response = await client.send(command); + * // { // PutFeedbackResponse + * // assistantId: "STRING_VALUE", // required + * // assistantArn: "STRING_VALUE", // required + * // targetId: "STRING_VALUE", // required + * // targetType: "STRING_VALUE", // required + * // contentFeedback: { // ContentFeedbackData Union: only one key present + * // generativeContentFeedbackData: { // GenerativeContentFeedbackData + * // relevance: "STRING_VALUE", // required + * // }, + * // }, + * // }; + * + * ``` + * + * @param PutFeedbackCommandInput - {@link PutFeedbackCommandInput} + * @returns {@link PutFeedbackCommandOutput} + * @see {@link PutFeedbackCommandInput} for command's `input` shape. + * @see {@link PutFeedbackCommandOutput} for command's `response` shape. + * @see {@link QConnectClientResolvedConfig | config} for QConnectClient's `config` shape. + * + * @throws {@link AccessDeniedException} (client fault) + *

You do not have sufficient access to perform this action.

+ * + * @throws {@link ResourceNotFoundException} (client fault) + *

The specified resource does not exist.

+ * + * @throws {@link ValidationException} (client fault) + *

The input fails to satisfy the constraints specified by a service.

+ * + * @throws {@link QConnectServiceException} + *

Base exception class for all service exceptions from QConnect service.

+ * + */ +export class PutFeedbackCommand extends $Command< + PutFeedbackCommandInput, + PutFeedbackCommandOutput, + QConnectClientResolvedConfig +> { + public static getEndpointParameterInstructions(): EndpointParameterInstructions { + return { + UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, + Endpoint: { type: "builtInParams", name: "endpoint" }, + Region: { type: "builtInParams", name: "region" }, + UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }, + }; + } + + /** + * @public + */ + constructor(readonly input: PutFeedbackCommandInput) { + super(); + } + + /** + * @internal + */ + resolveMiddleware( + clientStack: MiddlewareStack, + configuration: QConnectClientResolvedConfig, + options?: __HttpHandlerOptions + ): Handler { + this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize)); + this.middlewareStack.use(getEndpointPlugin(configuration, PutFeedbackCommand.getEndpointParameterInstructions())); + + const stack = clientStack.concat(this.middlewareStack); + + const { logger } = configuration; + const clientName = "QConnectClient"; + const commandName = "PutFeedbackCommand"; + const handlerExecutionContext: HandlerExecutionContext = { + logger, + clientName, + commandName, + inputFilterSensitiveLog: (_: any) => _, + outputFilterSensitiveLog: (_: any) => _, + [SMITHY_CONTEXT_KEY]: { + service: "WisdomService", + operation: "PutFeedback", + }, + }; + const { requestHandler } = configuration; + return stack.resolve( + (request: FinalizeHandlerArguments) => + requestHandler.handle(request.request as __HttpRequest, options || {}), + handlerExecutionContext + ); + } + + /** + * @internal + */ + private serialize(input: PutFeedbackCommandInput, context: __SerdeContext): Promise<__HttpRequest> { + return se_PutFeedbackCommand(input, context); + } + + /** + * @internal + */ + private deserialize(output: __HttpResponse, context: __SerdeContext): Promise { + return de_PutFeedbackCommand(output, context); + } +} diff --git a/clients/client-qconnect/src/commands/SearchQuickResponsesCommand.ts b/clients/client-qconnect/src/commands/SearchQuickResponsesCommand.ts index 6486530c8d0c..39545a6a7366 100644 --- a/clients/client-qconnect/src/commands/SearchQuickResponsesCommand.ts +++ b/clients/client-qconnect/src/commands/SearchQuickResponsesCommand.ts @@ -42,7 +42,7 @@ export interface SearchQuickResponsesCommandOutput extends SearchQuickResponsesR /** * @public - *

Searches existing Amazon Q quick responses in a Amazon Q knowledge base.

+ *

Searches existing Amazon Q quick responses in an Amazon Q knowledge base.

* @example * Use a bare-bones client and the command you need to make an API call. * ```javascript diff --git a/clients/client-qconnect/src/commands/index.ts b/clients/client-qconnect/src/commands/index.ts index 37d76f0ba599..bfe90ad655e8 100644 --- a/clients/client-qconnect/src/commands/index.ts +++ b/clients/client-qconnect/src/commands/index.ts @@ -28,6 +28,7 @@ export * from "./ListKnowledgeBasesCommand"; export * from "./ListQuickResponsesCommand"; export * from "./ListTagsForResourceCommand"; export * from "./NotifyRecommendationsReceivedCommand"; +export * from "./PutFeedbackCommand"; export * from "./QueryAssistantCommand"; export * from "./RemoveKnowledgeBaseTemplateUriCommand"; export * from "./SearchContentCommand"; diff --git a/clients/client-qconnect/src/index.ts b/clients/client-qconnect/src/index.ts index 07bcfc7eb4a7..8c9ee7af3069 100644 --- a/clients/client-qconnect/src/index.ts +++ b/clients/client-qconnect/src/index.ts @@ -1,7 +1,14 @@ // smithy-typescript generated code /* eslint-disable */ /** - *

Amazon Q in Connect is a generative AI customer service assistant. It is an LLM-enhanced evolution + * + *

+ * Powered by Amazon Bedrock: Amazon Web Services implements automated abuse + * detection. Because Amazon Q in Connect is built on Amazon Bedrock, users can take full + * advantage of the controls implemented in Amazon Bedrock to enforce safety, security, and the + * responsible use of artificial intelligence (AI).

+ * + *

Amazon Q in Connect is a generative AI customer service assistant. It is an LLM-enhanced evolution * of Amazon Connect Wisdom that delivers real-time recommendations to help contact center * agents resolve customer issues quickly and accurately.

*

Amazon Q automatically detects customer intent during calls and chats using diff --git a/clients/client-qconnect/src/models/models_0.ts b/clients/client-qconnect/src/models/models_0.ts index b6347d97f290..04c7d32b6278 100644 --- a/clients/client-qconnect/src/models/models_0.ts +++ b/clients/client-qconnect/src/models/models_0.ts @@ -636,7 +636,7 @@ export type AssistantCapabilityType = (typeof AssistantCapabilityType)[keyof typ /** * @public - *

The capability configuration for a Amazon Q assistant.

+ *

The capability configuration for an Amazon Q assistant.

*/ export interface AssistantCapabilityConfiguration { /** @@ -1421,6 +1421,151 @@ export interface NotifyRecommendationsReceivedResponse { errors?: NotifyRecommendationsReceivedError[]; } +/** + * @public + * @enum + */ +export const Relevance = { + HELPFUL: "HELPFUL", + NOT_HELPFUL: "NOT_HELPFUL", +} as const; + +/** + * @public + */ +export type Relevance = (typeof Relevance)[keyof typeof Relevance]; + +/** + * @public + *

The feedback information for a generative target type.

+ */ +export interface GenerativeContentFeedbackData { + /** + * @public + *

The relevance of the feedback.

+ */ + relevance: Relevance | undefined; +} + +/** + * @public + *

Information about the feedback.

+ */ +export type ContentFeedbackData = + | ContentFeedbackData.GenerativeContentFeedbackDataMember + | ContentFeedbackData.$UnknownMember; + +/** + * @public + */ +export namespace ContentFeedbackData { + /** + * @public + *

Information about the feedback for a generative target type.

+ */ + export interface GenerativeContentFeedbackDataMember { + generativeContentFeedbackData: GenerativeContentFeedbackData; + $unknown?: never; + } + + /** + * @public + */ + export interface $UnknownMember { + generativeContentFeedbackData?: never; + $unknown: [string, any]; + } + + export interface Visitor { + generativeContentFeedbackData: (value: GenerativeContentFeedbackData) => T; + _: (name: string, value: any) => T; + } + + export const visit = (value: ContentFeedbackData, visitor: Visitor): T => { + if (value.generativeContentFeedbackData !== undefined) + return visitor.generativeContentFeedbackData(value.generativeContentFeedbackData); + return visitor._(value.$unknown[0], value.$unknown[1]); + }; +} + +/** + * @public + * @enum + */ +export const TargetType = { + RECOMMENDATION: "RECOMMENDATION", + RESULT: "RESULT", +} as const; + +/** + * @public + */ +export type TargetType = (typeof TargetType)[keyof typeof TargetType]; + +/** + * @public + */ +export interface PutFeedbackRequest { + /** + * @public + *

The identifier of the Amazon Q assistant.

+ */ + assistantId: string | undefined; + + /** + * @public + *

The identifier of the feedback target.

+ */ + targetId: string | undefined; + + /** + * @public + *

The type of the feedback target.

+ */ + targetType: TargetType | undefined; + + /** + * @public + *

Information about the feedback provided.

+ */ + contentFeedback: ContentFeedbackData | undefined; +} + +/** + * @public + */ +export interface PutFeedbackResponse { + /** + * @public + *

The identifier of the Amazon Q assistant.

+ */ + assistantId: string | undefined; + + /** + * @public + *

The Amazon Resource Name (ARN) of the Amazon Q assistant.

+ */ + assistantArn: string | undefined; + + /** + * @public + *

The identifier of the feedback target.

+ */ + targetId: string | undefined; + + /** + * @public + *

The type of the feedback target.

+ */ + targetType: TargetType | undefined; + + /** + * @public + *

Information about the feedback provided.

+ */ + contentFeedback: ContentFeedbackData | undefined; +} + /** * @public * @enum diff --git a/clients/client-qconnect/src/protocols/Aws_restJson1.ts b/clients/client-qconnect/src/protocols/Aws_restJson1.ts index 088c76815c56..8f28b60fda14 100644 --- a/clients/client-qconnect/src/protocols/Aws_restJson1.ts +++ b/clients/client-qconnect/src/protocols/Aws_restJson1.ts @@ -84,6 +84,7 @@ import { NotifyRecommendationsReceivedCommandInput, NotifyRecommendationsReceivedCommandOutput, } from "../commands/NotifyRecommendationsReceivedCommand"; +import { PutFeedbackCommandInput, PutFeedbackCommandOutput } from "../commands/PutFeedbackCommand"; import { QueryAssistantCommandInput, QueryAssistantCommandOutput } from "../commands/QueryAssistantCommand"; import { RemoveKnowledgeBaseTemplateUriCommandInput, @@ -117,10 +118,12 @@ import { ConnectConfiguration, ContentData, ContentDataDetails, + ContentFeedbackData, DataDetails, DataSummary, ExternalSourceConfiguration, Filter, + GenerativeContentFeedbackData, GenerativeDataDetails, GroupingConfiguration, ImportJobData, @@ -1113,6 +1116,39 @@ export const se_NotifyRecommendationsReceivedCommand = async ( }); }; +/** + * serializeAws_restJson1PutFeedbackCommand + */ +export const se_PutFeedbackCommand = async ( + input: PutFeedbackCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const { hostname, protocol = "https", port, path: basePath } = await context.endpoint(); + const headers: any = { + "content-type": "application/json", + }; + let resolvedPath = + `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/assistants/{assistantId}/feedback"; + resolvedPath = __resolvedPath(resolvedPath, input, "assistantId", () => input.assistantId!, "{assistantId}", false); + let body: any; + body = JSON.stringify( + take(input, { + contentFeedback: (_) => _json(_), + targetId: [], + targetType: [], + }) + ); + return new __HttpRequest({ + protocol, + hostname, + port, + method: "PUT", + headers, + path: resolvedPath, + body, + }); +}; + /** * serializeAws_restJson1QueryAssistantCommand */ @@ -3124,6 +3160,63 @@ const de_NotifyRecommendationsReceivedCommandError = async ( } }; +/** + * deserializeAws_restJson1PutFeedbackCommand + */ +export const de_PutFeedbackCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_PutFeedbackCommandError(output, context); + } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + assistantArn: __expectString, + assistantId: __expectString, + contentFeedback: (_) => _json(__expectUnion(_)), + targetId: __expectString, + targetType: __expectString, + }); + Object.assign(contents, doc); + return contents; +}; + +/** + * deserializeAws_restJson1PutFeedbackCommandError + */ +const de_PutFeedbackCommandError = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + const parsedOutput: any = { + ...output, + body: await parseErrorBody(output.body, context), + }; + const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); + switch (errorCode) { + case "AccessDeniedException": + case "com.amazonaws.qconnect#AccessDeniedException": + throw await de_AccessDeniedExceptionRes(parsedOutput, context); + case "ResourceNotFoundException": + case "com.amazonaws.qconnect#ResourceNotFoundException": + throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); + case "ValidationException": + case "com.amazonaws.qconnect#ValidationException": + throw await de_ValidationExceptionRes(parsedOutput, context); + default: + const parsedBody = parsedOutput.body; + return throwDefaultError({ + output, + parsedBody, + errorCode, + }); + } +}; + /** * deserializeAws_restJson1QueryAssistantCommand */ @@ -3936,6 +4029,8 @@ const de_ValidationExceptionRes = async (parsedOutput: any, context: __SerdeCont // se_ContactAttributes omitted. +// se_ContentFeedbackData omitted. + // se_ContentMetadata omitted. // se_ExternalSourceConfiguration omitted. @@ -3944,6 +4039,8 @@ const de_ValidationExceptionRes = async (parsedOutput: any, context: __SerdeCont // se_FilterList omitted. +// se_GenerativeContentFeedbackData omitted. + // se_GroupingConfiguration omitted. // se_GroupingValues omitted. @@ -4046,6 +4143,8 @@ const de_ContentDataDetails = (output: any, context: __SerdeContext): ContentDat }) as any; }; +// de_ContentFeedbackData omitted. + // de_ContentMetadata omitted. // de_ContentReference omitted. @@ -4106,6 +4205,8 @@ const de_DataSummaryList = (output: any, context: __SerdeContext): DataSummary[] // de_ExternalSourceConfiguration omitted. +// de_GenerativeContentFeedbackData omitted. + /** * deserializeAws_restJson1GenerativeDataDetails */ diff --git a/codegen/sdk-codegen/aws-models/qconnect.json b/codegen/sdk-codegen/aws-models/qconnect.json index fb2131b4dfc6..81b693472a35 100644 --- a/codegen/sdk-codegen/aws-models/qconnect.json +++ b/codegen/sdk-codegen/aws-models/qconnect.json @@ -67,6 +67,9 @@ { "target": "com.amazonaws.qconnect#NotifyRecommendationsReceived" }, + { + "target": "com.amazonaws.qconnect#PutFeedback" + }, { "target": "com.amazonaws.qconnect#QueryAssistant" }, @@ -287,7 +290,7 @@ } }, "traits": { - "smithy.api#documentation": "

The capability configuration for a Amazon Q assistant.

" + "smithy.api#documentation": "

The capability configuration for an Amazon Q assistant.

" } }, "com.amazonaws.qconnect#AssistantCapabilityType": { @@ -793,6 +796,20 @@ "smithy.api#documentation": "

Details about the content data.

" } }, + "com.amazonaws.qconnect#ContentFeedbackData": { + "type": "union", + "members": { + "generativeContentFeedbackData": { + "target": "com.amazonaws.qconnect#GenerativeContentFeedbackData", + "traits": { + "smithy.api#documentation": "

Information about the feedback for a generative target type.

" + } + } + }, + "traits": { + "smithy.api#documentation": "

Information about the feedback.

" + } + }, "com.amazonaws.qconnect#ContentMetadata": { "type": "map", "key": { @@ -1386,7 +1403,7 @@ } ], "traits": { - "smithy.api#documentation": "

Creates a Amazon Q quick response.

", + "smithy.api#documentation": "

Creates an Amazon Q quick response.

", "smithy.api#http": { "uri": "/knowledgeBases/{knowledgeBaseId}/quickResponses", "method": "POST" @@ -2115,6 +2132,21 @@ ] } }, + "com.amazonaws.qconnect#GenerativeContentFeedbackData": { + "type": "structure", + "members": { + "relevance": { + "target": "com.amazonaws.qconnect#Relevance", + "traits": { + "smithy.api#documentation": "

The relevance of the feedback.

", + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#documentation": "

The feedback information for a generative target type.

" + } + }, "com.amazonaws.qconnect#GenerativeDataDetails": { "type": "structure", "members": { @@ -4072,6 +4104,114 @@ ] } }, + "com.amazonaws.qconnect#PutFeedback": { + "type": "operation", + "input": { + "target": "com.amazonaws.qconnect#PutFeedbackRequest" + }, + "output": { + "target": "com.amazonaws.qconnect#PutFeedbackResponse" + }, + "errors": [ + { + "target": "com.amazonaws.qconnect#AccessDeniedException" + }, + { + "target": "com.amazonaws.qconnect#ResourceNotFoundException" + }, + { + "target": "com.amazonaws.qconnect#ValidationException" + } + ], + "traits": { + "smithy.api#documentation": "

Provides feedback against the specified assistant for the specified target. This API only supports generative targets.

", + "smithy.api#http": { + "uri": "/assistants/{assistantId}/feedback", + "method": "PUT" + }, + "smithy.api#idempotent": {} + } + }, + "com.amazonaws.qconnect#PutFeedbackRequest": { + "type": "structure", + "members": { + "assistantId": { + "target": "com.amazonaws.qconnect#UuidOrArn", + "traits": { + "smithy.api#documentation": "

The identifier of the Amazon Q assistant.

", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "targetId": { + "target": "com.amazonaws.qconnect#Uuid", + "traits": { + "smithy.api#documentation": "

The identifier of the feedback target.

", + "smithy.api#required": {} + } + }, + "targetType": { + "target": "com.amazonaws.qconnect#TargetType", + "traits": { + "smithy.api#documentation": "

The type of the feedback target.

", + "smithy.api#required": {} + } + }, + "contentFeedback": { + "target": "com.amazonaws.qconnect#ContentFeedbackData", + "traits": { + "smithy.api#documentation": "

Information about the feedback provided.

", + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.amazonaws.qconnect#PutFeedbackResponse": { + "type": "structure", + "members": { + "assistantId": { + "target": "com.amazonaws.qconnect#Uuid", + "traits": { + "smithy.api#documentation": "

The identifier of the Amazon Q assistant.

", + "smithy.api#required": {} + } + }, + "assistantArn": { + "target": "com.amazonaws.qconnect#UuidOrArn", + "traits": { + "smithy.api#documentation": "

The Amazon Resource Name (ARN) of the Amazon Q assistant.

", + "smithy.api#required": {} + } + }, + "targetId": { + "target": "com.amazonaws.qconnect#Uuid", + "traits": { + "smithy.api#documentation": "

The identifier of the feedback target.

", + "smithy.api#required": {} + } + }, + "targetType": { + "target": "com.amazonaws.qconnect#TargetType", + "traits": { + "smithy.api#documentation": "

The type of the feedback target.

", + "smithy.api#required": {} + } + }, + "contentFeedback": { + "target": "com.amazonaws.qconnect#ContentFeedbackData", + "traits": { + "smithy.api#documentation": "

Information about the feedback provided.

", + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#output": {} + } + }, "com.amazonaws.qconnect#QueryAssistant": { "type": "operation", "input": { @@ -5277,6 +5417,21 @@ ] } }, + "com.amazonaws.qconnect#Relevance": { + "type": "string", + "traits": { + "smithy.api#enum": [ + { + "value": "HELPFUL", + "name": "HELPFUL" + }, + { + "value": "NOT_HELPFUL", + "name": "NOT_HELPFUL" + } + ] + } + }, "com.amazonaws.qconnect#RelevanceLevel": { "type": "string", "traits": { @@ -5561,7 +5716,7 @@ } ], "traits": { - "smithy.api#documentation": "

Searches existing Amazon Q quick responses in a Amazon Q knowledge base.

", + "smithy.api#documentation": "

Searches existing Amazon Q quick responses in an Amazon Q knowledge base.

", "smithy.api#http": { "uri": "/knowledgeBases/{knowledgeBaseId}/search/quickResponses", "method": "POST" @@ -6226,6 +6381,21 @@ "target": "com.amazonaws.qconnect#TagValue" } }, + "com.amazonaws.qconnect#TargetType": { + "type": "string", + "traits": { + "smithy.api#enum": [ + { + "value": "RECOMMENDATION", + "name": "RECOMMENDATION" + }, + { + "value": "RESULT", + "name": "RESULT" + } + ] + } + }, "com.amazonaws.qconnect#TextData": { "type": "structure", "members": { @@ -6711,7 +6881,7 @@ }, "aws.protocols#restJson1": {}, "smithy.api#cors": {}, - "smithy.api#documentation": "

Amazon Q in Connect is a generative AI customer service assistant. It is an LLM-enhanced evolution\n of Amazon Connect Wisdom that delivers real-time recommendations to help contact center\n agents resolve customer issues quickly and accurately.

\n

Amazon Q automatically detects customer intent during calls and chats using\n conversational analytics and natural language understanding (NLU). It then provides agents\n with immediate, real-time generative responses and suggested actions, and links to relevant\n documents and articles. Agents can also query Amazon Q directly using natural language or\n keywords to answer customer requests.

\n

Use the Amazon Q in Connect APIs to create an assistant and a knowledge base, for example, or\n manage content by uploading custom files.

\n

For more information, see Use Amazon Q in Connect for generative AI\n powered agent assistance in real-time in the Amazon Connect\n Administrator Guide.

", + "smithy.api#documentation": "\n

\n Powered by Amazon Bedrock: Amazon Web Services implements automated abuse\n detection. Because Amazon Q in Connect is built on Amazon Bedrock, users can take full\n advantage of the controls implemented in Amazon Bedrock to enforce safety, security, and the\n responsible use of artificial intelligence (AI).

\n
\n

Amazon Q in Connect is a generative AI customer service assistant. It is an LLM-enhanced evolution\n of Amazon Connect Wisdom that delivers real-time recommendations to help contact center\n agents resolve customer issues quickly and accurately.

\n

Amazon Q automatically detects customer intent during calls and chats using\n conversational analytics and natural language understanding (NLU). It then provides agents\n with immediate, real-time generative responses and suggested actions, and links to relevant\n documents and articles. Agents can also query Amazon Q directly using natural language or\n keywords to answer customer requests.

\n

Use the Amazon Q in Connect APIs to create an assistant and a knowledge base, for example, or\n manage content by uploading custom files.

\n

For more information, see Use Amazon Q in Connect for generative AI\n powered agent assistance in real-time in the Amazon Connect\n Administrator Guide.

", "smithy.api#title": "Amazon Q Connect", "smithy.rules#endpointRuleSet": { "version": "1.0",