Skip to content

Commit

Permalink
feat(client-qconnect): This release adds the PutFeedback API and allo…
Browse files Browse the repository at this point in the history
…ws providing feedback against the specified assistant for the specified target.
  • Loading branch information
awstools committed Dec 1, 2023
1 parent b960b65 commit 93a1fe5
Show file tree
Hide file tree
Showing 11 changed files with 640 additions and 10 deletions.
15 changes: 15 additions & 0 deletions clients/client-qconnect/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,13 @@

AWS SDK for JavaScript QConnect Client for Node.js, Browser and React Native.

<note>
<p>
<b>Powered by Amazon Bedrock</b>: Amazon Web Services implements <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/abuse-detection.html">automated abuse
detection</a>. 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).</p>
</note>
<p>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.</p>
Expand Down Expand Up @@ -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/)

</details>
<details>
<summary>
PutFeedback
</summary>

[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/)

</details>
<details>
<summary>
Expand Down
22 changes: 21 additions & 1 deletion clients/client-qconnect/src/QConnect.ts
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@ import {
NotifyRecommendationsReceivedCommandInput,
NotifyRecommendationsReceivedCommandOutput,
} from "./commands/NotifyRecommendationsReceivedCommand";
import { PutFeedbackCommand, PutFeedbackCommandInput, PutFeedbackCommandOutput } from "./commands/PutFeedbackCommand";
import {
QueryAssistantCommand,
QueryAssistantCommandInput,
Expand Down Expand Up @@ -227,6 +228,7 @@ const commands = {
ListQuickResponsesCommand,
ListTagsForResourceCommand,
NotifyRecommendationsReceivedCommand,
PutFeedbackCommand,
QueryAssistantCommand,
RemoveKnowledgeBaseTemplateUriCommand,
SearchContentCommand,
Expand Down Expand Up @@ -672,6 +674,17 @@ export interface QConnect {
cb: (err: any, data?: NotifyRecommendationsReceivedCommandOutput) => void
): void;

/**
* @see {@link PutFeedbackCommand}
*/
putFeedback(args: PutFeedbackCommandInput, options?: __HttpHandlerOptions): Promise<PutFeedbackCommandOutput>;
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}
*/
Expand Down Expand Up @@ -846,7 +859,14 @@ export interface QConnect {

/**
* @public
* <p>Amazon Q in Connect is a generative AI customer service assistant. It is an LLM-enhanced evolution
* <note>
* <p>
* <b>Powered by Amazon Bedrock</b>: Amazon Web Services implements <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/abuse-detection.html">automated abuse
* detection</a>. 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).</p>
* </note>
* <p>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.</p>
* <p>Amazon Q automatically detects customer intent during calls and chats using
Expand Down
12 changes: 11 additions & 1 deletion clients/client-qconnect/src/QConnectClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ import {
NotifyRecommendationsReceivedCommandInput,
NotifyRecommendationsReceivedCommandOutput,
} from "./commands/NotifyRecommendationsReceivedCommand";
import { PutFeedbackCommandInput, PutFeedbackCommandOutput } from "./commands/PutFeedbackCommand";
import { QueryAssistantCommandInput, QueryAssistantCommandOutput } from "./commands/QueryAssistantCommand";
import {
RemoveKnowledgeBaseTemplateUriCommandInput,
Expand Down Expand Up @@ -177,6 +178,7 @@ export type ServiceInputTypes =
| ListQuickResponsesCommandInput
| ListTagsForResourceCommandInput
| NotifyRecommendationsReceivedCommandInput
| PutFeedbackCommandInput
| QueryAssistantCommandInput
| RemoveKnowledgeBaseTemplateUriCommandInput
| SearchContentCommandInput
Expand Down Expand Up @@ -223,6 +225,7 @@ export type ServiceOutputTypes =
| ListQuickResponsesCommandOutput
| ListTagsForResourceCommandOutput
| NotifyRecommendationsReceivedCommandOutput
| PutFeedbackCommandOutput
| QueryAssistantCommandOutput
| RemoveKnowledgeBaseTemplateUriCommandOutput
| SearchContentCommandOutput
Expand Down Expand Up @@ -408,7 +411,14 @@ export interface QConnectClientResolvedConfig extends QConnectClientResolvedConf

/**
* @public
* <p>Amazon Q in Connect is a generative AI customer service assistant. It is an LLM-enhanced evolution
* <note>
* <p>
* <b>Powered by Amazon Bedrock</b>: Amazon Web Services implements <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/abuse-detection.html">automated abuse
* detection</a>. 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).</p>
* </note>
* <p>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.</p>
* <p>Amazon Q automatically detects customer intent during calls and chats using
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export interface CreateQuickResponseCommandOutput extends CreateQuickResponseRes

/**
* @public
* <p>Creates a Amazon Q quick response.</p>
* <p>Creates an Amazon Q quick response.</p>
* @example
* Use a bare-bones client and the command you need to make an API call.
* ```javascript
Expand Down
161 changes: 161 additions & 0 deletions clients/client-qconnect/src/commands/PutFeedbackCommand.ts
Original file line number Diff line number Diff line change
@@ -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
* <p>Provides feedback against the specified assistant for the specified target. This API only supports generative targets.</p>
* @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)
* <p>You do not have sufficient access to perform this action.</p>
*
* @throws {@link ResourceNotFoundException} (client fault)
* <p>The specified resource does not exist.</p>
*
* @throws {@link ValidationException} (client fault)
* <p>The input fails to satisfy the constraints specified by a service.</p>
*
* @throws {@link QConnectServiceException}
* <p>Base exception class for all service exceptions from QConnect service.</p>
*
*/
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<ServiceInputTypes, ServiceOutputTypes>,
configuration: QConnectClientResolvedConfig,
options?: __HttpHandlerOptions
): Handler<PutFeedbackCommandInput, PutFeedbackCommandOutput> {
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<any>) =>
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<PutFeedbackCommandOutput> {
return de_PutFeedbackCommand(output, context);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export interface SearchQuickResponsesCommandOutput extends SearchQuickResponsesR

/**
* @public
* <p>Searches existing Amazon Q quick responses in a Amazon Q knowledge base.</p>
* <p>Searches existing Amazon Q quick responses in an Amazon Q knowledge base.</p>
* @example
* Use a bare-bones client and the command you need to make an API call.
* ```javascript
Expand Down
1 change: 1 addition & 0 deletions clients/client-qconnect/src/commands/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down
9 changes: 8 additions & 1 deletion clients/client-qconnect/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
// smithy-typescript generated code
/* eslint-disable */
/**
* <p>Amazon Q in Connect is a generative AI customer service assistant. It is an LLM-enhanced evolution
* <note>
* <p>
* <b>Powered by Amazon Bedrock</b>: Amazon Web Services implements <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/abuse-detection.html">automated abuse
* detection</a>. 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).</p>
* </note>
* <p>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.</p>
* <p>Amazon Q automatically detects customer intent during calls and chats using
Expand Down
Loading

0 comments on commit 93a1fe5

Please sign in to comment.