sailfork / t3code-github / .repos/ alchemy-effect/ packages/ aws/ src/ QApps/ PredictQApp.ts

import type * as qapps from "@distilled.cloud/aws/qapps";
import * as Binding from "alchemy/Binding";
import type * as Effect from "effect/Effect";
import type { QApp } from "./QApp.ts";

/**
 * Request for {@link PredictQApp} — `instanceId` is injected from the bound Q App.
 */
export interface PredictQAppRequest extends Omit<qapps.PredictQAppInput, "instanceId"> {}

/**
 * Runtime binding for `qapps:PredictQApp`.
 *
 * Generates a Q App definition from a natural-language problem statement or a Q Business conversation. Provide the implementation with
 * `Effect.provide(AWS.QApps.PredictQAppHttp)`.
 * ### Generation
 * **Example:** Generate an App Definition from a Prompt
 * ```typescript
 * // init — bind the operation to the Q App
 * const predictQApp = yield* AWS.QApps.PredictQApp(app);
 *
 * // runtime
 * const predicted = yield* predictQApp({
 *   options: {
 *     problemStatement: "Summarize meeting notes into action items",
 *   },
 * });
 * console.log(predicted.app.title);
 * ```
 *
 * @binding
 */
export interface PredictQApp extends Binding.Service<
  PredictQApp,
  "AWS.QApps.PredictQApp",
  (
    app: QApp,
  ) => Effect.Effect<
    (request?: PredictQAppRequest) => Effect.Effect<qapps.PredictQAppOutput, qapps.PredictQAppError>
  >
> {}

export const PredictQApp = Binding.Service<PredictQApp>("AWS.QApps.PredictQApp");