The best way to control Claude Code, Codex and more from any computer or phone

main
ts 53 lines 1.7 KB
Raw
1 import type * as kendra from "@distilled.cloud/aws/kendra";
2 import * as Binding from "alchemy/Binding";
3 import type * as Effect from "effect/Effect";
4 import type { Index } from "./SearchIndex.ts";
5
6 /**
7 * `BatchPutDocument` request with `IndexId` injected from the bound index.
8 */
9 export interface BatchPutDocumentRequest extends Omit<kendra.BatchPutDocumentRequest, "IndexId"> {}
10
11 /**
12 * Runtime binding for the `BatchPutDocument` operation (IAM action
13 * `kendra:BatchPutDocument`), scoped to one {@link Index}.
14 *
15 * Adds documents directly to the index (inline blobs or S3 paths) —
16 * the push-API alternative to a data-source sync. Check the response's
17 * `FailedDocuments` for per-document errors; documents index
18 * asynchronously (poll with {@link BatchGetDocumentStatus}).
19 * Provide the implementation with
20 * `Effect.provide(AWS.Kendra.BatchPutDocumentHttp)`.
21 *
22 * ### Indexing Documents
23 * **Example:** Index Documents Inline
24 * ```typescript
25 * const putDocuments = yield* AWS.Kendra.BatchPutDocument(index);
26 *
27 * const result = yield* putDocuments({
28 * Documents: [
29 * {
30 * Id: "welcome",
31 * Title: "Welcome",
32 * Blob: new TextEncoder().encode("Hello from Alchemy"),
33 * ContentType: "PLAIN_TEXT",
34 * },
35 * ],
36 * });
37 * // result.FailedDocuments is empty on success
38 * ```
39 *
40 * @binding
41 */
42 export interface BatchPutDocument extends Binding.Service<
43 BatchPutDocument,
44 "AWS.Kendra.BatchPutDocument",
45 (
46 index: Index,
47 ) => Effect.Effect<
48 (
49 request: BatchPutDocumentRequest,
50 ) => Effect.Effect<kendra.BatchPutDocumentResponse, kendra.BatchPutDocumentError>
51 >
52 > {}
53 export const BatchPutDocument = Binding.Service<BatchPutDocument>("AWS.Kendra.BatchPutDocument");