@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 44 lines 1.48 KB
Raw
1 import type * as polly from "@distilled.cloud/aws/polly";
2 import * as Binding from "alchemy/Binding";
3 import type * as Effect from "effect/Effect";
4
5 /**
6 * Runtime binding for `polly:GetSpeechSynthesisTask` — retrieve the status
7 * (and output S3 URI) of an asynchronous synthesis task by its TaskId.
8 *
9 * The binding takes no arguments and grants the function
10 * `polly:GetSpeechSynthesisTask`. Provide the implementation with
11 * `Effect.provide(AWS.Polly.GetSpeechSynthesisTaskHttp)`.
12 *
13 * ### Asynchronous Synthesis
14 * **Example:** Poll a synthesis task until it completes
15 * ```typescript
16 * // init
17 * const getSpeechSynthesisTask = yield* AWS.Polly.GetSpeechSynthesisTask();
18 *
19 * // runtime — bounded poll until the task leaves the queue
20 * const task = yield* getSpeechSynthesisTask({ TaskId: taskId }).pipe(
21 * Effect.repeat({
22 * schedule: Schedule.spaced("2 seconds"),
23 * until: (r): boolean =>
24 * r.SynthesisTask?.TaskStatus === "completed" ||
25 * r.SynthesisTask?.TaskStatus === "failed",
26 * times: 25,
27 * }),
28 * );
29 * ```
30 *
31 * @binding
32 */
33 export interface GetSpeechSynthesisTask extends Binding.Service<
34 GetSpeechSynthesisTask,
35 "AWS.Polly.GetSpeechSynthesisTask",
36 () => Effect.Effect<
37 (
38 request: polly.GetSpeechSynthesisTaskInput,
39 ) => Effect.Effect<polly.GetSpeechSynthesisTaskOutput, polly.GetSpeechSynthesisTaskError>
40 >
41 > {}
42 export const GetSpeechSynthesisTask = Binding.Service<GetSpeechSynthesisTask>(
43 "AWS.Polly.GetSpeechSynthesisTask",
44 );