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

main
ts 41 lines 1.33 KB
Raw
1 import type * as qbusiness from "@distilled.cloud/aws/qbusiness";
2 import * as Binding from "alchemy/Binding";
3 import type * as Effect from "effect/Effect";
4 import type { Application } from "./Application.ts";
5
6 /**
7 * `ChatSync` request with `applicationId` injected from the bound application.
8 */
9 export interface ChatSyncRequest extends Omit<qbusiness.ChatSyncInput, "applicationId"> {}
10
11 /**
12 * Runtime binding for the `ChatSync` operation (IAM action
13 * `qbusiness:ChatSync`), scoped to one {@link Application}.
14 *
15 * Sends a user message to the application and returns the full
16 * AI-generated answer in one response, including source attributions
17 * and any suggested plugin actions.
18 * Provide the implementation with
19 * `Effect.provide(AWS.QBusiness.ChatSyncHttp)`.
20 *
21 * ### Chat
22 * **Example:** Ask a Question
23 * ```typescript
24 * const chat = yield* AWS.QBusiness.ChatSync(app);
25 *
26 * const reply = yield* chat({ userMessage: "What is our travel policy?" });
27 * console.log(reply.systemMessage);
28 * ```
29 *
30 * @binding
31 */
32 export interface ChatSync extends Binding.Service<
33 ChatSync,
34 "AWS.QBusiness.ChatSync",
35 (
36 application: Application,
37 ) => Effect.Effect<
38 (request?: ChatSyncRequest) => Effect.Effect<qbusiness.ChatSyncOutput, qbusiness.ChatSyncError>
39 >
40 > {}
41 export const ChatSync = Binding.Service<ChatSync>("AWS.QBusiness.ChatSync");