| 1 | import type * as kendra from "@distilled.cloud/aws/kendra"; |
| 2 | import type * as Effect from "effect/Effect"; |
| 3 | import * as Binding from "../../Binding.ts"; |
| 4 | import type { Index } from "./SearchIndex.ts"; |
| 5 | |
| 6 | /** |
| 7 | * `GetQuerySuggestions` request with `IndexId` injected from the bound index. |
| 8 | */ |
| 9 | export interface GetQuerySuggestionsRequest extends Omit< |
| 10 | kendra.GetQuerySuggestionsRequest, |
| 11 | "IndexId" |
| 12 | > {} |
| 13 | |
| 14 | /** |
| 15 | * Runtime binding for the `GetQuerySuggestions` operation (IAM action |
| 16 | * `kendra:GetQuerySuggestions`), scoped to one {@link Index}. |
| 17 | * |
| 18 | * Fetches typeahead query suggestions for a partial query string, based |
| 19 | * on the index's query history and/or document fields. |
| 20 | * Provide the implementation with |
| 21 | * `Effect.provide(AWS.Kendra.GetQuerySuggestionsHttp)`. |
| 22 | * |
| 23 | * ### Query Suggestions |
| 24 | * **Example:** Typeahead Suggestions |
| 25 | * ```typescript |
| 26 | * const suggest = yield* AWS.Kendra.GetQuerySuggestions(index); |
| 27 | * |
| 28 | * const { Suggestions } = yield* suggest({ QueryText: "how to conf" }); |
| 29 | * ``` |
| 30 | * |
| 31 | * @binding |
| 32 | */ |
| 33 | export interface GetQuerySuggestions extends Binding.Service< |
| 34 | GetQuerySuggestions, |
| 35 | "AWS.Kendra.GetQuerySuggestions", |
| 36 | ( |
| 37 | index: Index, |
| 38 | ) => Effect.Effect< |
| 39 | ( |
| 40 | request: GetQuerySuggestionsRequest, |
| 41 | ) => Effect.Effect< |
| 42 | kendra.GetQuerySuggestionsResponse, |
| 43 | kendra.GetQuerySuggestionsError |
| 44 | > |
| 45 | > |
| 46 | > {} |
| 47 | export const GetQuerySuggestions = Binding.Service<GetQuerySuggestions>( |
| 48 | "AWS.Kendra.GetQuerySuggestions", |
| 49 | ); |