Skip to content

Commit ed2cae6

Browse files
author
awstools
committed
feat(client-kendra): Amazon Kendra now supports confidence score buckets for retrieved passage results using the Retrieve API.
1 parent 0528034 commit ed2cae6

File tree

10 files changed

+149
-88
lines changed

10 files changed

+149
-88
lines changed

clients/client-kendra/src/commands/BatchDeleteDocumentCommand.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,10 @@ export interface BatchDeleteDocumentCommandOutput extends BatchDeleteDocumentRes
4040
* the <code>BatchPutDocument</code> API.</p>
4141
* <p>The documents are deleted asynchronously. You can see the progress of the deletion by
4242
* using Amazon Web Services CloudWatch. Any error messages related to the processing of the
43-
* batch are sent to you CloudWatch log.</p>
43+
* batch are sent to your Amazon Web Services CloudWatch log. You can also use the
44+
* <code>BatchGetDocumentStatus</code> API to monitor the progress of deleting your documents.</p>
45+
* <p>Deleting documents from an index using <code>BatchDeleteDocument</code> could take up
46+
* to an hour or more, depending on the number of documents you want to delete.</p>
4447
* @example
4548
* Use a bare-bones client and the command you need to make an API call.
4649
* ```javascript

clients/client-kendra/src/commands/BatchPutDocumentCommand.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,9 @@ export interface BatchPutDocumentCommandOutput extends BatchPutDocumentResponse,
4242
* unstructured text into an index, add custom attributes to the documents, and to attach
4343
* an access control list to the documents added to the index.</p>
4444
* <p>The documents are indexed asynchronously. You can see the progress of the batch using
45-
* Amazon Web Services
46-
* CloudWatch. Any error messages related to processing the batch are sent to your
47-
* Amazon Web Services
48-
* CloudWatch log.</p>
45+
* Amazon Web Services CloudWatch. Any error messages related to processing the batch
46+
* are sent to your Amazon Web Services CloudWatch log. You can also use the
47+
* <code>BatchGetDocumentStatus</code> API to monitor the progress of indexing your documents.</p>
4948
* <p>For an example of ingesting inline documents using Python and Java SDKs, see <a href="https://docs.aws.amazon.com/kendra/latest/dg/in-adding-binary-doc.html">Adding files
5049
* directly to an index</a>.</p>
5150
* @example

clients/client-kendra/src/commands/CreateIndexCommand.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@ export interface CreateIndexCommandOutput extends CreateIndexResponse, __Metadat
4040
* if index creation has completed, check the <code>Status</code> field returned from a call to
4141
* <code>DescribeIndex</code>. The <code>Status</code> field is set to <code>ACTIVE</code> when
4242
* the index is ready to use.</p>
43-
* <p>Once the index is active you can index your documents using the
44-
* <code>BatchPutDocument</code> API or using one of the supported data sources.</p>
43+
* <p>Once the index is active, you can index your documents using the
44+
* <code>BatchPutDocument</code> API or using one of the supported <a href="https://docs.aws.amazon.com/kendra/latest/dg/data-sources.html">data sources</a>.</p>
4545
* <p>For an example of creating an index and data source using the Python SDK, see <a href="https://docs.aws.amazon.com/kendra/latest/dg/gs-python.html">Getting started with Python
4646
* SDK</a>. For an example of creating an index and data source using the Java SDK, see
4747
* <a href="https://docs.aws.amazon.com/kendra/latest/dg/gs-java.html">Getting started with Java

clients/client-kendra/src/commands/DeleteDataSourceCommand.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,9 @@ export interface DeleteDataSourceCommandOutput extends __MetadataBearer {}
4040
* data source is already being deleted. While the data source is being deleted, the
4141
* <code>Status</code> field returned by a call to the <code>DescribeDataSource</code> API is
4242
* set to <code>DELETING</code>. For more information, see <a href="https://docs.aws.amazon.com/kendra/latest/dg/delete-data-source.html">Deleting Data Sources</a>.</p>
43+
* <p>Deleting an entire data source or re-syncing your index after deleting specific documents
44+
* from a data source could take up to an hour or more, depending on the number of documents you
45+
* want to delete.</p>
4346
* @example
4447
* Use a bare-bones client and the command you need to make an API call.
4548
* ```javascript

clients/client-kendra/src/commands/RetrieveCommand.ts

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,8 @@ export interface RetrieveCommandOutput extends RetrieveResult, __MetadataBearer
4545
* include question-answer or FAQ type responses from your index. The passages
4646
* are text excerpts that can be semantically extracted from multiple documents
4747
* and multiple parts of the same document. If in extreme cases your documents
48-
* produce no relevant passages using the <code>Retrieve</code> API, you can
49-
* alternatively use the <code>Query</code> API.</p>
48+
* produce zero passages using the <code>Retrieve</code> API, you can alternatively
49+
* use the <code>Query</code> API and its types of responses.</p>
5050
* <p>You can also do the following:</p>
5151
* <ul>
5252
* <li>
@@ -61,6 +61,10 @@ export interface RetrieveCommandOutput extends RetrieveResult, __MetadataBearer
6161
* </ul>
6262
* <p>You can also include certain fields in the response that might provide useful
6363
* additional information.</p>
64+
* <p>The <code>Retrieve</code> API shares the number of <a href="https://docs.aws.amazon.com/kendra/latest/APIReference/API_CapacityUnitsConfiguration.html">query capacity
65+
* units</a> that you set for your index. For more information on what's included in
66+
* a single capacity unit and the default base capacity for an index, see <a href="https://docs.aws.amazon.com/kendra/latest/dg/adjusting-capacity.html">Adjusting
67+
* capacity</a>.</p>
6468
* @example
6569
* Use a bare-bones client and the command you need to make an API call.
6670
* ```javascript
@@ -208,6 +212,9 @@ export interface RetrieveCommandOutput extends RetrieveResult, __MetadataBearer
208212
* // },
209213
* // },
210214
* // ],
215+
* // ScoreAttributes: { // ScoreAttributes
216+
* // ScoreConfidence: "VERY_HIGH" || "HIGH" || "MEDIUM" || "LOW" || "NOT_AVAILABLE",
217+
* // },
211218
* // },
212219
* // ],
213220
* // };

clients/client-kendra/src/commands/StartDataSourceSyncJobCommand.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,9 @@ export interface StartDataSourceSyncJobCommandOutput extends StartDataSourceSync
3939
* <p>Starts a synchronization job for a data source connector. If a synchronization job is
4040
* already in progress, Amazon Kendra returns a <code>ResourceInUseException</code>
4141
* exception.</p>
42+
* <p>Re-syncing your data source with your index after modifying, adding, or deleting
43+
* documents from your data source respository could take up to an hour or more, depending on
44+
* the number of documents to sync.</p>
4245
* @example
4346
* Use a bare-bones client and the command you need to make an API call.
4447
* ```javascript

clients/client-kendra/src/models/models_0.ts

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -186,25 +186,33 @@ export interface AdditionalResultAttribute {
186186

187187
/**
188188
* @public
189-
* <p>Maps a column or attribute in the data source to an index field. You must first create the
190-
* fields in the index using the <code>UpdateIndex</code> API.</p>
189+
* <p>Maps attributes or field names of the documents synced from the data source
190+
* to Amazon Kendra index field names. You can set up field mappings for each
191+
* data source when calling <a href="https://docs.aws.amazon.com/kendra/latest/APIReference/API_CreateDataSource.html">CreateDataSource</a>
192+
* or <a href="https://docs.aws.amazon.com/kendra/latest/APIReference/API_UpdateDataSource.html">UpdateDataSource</a> API. To create custom fields, use the <code>UpdateIndex</code>
193+
* API to first create an index field and then map to the data source field. For more
194+
* information, see <a href="https://docs.aws.amazon.com/kendra/latest/dg/field-mapping.html">Mapping data source fields</a>.</p>
191195
*/
192196
export interface DataSourceToIndexFieldMapping {
193197
/**
194198
* @public
195-
* <p>The name of the column or attribute in the data source.</p>
199+
* <p>The name of the field in the data source. You must first create the index field
200+
* using the <code>UpdateIndex</code> API.</p>
196201
*/
197202
DataSourceFieldName: string | undefined;
198203

199204
/**
200205
* @public
201-
* <p>The type of data stored in the column or attribute.</p>
206+
* <p>The format for date fields in the data source. If the field specified in
207+
* <code>DataSourceFieldName</code> is a date field, you must specify the date
208+
* format. If the field is not a date field, an exception is thrown.</p>
202209
*/
203210
DateFieldFormat?: string;
204211

205212
/**
206213
* @public
207-
* <p>The name of the field in the index.</p>
214+
* <p>The name of the index field to map to the data source field. The index field type
215+
* must match the data source field type.</p>
208216
*/
209217
IndexFieldName: string | undefined;
210218
}
@@ -1760,9 +1768,8 @@ export interface BatchPutDocumentResponse {
17601768
* validation check. Each document contains an error message that indicates why the
17611769
* document couldn't be added to the index.</p>
17621770
* <p>If there was an error adding a document to an index the error is reported in your
1763-
* Amazon Web Services CloudWatch log. For more information, see <a href="https://docs.aws.amazon.com/kendra/latest/dg/cloudwatch-logs.html">Monitoring Amazon
1764-
* Kendra with Amazon CloudWatch Logs</a>
1765-
* </p>
1771+
* Amazon Web Services CloudWatch log. For more information, see <a href="https://docs.aws.amazon.com/kendra/latest/dg/cloudwatch-logs.html">Monitoring
1772+
* Amazon Kendra with Amazon CloudWatch logs</a>.</p>
17661773
*/
17671774
FailedDocuments?: BatchPutDocumentResponseFailedDocument[];
17681775
}
@@ -2640,7 +2647,8 @@ export interface SqlConfiguration {
26402647

26412648
/**
26422649
* @public
2643-
* <p>Provides the configuration information to connect to a index. </p>
2650+
* <p>Provides the configuration information to an <a href="https://docs.aws.amazon.com/kendra/latest/dg/data-source-database.html">Amazon Kendra supported
2651+
* database</a>.</p>
26442652
*/
26452653
export interface DatabaseConfiguration {
26462654
/**

clients/client-kendra/src/models/models_1.ts

Lines changed: 72 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -258,6 +258,14 @@ export interface RetrieveResultItem {
258258
* or the source URI (<code>_source_uri</code>) of the document.</p>
259259
*/
260260
DocumentAttributes?: DocumentAttribute[];
261+
262+
/**
263+
* @public
264+
* <p>The confidence score bucket for a retrieved passage result. The confidence
265+
* bucket provides a relative ranking that indicates how confident Amazon Kendra
266+
* is that the response is relevant to the query.</p>
267+
*/
268+
ScoreAttributes?: ScoreAttributes;
261269
}
262270

263271
/**
@@ -954,7 +962,7 @@ export interface UpdateThesaurusRequest {
954962

955963
/**
956964
* @public
957-
* <p>Information about a document attribute. You can use document attributes as
965+
* <p>Information about a document attribute or field. You can use document attributes as
958966
* facets.</p>
959967
* <p>For example, the document attribute or facet "Department" includes the values "HR",
960968
* "Engineering", and "Accounting". You can display these values in the search results so that
@@ -994,26 +1002,26 @@ export interface Facet {
9941002

9951003
/**
9961004
* @public
997-
* <p>Provides the count of documents that match a particular attribute when doing a faceted
998-
* search.</p>
1005+
* <p>Provides the count of documents that match a particular document attribute or
1006+
* field when doing a faceted search.</p>
9991007
*/
10001008
export interface DocumentAttributeValueCountPair {
10011009
/**
10021010
* @public
1003-
* <p>The value of the attribute. For example, "HR".</p>
1011+
* <p>The value of the attribute/field. For example, "HR".</p>
10041012
*/
10051013
DocumentAttributeValue?: DocumentAttributeValue;
10061014

10071015
/**
10081016
* @public
1009-
* <p>The number of documents in the response that have the attribute value for the
1010-
* key.</p>
1017+
* <p>The number of documents in the response that have the attribute/field value for
1018+
* the key.</p>
10111019
*/
10121020
Count?: number;
10131021

10141022
/**
10151023
* @public
1016-
* <p>Contains the results of a document attribute that is a nested facet. A
1024+
* <p>Contains the results of a document attribute/field that is a nested facet. A
10171025
* <code>FacetResult</code> contains the counts for each facet nested within a
10181026
* facet.</p>
10191027
* <p>For example, the document attribute or facet "Department" includes a value called
@@ -1057,98 +1065,121 @@ export interface FacetResult {
10571065

10581066
/**
10591067
* @public
1060-
* <p>Provides filtering the query results based on document attributes or metadata
1061-
* fields.</p>
1062-
* <p>When you use the <code>AndAllFilters</code> or <code>OrAllFilters</code>, filters you
1063-
* can use 2 layers under the first attribute filter. For example, you can use:</p>
1068+
* <p>Filters the search results based on document attributes or fields.</p>
1069+
* <p>You can filter results using attributes for your particular documents.
1070+
* The attributes must exist in your index. For example, if your documents
1071+
* include the custom attribute "Department", you can filter documents that
1072+
* belong to the "HR" department. You would use the <code>EqualsTo</code>
1073+
* operation to filter results or documents with "Department" equals to "HR".</p>
1074+
* <p>You can use <code>AndAllFilters</code> and <code>AndOrFilters</code> in
1075+
* combination with each other or with other operations such as <code>EqualsTo</code>.
1076+
* For example:</p>
10641077
* <p>
1065-
* <code><AndAllFilters></code>
1078+
* <code>AndAllFilters</code>
10661079
* </p>
1067-
* <ol>
1080+
* <ul>
10681081
* <li>
10691082
* <p>
1070-
* <code> <OrAllFilters></code>
1071-
* </p>
1083+
* <code>EqualsTo</code>: "Department", "HR"</p>
10721084
* </li>
10731085
* <li>
10741086
* <p>
1075-
* <code> <EqualsTo></code>
1087+
* <code>AndOrFilters</code>
10761088
* </p>
1089+
* <ul>
1090+
* <li>
1091+
* <p>
1092+
* <code>ContainsAny</code>: "Project Name", ["new hires", "new hiring"]</p>
1093+
* </li>
1094+
* </ul>
10771095
* </li>
1078-
* </ol>
1079-
* <p>If you use more than 2 layers, you receive a <code>ValidationException</code> exception
1080-
* with the message "<code>AttributeFilter</code> cannot have a depth of more than 2."</p>
1081-
* <p>If you use more than 10 attribute filters in a given list for <code>AndAllFilters</code>
1082-
* or <code>OrAllFilters</code>, you receive a <code>ValidationException</code> with the
1083-
* message "<code>AttributeFilter</code> cannot have a length of more than 10".</p>
1096+
* </ul>
1097+
* <p>This example filters results or documents that belong to the HR department
1098+
* <i>and</i> belong to projects that contain "new hires"
1099+
* <i>or</i> "new hiring" in the project name (must use
1100+
* <code>ContainAny</code> with <code>StringListValue</code>). This example is
1101+
* filtering with a depth of 2.</p>
1102+
* <p>You cannot filter more than a depth of 2, otherwise you receive a
1103+
* <code>ValidationException</code> exception with the message "AttributeFilter
1104+
* cannot have a depth of more than 2." Also, if you use more than 10 attribute
1105+
* filters in a given list for <code>AndAllFilters</code> or <code>OrAllFilters</code>,
1106+
* you receive a <code>ValidationException</code> with the message "AttributeFilter
1107+
* cannot have a length of more than 10".</p>
1108+
* <p>For examples of using <code>AttributeFilter</code>, see <a href="https://docs.aws.amazon.com/kendra/latest/dg/filtering.html#search-filtering">Using
1109+
* document attributes to filter search results</a>.</p>
10841110
*/
10851111
export interface AttributeFilter {
10861112
/**
10871113
* @public
1088-
* <p>Performs a logical <code>AND</code> operation on all supplied filters.</p>
1114+
* <p>Performs a logical <code>AND</code> operation on all filters that you specify.</p>
10891115
*/
10901116
AndAllFilters?: AttributeFilter[];
10911117

10921118
/**
10931119
* @public
1094-
* <p>Performs a logical <code>OR</code> operation on all supplied filters.</p>
1120+
* <p>Performs a logical <code>OR</code> operation on all filters that you specify.</p>
10951121
*/
10961122
OrAllFilters?: AttributeFilter[];
10971123

10981124
/**
10991125
* @public
1100-
* <p>Performs a logical <code>NOT</code> operation on all supplied filters.</p>
1126+
* <p>Performs a logical <code>NOT</code> operation on all filters that you specify.</p>
11011127
*/
11021128
NotFilter?: AttributeFilter;
11031129

11041130
/**
11051131
* @public
1106-
* <p>Performs an equals operation on two document attributes or metadata fields.</p>
1132+
* <p>Performs an equals operation on document attributes/fields and their values.</p>
11071133
*/
11081134
EqualsTo?: DocumentAttribute;
11091135

11101136
/**
11111137
* @public
1112-
* <p>Returns true when a document contains all of the specified document attributes or
1113-
* metadata fields. This filter is only applicable to <code>StringListValue</code>
1114-
* metadata.</p>
1138+
* <p>Returns true when a document contains all of the specified document attributes/fields.
1139+
* This filter is only applicable to <a href="https://docs.aws.amazon.com/kendra/latest/APIReference/API_DocumentAttributeValue.html">StringListValue</a>.</p>
11151140
*/
11161141
ContainsAll?: DocumentAttribute;
11171142

11181143
/**
11191144
* @public
1120-
* <p>Returns true when a document contains any of the specified document attributes or
1121-
* metadata fields. This filter is only applicable to <code>StringListValue</code>
1122-
* metadata.</p>
1145+
* <p>Returns true when a document contains any of the specified document attributes/fields.
1146+
* This filter is only applicable to <a href="https://docs.aws.amazon.com/kendra/latest/APIReference/API_DocumentAttributeValue.html">StringListValue</a>.</p>
11231147
*/
11241148
ContainsAny?: DocumentAttribute;
11251149

11261150
/**
11271151
* @public
1128-
* <p>Performs a greater than operation on two document attributes or metadata fields. Use
1129-
* with a document attribute of type <code>Date</code> or <code>Long</code>.</p>
1152+
* <p>Performs a greater than operation on document attributes/fields and their
1153+
* values. Use with the <a href="https://docs.aws.amazon.com/kendra/latest/APIReference/API_DocumentAttributeValue.html">document attribute
1154+
* type</a>
1155+
* <code>Date</code> or <code>Long</code>.</p>
11301156
*/
11311157
GreaterThan?: DocumentAttribute;
11321158

11331159
/**
11341160
* @public
1135-
* <p>Performs a greater or equals than operation on two document attributes or metadata
1136-
* fields. Use with a document attribute of type <code>Date</code> or
1137-
* <code>Long</code>.</p>
1161+
* <p>Performs a greater or equals than operation on document attributes/fields and
1162+
* their values. Use with the <a href="https://docs.aws.amazon.com/kendra/latest/APIReference/API_DocumentAttributeValue.html">document attribute
1163+
* type</a>
1164+
* <code>Date</code> or <code>Long</code>.</p>
11381165
*/
11391166
GreaterThanOrEquals?: DocumentAttribute;
11401167

11411168
/**
11421169
* @public
1143-
* <p>Performs a less than operation on two document attributes or metadata fields. Use with a
1144-
* document attribute of type <code>Date</code> or <code>Long</code>.</p>
1170+
* <p>Performs a less than operation on document attributes/fields and their values.
1171+
* Use with the <a href="https://docs.aws.amazon.com/kendra/latest/APIReference/API_DocumentAttributeValue.html">document attribute
1172+
* type</a>
1173+
* <code>Date</code> or <code>Long</code>.</p>
11451174
*/
11461175
LessThan?: DocumentAttribute;
11471176

11481177
/**
11491178
* @public
1150-
* <p>Performs a less than or equals operation on two document attributes or metadata fields.
1151-
* Use with a document attribute of type <code>Date</code> or <code>Long</code>.</p>
1179+
* <p>Performs a less than or equals operation on document attributes/fields and
1180+
* their values. Use with the <a href="https://docs.aws.amazon.com/kendra/latest/APIReference/API_DocumentAttributeValue.html">document attribute
1181+
* type</a>
1182+
* <code>Date</code> or <code>Long</code>.</p>
11521183
*/
11531184
LessThanOrEquals?: DocumentAttribute;
11541185
}

0 commit comments

Comments
 (0)