@devries-cameron20 / t3code Mirror · read-only
Fork 0

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

Mirrored from https://github.com/Camo67/t3code.git

Synced Nov 21, 04:45 UTC

main
ts 41 lines 1.35 KB
Raw
1 import type * as comprehend from "@distilled.cloud/aws/comprehend";
2 import * as Binding from "alchemy/Binding";
3 import type * as Effect from "effect/Effect";
4
5 /**
6 * Runtime binding for `comprehend:ClassifyDocument` — classify a single
7 * document in real time against a custom classifier endpoint or a
8 * Comprehend prebuilt model ARN (`EndpointArn`).
9 *
10 * The binding takes no arguments and grants the action on `*` — endpoints
11 * are addressed per-request via `EndpointArn`, so the grant cannot be
12 * scoped tighter at deploy time.
13 *
14 * ### Real-Time Analysis
15 * **Example:** Classify a Document Against a Custom Endpoint
16 * ```typescript
17 * // init
18 * const classifyDocument = yield* AWS.Comprehend.ClassifyDocument();
19 *
20 * // runtime
21 * const result = yield* classifyDocument({
22 * Text: "Subject: your invoice for March is attached",
23 * EndpointArn: endpointArn,
24 * });
25 * // result.Classes: [{ Name: "INVOICE", Score: 0.98 }, …]
26 * ```
27 *
28 * @binding
29 */
30 export interface ClassifyDocument extends Binding.Service<
31 ClassifyDocument,
32 "AWS.Comprehend.ClassifyDocument",
33 () => Effect.Effect<
34 (
35 request: comprehend.ClassifyDocumentRequest,
36 ) => Effect.Effect<comprehend.ClassifyDocumentResponse, comprehend.ClassifyDocumentError>
37 >
38 > {}
39 export const ClassifyDocument = Binding.Service<ClassifyDocument>(
40 "AWS.Comprehend.ClassifyDocument",
41 );