1import type * as qbusiness from "@distilled.cloud/aws/qbusiness";
2import type * as Effect from "effect/Effect";
3import * as Binding from "../../Binding.ts";
4import type { Application } from "./Application.ts";
5
6/**
7 * `SearchRelevantContent` request with `applicationId` injected from the bound application.
8 */
9export interface SearchRelevantContentRequest extends Omit<
10 qbusiness.SearchRelevantContentRequest,
11 "applicationId"
12> {}
13
14/**
15 * Runtime binding for the `SearchRelevantContent` operation (IAM action
16 * `qbusiness:SearchRelevantContent`), scoped to one {@link Application}.
17 *
18 * Searches an application's indexed content through a retriever and
19 * returns the relevant passages without generating an answer — the
20 * RAG retrieval half on its own.
21 * Provide the implementation with
22 * `Effect.provide(AWS.QBusiness.SearchRelevantContentHttp)`.
23 *
24 * ### Content Retrieval
25 * **Example:** Retrieve Relevant Passages
26 * ```typescript
27 * const search = yield* AWS.QBusiness.SearchRelevantContent(app);
28 *
29 * const results = yield* search({
30 * queryText: "expense reimbursement deadline",
31 * contentSource: { retriever: { retrieverId: retriever.retrieverId } },
32 * });
33 * ```
34 *
35 * @binding
36 */
37export interface SearchRelevantContent extends Binding.Service<
38 SearchRelevantContent,
39 "AWS.QBusiness.SearchRelevantContent",
40 (
41 application: Application,
42 ) => Effect.Effect<
43 (
44 request: SearchRelevantContentRequest,
45 ) => Effect.Effect<
46 qbusiness.SearchRelevantContentResponse,
47 qbusiness.SearchRelevantContentError
48 >
49 >
50> {}
51export const SearchRelevantContent = Binding.Service<SearchRelevantContent>(
52 "AWS.QBusiness.SearchRelevantContent",
53);