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

main
ts 48 lines 1.47 KB
Raw
1 import type * as lexr from "@distilled.cloud/aws/lex-runtime-v2";
2 import * as Binding from "alchemy/Binding";
3 import type * as Effect from "effect/Effect";
4 import type { BotAlias } from "./BotAlias.ts";
5
6 /**
7 * The `PutSession` request with the binding-injected `botId` and
8 * `botAliasId` removed. `sessionState` is the new state of the conversation
9 * (active intent, slots, dialog action, session attributes).
10 */
11 export interface PutSessionRequest extends Omit<lexr.PutSessionRequest, "botId" | "botAliasId"> {}
12
13 /**
14 * Runtime binding for `lex:PutSession` — create or overwrite the session
15 * state of a conversation with an Amazon Lex V2 bot alias, letting your
16 * application steer the dialog (e.g. pre-fill slots or elicit a specific
17 * intent).
18 *
19 * ### Managing Sessions
20 * **Example:** Steer the Conversation
21 * ```typescript
22 * // init
23 * const putSession = yield* AWS.LexV2.PutSession(alias);
24 *
25 * // runtime
26 * yield* putSession({
27 * localeId: "en_US",
28 * sessionId: "user-123",
29 * sessionState: {
30 * intent: { name: "OrderPizza", slots: {} },
31 * dialogAction: { type: "ElicitSlot", slotToElicit: "Size" },
32 * },
33 * });
34 * ```
35 *
36 * @binding
37 */
38 export interface PutSession extends Binding.Service<
39 PutSession,
40 "AWS.LexV2.PutSession",
41 (
42 alias: BotAlias,
43 ) => Effect.Effect<
44 (request: PutSessionRequest) => Effect.Effect<lexr.PutSessionResponse, lexr.PutSessionError>
45 >
46 > {}
47
48 export const PutSession = Binding.Service<PutSession>("AWS.LexV2.PutSession");