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
| 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 `GetSession` request with the binding-injected `botId` and |
| 8 | * `botAliasId` removed. `localeId` selects the conversation language and |
| 9 | * `sessionId` identifies the conversation — both remain caller-supplied. |
| 10 | */ |
| 11 | export interface GetSessionRequest extends Omit<lexr.GetSessionRequest, "botId" | "botAliasId"> {} |
| 12 | |
| 13 | /** |
| 14 | * Runtime binding for `lex:GetSession` — read the session state (active |
| 15 | * intent, slots, session attributes, interpretations) of a conversation |
| 16 | * with an Amazon Lex V2 bot alias. |
| 17 | * |
| 18 | * ### Managing Sessions |
| 19 | * **Example:** Inspect a User's Session |
| 20 | * ```typescript |
| 21 | * // init |
| 22 | * const getSession = yield* AWS.LexV2.GetSession(alias); |
| 23 | * |
| 24 | * // runtime |
| 25 | * const session = yield* getSession({ |
| 26 | * localeId: "en_US", |
| 27 | * sessionId: "user-123", |
| 28 | * }); |
| 29 | * const intent = session.sessionState?.intent?.name; |
| 30 | * ``` |
| 31 | * |
| 32 | * @binding |
| 33 | */ |
| 34 | export interface GetSession extends Binding.Service< |
| 35 | GetSession, |
| 36 | "AWS.LexV2.GetSession", |
| 37 | ( |
| 38 | alias: BotAlias, |
| 39 | ) => Effect.Effect< |
| 40 | (request: GetSessionRequest) => Effect.Effect<lexr.GetSessionResponse, lexr.GetSessionError> |
| 41 | > |
| 42 | > {} |
| 43 | |
| 44 | export const GetSession = Binding.Service<GetSession>("AWS.LexV2.GetSession"); |