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

main
ts 40 lines 1.3 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:DetectToxicContent` — run toxicity
7 * analysis over a list of text segments; the response carries one result per
8 * segment with per-label scores (profanity, hate speech, harassment, …).
9 *
10 * The binding takes no arguments and grants the action on `*` (the action
11 * has no resource-level IAM).
12 *
13 * ### Real-Time Analysis
14 * **Example:** Score Text Segments for Toxicity
15 * ```typescript
16 * // init
17 * const detectToxicContent = yield* AWS.Comprehend.DetectToxicContent();
18 *
19 * // runtime
20 * const result = yield* detectToxicContent({
21 * TextSegments: [{ Text: "You are a wonderful person." }],
22 * LanguageCode: "en",
23 * });
24 * // result.ResultList[0].Toxicity ~ 0.01
25 * ```
26 *
27 * @binding
28 */
29 export interface DetectToxicContent extends Binding.Service<
30 DetectToxicContent,
31 "AWS.Comprehend.DetectToxicContent",
32 () => Effect.Effect<
33 (
34 request: comprehend.DetectToxicContentRequest,
35 ) => Effect.Effect<comprehend.DetectToxicContentResponse, comprehend.DetectToxicContentError>
36 >
37 > {}
38 export const DetectToxicContent = Binding.Service<DetectToxicContent>(
39 "AWS.Comprehend.DetectToxicContent",
40 );