1import type * as translate from "@distilled.cloud/gcp/translate_v3";
2import type * as Effect from "effect/Effect";
3import * as Binding from "../../Binding.ts";
4import type { RuntimeContext } from "../../RuntimeContext.ts";
5import type { AdaptiveMtDataset } from "./AdaptiveMtDataset.ts";
6
7export interface AdaptiveMtTranslateRequest {
8 /**
9 * Request body. `dataset` is filled from the bound Adaptive MT
10 * dataset.
11 */
12 body?: Omit<translate.AdaptiveMtTranslateRequest, "dataset">;
13}
14
15/**
16 * Runtime binding for Cloud Translation `adaptiveMtTranslate`.
17 *
18 * Bind this operation to an {@link AdaptiveMtDataset} in a Function/Action
19 * init phase. Provide {@link AdaptiveMtTranslateHttp}.
20 *
21 * ### Translating with Adaptive MT
22 * **Example:** Translate a sentence
23 * ```typescript
24 * const translateText = yield* GCP.Translate.AdaptiveMtTranslate(dataset);
25 * const result = yield* translateText({
26 * body: { content: ["Hello, world"] },
27 * });
28 * ```
29 *
30 * @binding
31 * @category Translate
32 */
33export interface AdaptiveMtTranslate extends Binding.Service<
34 AdaptiveMtTranslate,
35 "GCP.Translate.AdaptiveMtTranslate",
36 (
37 dataset: AdaptiveMtDataset,
38 ) => Effect.Effect<
39 (
40 request?: AdaptiveMtTranslateRequest,
41 ) => Effect.Effect<
42 translate.AdaptiveMtTranslateResponse,
43 translate.AdaptiveMtTranslateProjectsLocationsError,
44 RuntimeContext
45 >
46 >
47> {}
48
49export const AdaptiveMtTranslate = Binding.Service<AdaptiveMtTranslate>(
50 "GCP.Translate.AdaptiveMtTranslate",
51);