| 1 | import * as lexr from "@distilled.cloud/aws/lex-runtime-v2"; |
| 2 | import * as Layer from "effect/Layer"; |
| 3 | import { makeLexAliasHttpBinding } from "./BindingHttp.ts"; |
| 4 | import { |
| 5 | RecognizeUtterance, |
| 6 | type RecognizeUtteranceRequest, |
| 7 | } from "./RecognizeUtterance.ts"; |
| 8 | |
| 9 | /** |
| 10 | * HTTP implementation of {@link RecognizeUtterance} — calls the |
| 11 | * `lex-runtime-v2` `RecognizeUtterance` operation with the Lambda role's |
| 12 | * credentials and grants the host `lex:RecognizeUtterance` on the alias. |
| 13 | */ |
| 14 | export const RecognizeUtteranceHttp = Layer.effect( |
| 15 | RecognizeUtterance, |
| 16 | makeLexAliasHttpBinding< |
| 17 | RecognizeUtteranceRequest, |
| 18 | lexr.RecognizeUtteranceResponse, |
| 19 | lexr.RecognizeUtteranceError |
| 20 | >({ |
| 21 | capability: "RecognizeUtterance", |
| 22 | iamActions: ["lex:RecognizeUtterance"], |
| 23 | operation: lexr.recognizeUtterance, |
| 24 | }), |
| 25 | ); |