diff --git a/clients/client-bedrock-agent-runtime/src/commands/RetrieveAndGenerateCommand.ts b/clients/client-bedrock-agent-runtime/src/commands/RetrieveAndGenerateCommand.ts index 7bfb69c9dbbc..6e9a005edc02 100644 --- a/clients/client-bedrock-agent-runtime/src/commands/RetrieveAndGenerateCommand.ts +++ b/clients/client-bedrock-agent-runtime/src/commands/RetrieveAndGenerateCommand.ts @@ -82,6 +82,8 @@ export interface RetrieveAndGenerateCommandOutput extends RetrieveAndGenerateRes * in: "", * notIn: "", * startsWith: "", + * listContains: "", + * stringContains: "", * andAll: [ // RetrievalFilterList * {// Union: only one key present * equals: "", @@ -93,6 +95,8 @@ export interface RetrieveAndGenerateCommandOutput extends RetrieveAndGenerateRes * in: "", * notIn: "", * startsWith: "", + * listContains: "", + * stringContains: "", * andAll: [ * "", * ], diff --git a/clients/client-bedrock-agent-runtime/src/commands/RetrieveCommand.ts b/clients/client-bedrock-agent-runtime/src/commands/RetrieveCommand.ts index 6da592e2be44..b098e034018f 100644 --- a/clients/client-bedrock-agent-runtime/src/commands/RetrieveCommand.ts +++ b/clients/client-bedrock-agent-runtime/src/commands/RetrieveCommand.ts @@ -77,6 +77,8 @@ export interface RetrieveCommandOutput extends RetrieveResponse, __MetadataBeare * in: "", * notIn: "", * startsWith: "", + * listContains: "", + * stringContains: "", * andAll: [ // RetrievalFilterList * {// Union: only one key present * equals: "", @@ -88,6 +90,8 @@ export interface RetrieveCommandOutput extends RetrieveResponse, __MetadataBeare * in: "", * notIn: "", * startsWith: "", + * listContains: "", + * stringContains: "", * andAll: [ * "", * ], diff --git a/clients/client-bedrock-agent-runtime/src/models/models_0.ts b/clients/client-bedrock-agent-runtime/src/models/models_0.ts index 6fa66132afcb..34cb802cb662 100644 --- a/clients/client-bedrock-agent-runtime/src/models/models_0.ts +++ b/clients/client-bedrock-agent-runtime/src/models/models_0.ts @@ -2721,7 +2721,7 @@ export interface RetrieveResponse { } /** - *

Specifies the filters to use on the metadata attributes in the knowledge base data sources before returning results. For more information, see Query configurations.

+ *

Specifies the filters to use on the metadata attributes in the knowledge base data sources before returning results. For more information, see Query configurations. See the examples below to see how to use these filters.

*

This data type is used in the following API operations:

*
    *
  • @@ -2743,10 +2743,12 @@ export type RetrievalFilter = | RetrievalFilter.InMember | RetrievalFilter.LessThanMember | RetrievalFilter.LessThanOrEqualsMember + | RetrievalFilter.ListContainsMember | RetrievalFilter.NotEqualsMember | RetrievalFilter.NotInMember | RetrievalFilter.OrAllMember | RetrievalFilter.StartsWithMember + | RetrievalFilter.StringContainsMember | RetrievalFilter.$UnknownMember; /** @@ -2754,7 +2756,11 @@ export type RetrievalFilter = */ export namespace RetrievalFilter { /** - *

    Knowledge base data sources that contain a metadata attribute whose name matches the key and whose value matches the value in this object are returned.

    + *

    Knowledge base data sources are returned if they contain a metadata attribute whose name matches the key and whose value matches the value in this object.

    + *

    The following example would return data sources with an animal attribute whose value is cat:

    + *

    + * "equals": \{ "key": "animal", "value": "cat" \} + *

    * @public */ export interface EqualsMember { @@ -2767,6 +2773,8 @@ export namespace RetrievalFilter { in?: never; notIn?: never; startsWith?: never; + listContains?: never; + stringContains?: never; andAll?: never; orAll?: never; $unknown?: never; @@ -2774,6 +2782,10 @@ export namespace RetrievalFilter { /** *

    Knowledge base data sources that contain a metadata attribute whose name matches the key and whose value doesn't match the value in this object are returned.

    + *

    The following example would return data sources that don't contain an animal attribute whose value is cat.

    + *

    + * "notEquals": \{ "key": "animal", "value": "cat" \} + *

    * @public */ export interface NotEqualsMember { @@ -2786,13 +2798,19 @@ export namespace RetrievalFilter { in?: never; notIn?: never; startsWith?: never; + listContains?: never; + stringContains?: never; andAll?: never; orAll?: never; $unknown?: never; } /** - *

    Knowledge base data sources that contain a metadata attribute whose name matches the key and whose value is greater than the value in this object are returned.

    + *

    Knowledge base data sources are returned if they contain a metadata attribute whose name matches the key and whose value is greater than the value in this object.

    + *

    The following example would return data sources with an year attribute whose value is greater than 1989:

    + *

    + * "greaterThan": \{ "key": "year", "value": 1989 \} + *

    * @public */ export interface GreaterThanMember { @@ -2805,13 +2823,19 @@ export namespace RetrievalFilter { in?: never; notIn?: never; startsWith?: never; + listContains?: never; + stringContains?: never; andAll?: never; orAll?: never; $unknown?: never; } /** - *

    Knowledge base data sources that contain a metadata attribute whose name matches the key and whose value is greater than or equal to the value in this object are returned.

    + *

    Knowledge base data sources are returned if they contain a metadata attribute whose name matches the key and whose value is greater than or equal to the value in this object.

    + *

    The following example would return data sources with an year attribute whose value is greater than or equal to 1989:

    + *

    + * "greaterThanOrEquals": \{ "key": "year", "value": 1989 \} + *

    * @public */ export interface GreaterThanOrEqualsMember { @@ -2824,13 +2848,19 @@ export namespace RetrievalFilter { in?: never; notIn?: never; startsWith?: never; + listContains?: never; + stringContains?: never; andAll?: never; orAll?: never; $unknown?: never; } /** - *

    Knowledge base data sources that contain a metadata attribute whose name matches the key and whose value is less than the value in this object are returned.

    + *

    Knowledge base data sources are returned if they contain a metadata attribute whose name matches the key and whose value is less than the value in this object.

    + *

    The following example would return data sources with an year attribute whose value is less than to 1989.

    + *

    + * "lessThan": \{ "key": "year", "value": 1989 \} + *

    * @public */ export interface LessThanMember { @@ -2843,13 +2873,19 @@ export namespace RetrievalFilter { in?: never; notIn?: never; startsWith?: never; + listContains?: never; + stringContains?: never; andAll?: never; orAll?: never; $unknown?: never; } /** - *

    Knowledge base data sources that contain a metadata attribute whose name matches the key and whose value is less than or equal to the value in this object are returned.

    + *

    Knowledge base data sources are returned if they contain a metadata attribute whose name matches the key and whose value is less than or equal to the value in this object.

    + *

    The following example would return data sources with an year attribute whose value is less than or equal to 1989.

    + *

    + * "lessThanOrEquals": \{ "key": "year", "value": 1989 \} + *

    * @public */ export interface LessThanOrEqualsMember { @@ -2862,13 +2898,19 @@ export namespace RetrievalFilter { in?: never; notIn?: never; startsWith?: never; + listContains?: never; + stringContains?: never; andAll?: never; orAll?: never; $unknown?: never; } /** - *

    Knowledge base data sources that contain a metadata attribute whose name matches the key and whose value is in the list specified in the value in this object are returned.

    + *

    Knowledge base data sources are returned if they contain a metadata attribute whose name matches the key and whose value is in the list specified in the value in this object.

    + *

    The following example would return data sources with an animal attribute that is either cat or dog:

    + *

    + * "in": \{ "key": "animal", "value": ["cat", "dog"] \} + *

    * @public */ export interface InMember { @@ -2881,13 +2923,19 @@ export namespace RetrievalFilter { in: FilterAttribute; notIn?: never; startsWith?: never; + listContains?: never; + stringContains?: never; andAll?: never; orAll?: never; $unknown?: never; } /** - *

    Knowledge base data sources that contain a metadata attribute whose name matches the key and whose value isn't in the list specified in the value in this object are returned.

    + *

    Knowledge base data sources are returned if they contain a metadata attribute whose name matches the key and whose value isn't in the list specified in the value in this object.

    + *

    The following example would return data sources whose animal attribute is neither cat nor dog.

    + *

    + * "notIn": \{ "key": "animal", "value": ["cat", "dog"] \} + *

    * @public */ export interface NotInMember { @@ -2900,13 +2948,19 @@ export namespace RetrievalFilter { in?: never; notIn: FilterAttribute; startsWith?: never; + listContains?: never; + stringContains?: never; andAll?: never; orAll?: never; $unknown?: never; } /** - *

    Knowledge base data sources that contain a metadata attribute whose name matches the key and whose value starts with the value in this object are returned. This filter is currently only supported for Amazon OpenSearch Serverless vector stores.

    + *

    Knowledge base data sources are returned if they contain a metadata attribute whose name matches the key and whose value starts with the value in this object. This filter is currently only supported for Amazon OpenSearch Serverless vector stores.

    + *

    The following example would return data sources with an animal attribute starts with ca (for example, cat or camel).

    + *

    + * "startsWith": \{ "key": "animal", "value": "ca" \} + *

    * @public */ export interface StartsWithMember { @@ -2919,13 +2973,75 @@ export namespace RetrievalFilter { in?: never; notIn?: never; startsWith: FilterAttribute; + listContains?: never; + stringContains?: never; andAll?: never; orAll?: never; $unknown?: never; } /** - *

    Knowledge base data sources whose metadata attributes fulfill all the filter conditions inside this list are returned.

    + *

    Knowledge base data sources are returned if they contain a metadata attribute whose name matches the key and whose value is a list that contains the value as one of its members.

    + *

    The following example would return data sources with an animals attribute that is a list containing a cat member (for example ["dog", "cat"]).

    + *

    + * "listContains": \{ "key": "animals", "value": "cat" \} + *

    + * @public + */ + export interface ListContainsMember { + equals?: never; + notEquals?: never; + greaterThan?: never; + greaterThanOrEquals?: never; + lessThan?: never; + lessThanOrEquals?: never; + in?: never; + notIn?: never; + startsWith?: never; + listContains: FilterAttribute; + stringContains?: never; + andAll?: never; + orAll?: never; + $unknown?: never; + } + + /** + *

    Knowledge base data sources are returned if they contain a metadata attribute whose name matches the key and whose value is one of the following:

    + *
      + *
    • + *

      A string that contains the value as a substring. The following example would return data sources with an animal attribute that contains the substring at (for example cat).

      + *

      + * "stringContains": \{ "key": "animal", "value": "at" \} + *

      + *
    • + *
    • + *

      A list with a member that contains the value as a substring. The following example would return data sources with an animals attribute that is a list containing a member that contains the substring at (for example ["dog", "cat"]).

      + *

      + * "stringContains": \{ "key": "animals", "value": "at" \} + *

      + *
    • + *
    + * @public + */ + export interface StringContainsMember { + equals?: never; + notEquals?: never; + greaterThan?: never; + greaterThanOrEquals?: never; + lessThan?: never; + lessThanOrEquals?: never; + in?: never; + notIn?: never; + startsWith?: never; + listContains?: never; + stringContains: FilterAttribute; + andAll?: never; + orAll?: never; + $unknown?: never; + } + + /** + *

    Knowledge base data sources are returned if their metadata attributes fulfill all the filter conditions inside this list.

    * @public */ export interface AndAllMember { @@ -2938,13 +3054,15 @@ export namespace RetrievalFilter { in?: never; notIn?: never; startsWith?: never; + listContains?: never; + stringContains?: never; andAll: RetrievalFilter[]; orAll?: never; $unknown?: never; } /** - *

    Knowledge base data sources whose metadata attributes fulfill at least one of the filter conditions inside this list are returned.

    + *

    Knowledge base data sources are returned if their metadata attributes fulfill at least one of the filter conditions inside this list.

    * @public */ export interface OrAllMember { @@ -2957,6 +3075,8 @@ export namespace RetrievalFilter { in?: never; notIn?: never; startsWith?: never; + listContains?: never; + stringContains?: never; andAll?: never; orAll: RetrievalFilter[]; $unknown?: never; @@ -2975,6 +3095,8 @@ export namespace RetrievalFilter { in?: never; notIn?: never; startsWith?: never; + listContains?: never; + stringContains?: never; andAll?: never; orAll?: never; $unknown: [string, any]; @@ -2990,6 +3112,8 @@ export namespace RetrievalFilter { in: (value: FilterAttribute) => T; notIn: (value: FilterAttribute) => T; startsWith: (value: FilterAttribute) => T; + listContains: (value: FilterAttribute) => T; + stringContains: (value: FilterAttribute) => T; andAll: (value: RetrievalFilter[]) => T; orAll: (value: RetrievalFilter[]) => T; _: (name: string, value: any) => T; @@ -3005,6 +3129,8 @@ export namespace RetrievalFilter { if (value.in !== undefined) return visitor.in(value.in); if (value.notIn !== undefined) return visitor.notIn(value.notIn); if (value.startsWith !== undefined) return visitor.startsWith(value.startsWith); + if (value.listContains !== undefined) return visitor.listContains(value.listContains); + if (value.stringContains !== undefined) return visitor.stringContains(value.stringContains); if (value.andAll !== undefined) return visitor.andAll(value.andAll); if (value.orAll !== undefined) return visitor.orAll(value.orAll); return visitor._(value.$unknown[0], value.$unknown[1]); @@ -3667,6 +3793,8 @@ export const RetrievalFilterFilterSensitiveLog = (obj: RetrievalFilter): any => if (obj.in !== undefined) return { in: obj.in }; if (obj.notIn !== undefined) return { notIn: obj.notIn }; if (obj.startsWith !== undefined) return { startsWith: obj.startsWith }; + if (obj.listContains !== undefined) return { listContains: obj.listContains }; + if (obj.stringContains !== undefined) return { stringContains: obj.stringContains }; if (obj.andAll !== undefined) return { andAll: SENSITIVE_STRING }; if (obj.orAll !== undefined) return { orAll: SENSITIVE_STRING }; if (obj.$unknown !== undefined) return { [obj.$unknown[0]]: "UNKNOWN" }; diff --git a/clients/client-bedrock-agent-runtime/src/protocols/Aws_restJson1.ts b/clients/client-bedrock-agent-runtime/src/protocols/Aws_restJson1.ts index d29305fee964..d14c0552fad9 100644 --- a/clients/client-bedrock-agent-runtime/src/protocols/Aws_restJson1.ts +++ b/clients/client-bedrock-agent-runtime/src/protocols/Aws_restJson1.ts @@ -818,10 +818,12 @@ const se_RetrievalFilter = (input: RetrievalFilter, context: __SerdeContext): an in: (value) => ({ in: se_FilterAttribute(value, context) }), lessThan: (value) => ({ lessThan: se_FilterAttribute(value, context) }), lessThanOrEquals: (value) => ({ lessThanOrEquals: se_FilterAttribute(value, context) }), + listContains: (value) => ({ listContains: se_FilterAttribute(value, context) }), notEquals: (value) => ({ notEquals: se_FilterAttribute(value, context) }), notIn: (value) => ({ notIn: se_FilterAttribute(value, context) }), orAll: (value) => ({ orAll: se_RetrievalFilterList(value, context) }), startsWith: (value) => ({ startsWith: se_FilterAttribute(value, context) }), + stringContains: (value) => ({ stringContains: se_FilterAttribute(value, context) }), _: (name, value) => ({ name: value } as any), }); }; diff --git a/codegen/sdk-codegen/aws-models/bedrock-agent-runtime.json b/codegen/sdk-codegen/aws-models/bedrock-agent-runtime.json index 07d3a1193f3a..9ee6ca014d7b 100644 --- a/codegen/sdk-codegen/aws-models/bedrock-agent-runtime.json +++ b/codegen/sdk-codegen/aws-models/bedrock-agent-runtime.json @@ -2722,72 +2722,84 @@ "equals": { "target": "com.amazonaws.bedrockagentruntime#FilterAttribute", "traits": { - "smithy.api#documentation": "

    Knowledge base data sources that contain a metadata attribute whose name matches the key and whose value matches the value in this object are returned.

    " + "smithy.api#documentation": "

    Knowledge base data sources are returned if they contain a metadata attribute whose name matches the key and whose value matches the value in this object.

    \n

    The following example would return data sources with an animal attribute whose value is cat:

    \n

    \n \"equals\": { \"key\": \"animal\", \"value\": \"cat\" }\n

    " } }, "notEquals": { "target": "com.amazonaws.bedrockagentruntime#FilterAttribute", "traits": { - "smithy.api#documentation": "

    Knowledge base data sources that contain a metadata attribute whose name matches the key and whose value doesn't match the value in this object are returned.

    " + "smithy.api#documentation": "

    Knowledge base data sources that contain a metadata attribute whose name matches the key and whose value doesn't match the value in this object are returned.

    \n

    The following example would return data sources that don't contain an animal attribute whose value is cat.

    \n

    \n \"notEquals\": { \"key\": \"animal\", \"value\": \"cat\" }\n

    " } }, "greaterThan": { "target": "com.amazonaws.bedrockagentruntime#FilterAttribute", "traits": { - "smithy.api#documentation": "

    Knowledge base data sources that contain a metadata attribute whose name matches the key and whose value is greater than the value in this object are returned.

    " + "smithy.api#documentation": "

    Knowledge base data sources are returned if they contain a metadata attribute whose name matches the key and whose value is greater than the value in this object.

    \n

    The following example would return data sources with an year attribute whose value is greater than 1989:

    \n

    \n \"greaterThan\": { \"key\": \"year\", \"value\": 1989 }\n

    " } }, "greaterThanOrEquals": { "target": "com.amazonaws.bedrockagentruntime#FilterAttribute", "traits": { - "smithy.api#documentation": "

    Knowledge base data sources that contain a metadata attribute whose name matches the key and whose value is greater than or equal to the value in this object are returned.

    " + "smithy.api#documentation": "

    Knowledge base data sources are returned if they contain a metadata attribute whose name matches the key and whose value is greater than or equal to the value in this object.

    \n

    The following example would return data sources with an year attribute whose value is greater than or equal to 1989:

    \n

    \n \"greaterThanOrEquals\": { \"key\": \"year\", \"value\": 1989 }\n

    " } }, "lessThan": { "target": "com.amazonaws.bedrockagentruntime#FilterAttribute", "traits": { - "smithy.api#documentation": "

    Knowledge base data sources that contain a metadata attribute whose name matches the key and whose value is less than the value in this object are returned.

    " + "smithy.api#documentation": "

    Knowledge base data sources are returned if they contain a metadata attribute whose name matches the key and whose value is less than the value in this object.

    \n

    The following example would return data sources with an year attribute whose value is less than to 1989.

    \n

    \n \"lessThan\": { \"key\": \"year\", \"value\": 1989 }\n

    " } }, "lessThanOrEquals": { "target": "com.amazonaws.bedrockagentruntime#FilterAttribute", "traits": { - "smithy.api#documentation": "

    Knowledge base data sources that contain a metadata attribute whose name matches the key and whose value is less than or equal to the value in this object are returned.

    " + "smithy.api#documentation": "

    Knowledge base data sources are returned if they contain a metadata attribute whose name matches the key and whose value is less than or equal to the value in this object.

    \n

    The following example would return data sources with an year attribute whose value is less than or equal to 1989.

    \n

    \n \"lessThanOrEquals\": { \"key\": \"year\", \"value\": 1989 }\n

    " } }, "in": { "target": "com.amazonaws.bedrockagentruntime#FilterAttribute", "traits": { - "smithy.api#documentation": "

    Knowledge base data sources that contain a metadata attribute whose name matches the key and whose value is in the list specified in the value in this object are returned.

    " + "smithy.api#documentation": "

    Knowledge base data sources are returned if they contain a metadata attribute whose name matches the key and whose value is in the list specified in the value in this object.

    \n

    The following example would return data sources with an animal attribute that is either cat or dog:

    \n

    \n \"in\": { \"key\": \"animal\", \"value\": [\"cat\", \"dog\"] }\n

    " } }, "notIn": { "target": "com.amazonaws.bedrockagentruntime#FilterAttribute", "traits": { - "smithy.api#documentation": "

    Knowledge base data sources that contain a metadata attribute whose name matches the key and whose value isn't in the list specified in the value in this object are returned.

    " + "smithy.api#documentation": "

    Knowledge base data sources are returned if they contain a metadata attribute whose name matches the key and whose value isn't in the list specified in the value in this object.

    \n

    The following example would return data sources whose animal attribute is neither cat nor dog.

    \n

    \n \"notIn\": { \"key\": \"animal\", \"value\": [\"cat\", \"dog\"] }\n

    " } }, "startsWith": { "target": "com.amazonaws.bedrockagentruntime#FilterAttribute", "traits": { - "smithy.api#documentation": "

    Knowledge base data sources that contain a metadata attribute whose name matches the key and whose value starts with the value in this object are returned. This filter is currently only supported for Amazon OpenSearch Serverless vector stores.

    " + "smithy.api#documentation": "

    Knowledge base data sources are returned if they contain a metadata attribute whose name matches the key and whose value starts with the value in this object. This filter is currently only supported for Amazon OpenSearch Serverless vector stores.

    \n

    The following example would return data sources with an animal attribute starts with ca (for example, cat or camel).

    \n

    \n \"startsWith\": { \"key\": \"animal\", \"value\": \"ca\" }\n

    " + } + }, + "listContains": { + "target": "com.amazonaws.bedrockagentruntime#FilterAttribute", + "traits": { + "smithy.api#documentation": "

    Knowledge base data sources are returned if they contain a metadata attribute whose name matches the key and whose value is a list that contains the value as one of its members.

    \n

    The following example would return data sources with an animals attribute that is a list containing a cat member (for example [\"dog\", \"cat\"]).

    \n

    \n \"listContains\": { \"key\": \"animals\", \"value\": \"cat\" }\n

    " + } + }, + "stringContains": { + "target": "com.amazonaws.bedrockagentruntime#FilterAttribute", + "traits": { + "smithy.api#documentation": "

    Knowledge base data sources are returned if they contain a metadata attribute whose name matches the key and whose value is one of the following:

    \n
      \n
    • \n

      A string that contains the value as a substring. The following example would return data sources with an animal attribute that contains the substring at (for example cat).

      \n

      \n \"stringContains\": { \"key\": \"animal\", \"value\": \"at\" }\n

      \n
    • \n
    • \n

      A list with a member that contains the value as a substring. The following example would return data sources with an animals attribute that is a list containing a member that contains the substring at (for example [\"dog\", \"cat\"]).

      \n

      \n \"stringContains\": { \"key\": \"animals\", \"value\": \"at\" }\n

      \n
    • \n
    " } }, "andAll": { "target": "com.amazonaws.bedrockagentruntime#RetrievalFilterList", "traits": { - "smithy.api#documentation": "

    Knowledge base data sources whose metadata attributes fulfill all the filter conditions inside this list are returned.

    " + "smithy.api#documentation": "

    Knowledge base data sources are returned if their metadata attributes fulfill all the filter conditions inside this list.

    " } }, "orAll": { "target": "com.amazonaws.bedrockagentruntime#RetrievalFilterList", "traits": { - "smithy.api#documentation": "

    Knowledge base data sources whose metadata attributes fulfill at least one of the filter conditions inside this list are returned.

    " + "smithy.api#documentation": "

    Knowledge base data sources are returned if their metadata attributes fulfill at least one of the filter conditions inside this list.

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

    Specifies the filters to use on the metadata attributes in the knowledge base data sources before returning results. For more information, see Query configurations.

    \n

    This data type is used in the following API operations:

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

    Specifies the filters to use on the metadata attributes in the knowledge base data sources before returning results. For more information, see Query configurations. See the examples below to see how to use these filters.

    \n

    This data type is used in the following API operations:

    \n ", "smithy.api#sensitive": {} } },