Skip to content

Commit 93a1fe5

Browse files
author
awstools
committed
feat(client-qconnect): This release adds the PutFeedback API and allows providing feedback against the specified assistant for the specified target.
1 parent b960b65 commit 93a1fe5

File tree

11 files changed

+640
-10
lines changed

11 files changed

+640
-10
lines changed

clients/client-qconnect/README.md

+15
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,13 @@
66

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

9+
<note>
10+
<p>
11+
<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
12+
detection</a>. Because Amazon Q in Connect is built on Amazon Bedrock, users can take full
13+
advantage of the controls implemented in Amazon Bedrock to enforce safety, security, and the
14+
responsible use of artificial intelligence (AI).</p>
15+
</note>
916
<p>Amazon Q in Connect is a generative AI customer service assistant. It is an LLM-enhanced evolution
1017
of Amazon Connect Wisdom that delivers real-time recommendations to help contact center
1118
agents resolve customer issues quickly and accurately.</p>
@@ -446,6 +453,14 @@ NotifyRecommendationsReceived
446453

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

456+
</details>
457+
<details>
458+
<summary>
459+
PutFeedback
460+
</summary>
461+
462+
[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/)
463+
449464
</details>
450465
<details>
451466
<summary>

clients/client-qconnect/src/QConnect.ts

+21-1
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,7 @@ import {
139139
NotifyRecommendationsReceivedCommandInput,
140140
NotifyRecommendationsReceivedCommandOutput,
141141
} from "./commands/NotifyRecommendationsReceivedCommand";
142+
import { PutFeedbackCommand, PutFeedbackCommandInput, PutFeedbackCommandOutput } from "./commands/PutFeedbackCommand";
142143
import {
143144
QueryAssistantCommand,
144145
QueryAssistantCommandInput,
@@ -227,6 +228,7 @@ const commands = {
227228
ListQuickResponsesCommand,
228229
ListTagsForResourceCommand,
229230
NotifyRecommendationsReceivedCommand,
231+
PutFeedbackCommand,
230232
QueryAssistantCommand,
231233
RemoveKnowledgeBaseTemplateUriCommand,
232234
SearchContentCommand,
@@ -672,6 +674,17 @@ export interface QConnect {
672674
cb: (err: any, data?: NotifyRecommendationsReceivedCommandOutput) => void
673675
): void;
674676

677+
/**
678+
* @see {@link PutFeedbackCommand}
679+
*/
680+
putFeedback(args: PutFeedbackCommandInput, options?: __HttpHandlerOptions): Promise<PutFeedbackCommandOutput>;
681+
putFeedback(args: PutFeedbackCommandInput, cb: (err: any, data?: PutFeedbackCommandOutput) => void): void;
682+
putFeedback(
683+
args: PutFeedbackCommandInput,
684+
options: __HttpHandlerOptions,
685+
cb: (err: any, data?: PutFeedbackCommandOutput) => void
686+
): void;
687+
675688
/**
676689
* @see {@link QueryAssistantCommand}
677690
*/
@@ -846,7 +859,14 @@ export interface QConnect {
846859

847860
/**
848861
* @public
849-
* <p>Amazon Q in Connect is a generative AI customer service assistant. It is an LLM-enhanced evolution
862+
* <note>
863+
* <p>
864+
* <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
865+
* detection</a>. Because Amazon Q in Connect is built on Amazon Bedrock, users can take full
866+
* advantage of the controls implemented in Amazon Bedrock to enforce safety, security, and the
867+
* responsible use of artificial intelligence (AI).</p>
868+
* </note>
869+
* <p>Amazon Q in Connect is a generative AI customer service assistant. It is an LLM-enhanced evolution
850870
* of Amazon Connect Wisdom that delivers real-time recommendations to help contact center
851871
* agents resolve customer issues quickly and accurately.</p>
852872
* <p>Amazon Q automatically detects customer intent during calls and chats using

clients/client-qconnect/src/QConnectClient.ts

+11-1
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,7 @@ import {
109109
NotifyRecommendationsReceivedCommandInput,
110110
NotifyRecommendationsReceivedCommandOutput,
111111
} from "./commands/NotifyRecommendationsReceivedCommand";
112+
import { PutFeedbackCommandInput, PutFeedbackCommandOutput } from "./commands/PutFeedbackCommand";
112113
import { QueryAssistantCommandInput, QueryAssistantCommandOutput } from "./commands/QueryAssistantCommand";
113114
import {
114115
RemoveKnowledgeBaseTemplateUriCommandInput,
@@ -177,6 +178,7 @@ export type ServiceInputTypes =
177178
| ListQuickResponsesCommandInput
178179
| ListTagsForResourceCommandInput
179180
| NotifyRecommendationsReceivedCommandInput
181+
| PutFeedbackCommandInput
180182
| QueryAssistantCommandInput
181183
| RemoveKnowledgeBaseTemplateUriCommandInput
182184
| SearchContentCommandInput
@@ -223,6 +225,7 @@ export type ServiceOutputTypes =
223225
| ListQuickResponsesCommandOutput
224226
| ListTagsForResourceCommandOutput
225227
| NotifyRecommendationsReceivedCommandOutput
228+
| PutFeedbackCommandOutput
226229
| QueryAssistantCommandOutput
227230
| RemoveKnowledgeBaseTemplateUriCommandOutput
228231
| SearchContentCommandOutput
@@ -408,7 +411,14 @@ export interface QConnectClientResolvedConfig extends QConnectClientResolvedConf
408411

409412
/**
410413
* @public
411-
* <p>Amazon Q in Connect is a generative AI customer service assistant. It is an LLM-enhanced evolution
414+
* <note>
415+
* <p>
416+
* <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
417+
* detection</a>. Because Amazon Q in Connect is built on Amazon Bedrock, users can take full
418+
* advantage of the controls implemented in Amazon Bedrock to enforce safety, security, and the
419+
* responsible use of artificial intelligence (AI).</p>
420+
* </note>
421+
* <p>Amazon Q in Connect is a generative AI customer service assistant. It is an LLM-enhanced evolution
412422
* of Amazon Connect Wisdom that delivers real-time recommendations to help contact center
413423
* agents resolve customer issues quickly and accurately.</p>
414424
* <p>Amazon Q automatically detects customer intent during calls and chats using

clients/client-qconnect/src/commands/CreateQuickResponseCommand.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ export interface CreateQuickResponseCommandOutput extends CreateQuickResponseRes
4242

4343
/**
4444
* @public
45-
* <p>Creates a Amazon Q quick response.</p>
45+
* <p>Creates an Amazon Q quick response.</p>
4646
* @example
4747
* Use a bare-bones client and the command you need to make an API call.
4848
* ```javascript
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,161 @@
1+
// smithy-typescript generated code
2+
import { EndpointParameterInstructions, getEndpointPlugin } from "@smithy/middleware-endpoint";
3+
import { getSerdePlugin } from "@smithy/middleware-serde";
4+
import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http";
5+
import { Command as $Command } from "@smithy/smithy-client";
6+
import {
7+
FinalizeHandlerArguments,
8+
Handler,
9+
HandlerExecutionContext,
10+
HttpHandlerOptions as __HttpHandlerOptions,
11+
MetadataBearer as __MetadataBearer,
12+
MiddlewareStack,
13+
SerdeContext as __SerdeContext,
14+
SMITHY_CONTEXT_KEY,
15+
} from "@smithy/types";
16+
17+
import { PutFeedbackRequest, PutFeedbackResponse } from "../models/models_0";
18+
import { de_PutFeedbackCommand, se_PutFeedbackCommand } from "../protocols/Aws_restJson1";
19+
import { QConnectClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../QConnectClient";
20+
21+
/**
22+
* @public
23+
*/
24+
export { __MetadataBearer, $Command };
25+
/**
26+
* @public
27+
*
28+
* The input for {@link PutFeedbackCommand}.
29+
*/
30+
export interface PutFeedbackCommandInput extends PutFeedbackRequest {}
31+
/**
32+
* @public
33+
*
34+
* The output of {@link PutFeedbackCommand}.
35+
*/
36+
export interface PutFeedbackCommandOutput extends PutFeedbackResponse, __MetadataBearer {}
37+
38+
/**
39+
* @public
40+
* <p>Provides feedback against the specified assistant for the specified target. This API only supports generative targets.</p>
41+
* @example
42+
* Use a bare-bones client and the command you need to make an API call.
43+
* ```javascript
44+
* import { QConnectClient, PutFeedbackCommand } from "@aws-sdk/client-qconnect"; // ES Modules import
45+
* // const { QConnectClient, PutFeedbackCommand } = require("@aws-sdk/client-qconnect"); // CommonJS import
46+
* const client = new QConnectClient(config);
47+
* const input = { // PutFeedbackRequest
48+
* assistantId: "STRING_VALUE", // required
49+
* targetId: "STRING_VALUE", // required
50+
* targetType: "STRING_VALUE", // required
51+
* contentFeedback: { // ContentFeedbackData Union: only one key present
52+
* generativeContentFeedbackData: { // GenerativeContentFeedbackData
53+
* relevance: "STRING_VALUE", // required
54+
* },
55+
* },
56+
* };
57+
* const command = new PutFeedbackCommand(input);
58+
* const response = await client.send(command);
59+
* // { // PutFeedbackResponse
60+
* // assistantId: "STRING_VALUE", // required
61+
* // assistantArn: "STRING_VALUE", // required
62+
* // targetId: "STRING_VALUE", // required
63+
* // targetType: "STRING_VALUE", // required
64+
* // contentFeedback: { // ContentFeedbackData Union: only one key present
65+
* // generativeContentFeedbackData: { // GenerativeContentFeedbackData
66+
* // relevance: "STRING_VALUE", // required
67+
* // },
68+
* // },
69+
* // };
70+
*
71+
* ```
72+
*
73+
* @param PutFeedbackCommandInput - {@link PutFeedbackCommandInput}
74+
* @returns {@link PutFeedbackCommandOutput}
75+
* @see {@link PutFeedbackCommandInput} for command's `input` shape.
76+
* @see {@link PutFeedbackCommandOutput} for command's `response` shape.
77+
* @see {@link QConnectClientResolvedConfig | config} for QConnectClient's `config` shape.
78+
*
79+
* @throws {@link AccessDeniedException} (client fault)
80+
* <p>You do not have sufficient access to perform this action.</p>
81+
*
82+
* @throws {@link ResourceNotFoundException} (client fault)
83+
* <p>The specified resource does not exist.</p>
84+
*
85+
* @throws {@link ValidationException} (client fault)
86+
* <p>The input fails to satisfy the constraints specified by a service.</p>
87+
*
88+
* @throws {@link QConnectServiceException}
89+
* <p>Base exception class for all service exceptions from QConnect service.</p>
90+
*
91+
*/
92+
export class PutFeedbackCommand extends $Command<
93+
PutFeedbackCommandInput,
94+
PutFeedbackCommandOutput,
95+
QConnectClientResolvedConfig
96+
> {
97+
public static getEndpointParameterInstructions(): EndpointParameterInstructions {
98+
return {
99+
UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" },
100+
Endpoint: { type: "builtInParams", name: "endpoint" },
101+
Region: { type: "builtInParams", name: "region" },
102+
UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" },
103+
};
104+
}
105+
106+
/**
107+
* @public
108+
*/
109+
constructor(readonly input: PutFeedbackCommandInput) {
110+
super();
111+
}
112+
113+
/**
114+
* @internal
115+
*/
116+
resolveMiddleware(
117+
clientStack: MiddlewareStack<ServiceInputTypes, ServiceOutputTypes>,
118+
configuration: QConnectClientResolvedConfig,
119+
options?: __HttpHandlerOptions
120+
): Handler<PutFeedbackCommandInput, PutFeedbackCommandOutput> {
121+
this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize));
122+
this.middlewareStack.use(getEndpointPlugin(configuration, PutFeedbackCommand.getEndpointParameterInstructions()));
123+
124+
const stack = clientStack.concat(this.middlewareStack);
125+
126+
const { logger } = configuration;
127+
const clientName = "QConnectClient";
128+
const commandName = "PutFeedbackCommand";
129+
const handlerExecutionContext: HandlerExecutionContext = {
130+
logger,
131+
clientName,
132+
commandName,
133+
inputFilterSensitiveLog: (_: any) => _,
134+
outputFilterSensitiveLog: (_: any) => _,
135+
[SMITHY_CONTEXT_KEY]: {
136+
service: "WisdomService",
137+
operation: "PutFeedback",
138+
},
139+
};
140+
const { requestHandler } = configuration;
141+
return stack.resolve(
142+
(request: FinalizeHandlerArguments<any>) =>
143+
requestHandler.handle(request.request as __HttpRequest, options || {}),
144+
handlerExecutionContext
145+
);
146+
}
147+
148+
/**
149+
* @internal
150+
*/
151+
private serialize(input: PutFeedbackCommandInput, context: __SerdeContext): Promise<__HttpRequest> {
152+
return se_PutFeedbackCommand(input, context);
153+
}
154+
155+
/**
156+
* @internal
157+
*/
158+
private deserialize(output: __HttpResponse, context: __SerdeContext): Promise<PutFeedbackCommandOutput> {
159+
return de_PutFeedbackCommand(output, context);
160+
}
161+
}

clients/client-qconnect/src/commands/SearchQuickResponsesCommand.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ export interface SearchQuickResponsesCommandOutput extends SearchQuickResponsesR
4242

4343
/**
4444
* @public
45-
* <p>Searches existing Amazon Q quick responses in a Amazon Q knowledge base.</p>
45+
* <p>Searches existing Amazon Q quick responses in an Amazon Q knowledge base.</p>
4646
* @example
4747
* Use a bare-bones client and the command you need to make an API call.
4848
* ```javascript

clients/client-qconnect/src/commands/index.ts

+1
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ export * from "./ListKnowledgeBasesCommand";
2828
export * from "./ListQuickResponsesCommand";
2929
export * from "./ListTagsForResourceCommand";
3030
export * from "./NotifyRecommendationsReceivedCommand";
31+
export * from "./PutFeedbackCommand";
3132
export * from "./QueryAssistantCommand";
3233
export * from "./RemoveKnowledgeBaseTemplateUriCommand";
3334
export * from "./SearchContentCommand";

clients/client-qconnect/src/index.ts

+8-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,14 @@
11
// smithy-typescript generated code
22
/* eslint-disable */
33
/**
4-
* <p>Amazon Q in Connect is a generative AI customer service assistant. It is an LLM-enhanced evolution
4+
* <note>
5+
* <p>
6+
* <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
7+
* detection</a>. Because Amazon Q in Connect is built on Amazon Bedrock, users can take full
8+
* advantage of the controls implemented in Amazon Bedrock to enforce safety, security, and the
9+
* responsible use of artificial intelligence (AI).</p>
10+
* </note>
11+
* <p>Amazon Q in Connect is a generative AI customer service assistant. It is an LLM-enhanced evolution
512
* of Amazon Connect Wisdom that delivers real-time recommendations to help contact center
613
* agents resolve customer issues quickly and accurately.</p>
714
* <p>Amazon Q automatically detects customer intent during calls and chats using

0 commit comments

Comments
 (0)