| 1 | import type * as comprehend from "@distilled.cloud/aws/comprehend"; |
| 2 | import type * as Effect from "effect/Effect"; |
| 3 | import * as Binding from "../../Binding.ts"; |
| 4 | |
| 5 | /** |
| 6 | * Runtime binding for `comprehend:DetectSentiment` — infer the prevailing |
| 7 | * sentiment of a piece of text (`POSITIVE`, `NEGATIVE`, `NEUTRAL`, or |
| 8 | * `MIXED`). |
| 9 | * |
| 10 | * Comprehend's synchronous detect APIs are pure pay-per-call with no |
| 11 | * resource to manage: the binding takes no arguments and grants the |
| 12 | * function `comprehend:DetectSentiment` (the action has no resource-level |
| 13 | * IAM). |
| 14 | * |
| 15 | * ### Real-Time Analysis |
| 16 | * **Example:** Detect Sentiment of a Sentence |
| 17 | * ```typescript |
| 18 | * // init |
| 19 | * const detectSentiment = yield* AWS.Comprehend.DetectSentiment(); |
| 20 | * |
| 21 | * // runtime |
| 22 | * const result = yield* detectSentiment({ |
| 23 | * Text: "I love this product, it works wonderfully!", |
| 24 | * LanguageCode: "en", |
| 25 | * }); |
| 26 | * // result.Sentiment === "POSITIVE" |
| 27 | * // result.SentimentScore.Positive ~ 0.99 |
| 28 | * ``` |
| 29 | * |
| 30 | * @binding |
| 31 | */ |
| 32 | export interface DetectSentiment extends Binding.Service< |
| 33 | DetectSentiment, |
| 34 | "AWS.Comprehend.DetectSentiment", |
| 35 | () => Effect.Effect< |
| 36 | ( |
| 37 | request: comprehend.DetectSentimentRequest, |
| 38 | ) => Effect.Effect< |
| 39 | comprehend.DetectSentimentResponse, |
| 40 | comprehend.DetectSentimentError |
| 41 | > |
| 42 | > |
| 43 | > {} |
| 44 | export const DetectSentiment = Binding.Service<DetectSentiment>( |
| 45 | "AWS.Comprehend.DetectSentiment", |
| 46 | ); |