@devries-cameron20 / t3code Mirror · read-only
Fork 0

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, 06:00 UTC

main
ts 45 lines 1.24 KB
Raw
1 import type * as ml from "@distilled.cloud/gcp/ml_v1";
2 import * as Binding from "alchemy/Binding";
3 import type { RuntimeContext } from "alchemy/RuntimeContext";
4 import type * as Effect from "effect/Effect";
5 import type { Model } from "./Model.ts";
6
7 export interface PredictRequest extends Omit<ml.PredictProjectsRequest, "name"> {}
8
9 /**
10 * Runtime binding for AI Platform (legacy ML Engine) `projects.predict`.
11 *
12 * Bind this operation to a {@link Model} in a Function/Action init
13 * phase. Requests that omit a version use the model's default version.
14 * Provide {@link PredictHttp}.
15 *
16 * ### Predicting
17 * **Example:** Score instances
18 * ```typescript
19 * const predict = yield* GCP.ML.Predict(model);
20 * const result = yield* predict({
21 * body: {
22 * httpBody: {
23 * contentType: "application/json",
24 * data: btoa(JSON.stringify({ instances: [{ f1: 1 }] })),
25 * },
26 * },
27 * });
28 * ```
29 *
30 * @binding
31 * @category ML
32 */
33 export interface Predict extends Binding.Service<
34 Predict,
35 "GCP.ML.Predict",
36 (
37 model: Model,
38 ) => Effect.Effect<
39 (
40 request: PredictRequest,
41 ) => Effect.Effect<ml.GoogleApi__HttpBody, ml.PredictProjectsError, RuntimeContext>
42 >
43 > {}
44
45 export const Predict = Binding.Service<Predict>("GCP.ML.Predict");