| 1 | import type * as aiplatform from "@distilled.cloud/gcp/aiplatform_v1"; |
| 2 | import type * as Effect from "effect/Effect"; |
| 3 | import * as Binding from "../../Binding.ts"; |
| 4 | import type { RuntimeContext } from "../../RuntimeContext.ts"; |
| 5 | import type { ReasoningEngine } from "./ReasoningEngine.ts"; |
| 6 | |
| 7 | export interface QueryReasoningEngineRequest extends Omit< |
| 8 | aiplatform.QueryReasoningEnginesRequest, |
| 9 | "name" |
| 10 | > {} |
| 11 | |
| 12 | /** |
| 13 | * Runtime binding for Vertex AI `reasoningEngines.query`. |
| 14 | * |
| 15 | * Bind this operation to a {@link ReasoningEngine} in a Function/Action |
| 16 | * init phase. Provide {@link QueryReasoningEngineHttp}. |
| 17 | * |
| 18 | * ### Querying |
| 19 | * **Example:** Call the default query method |
| 20 | * ```typescript |
| 21 | * const query = yield* GCP.AIPlatform.QueryReasoningEngine(engine); |
| 22 | * const result = yield* query({ |
| 23 | * body: { input: { input: "hello" } }, |
| 24 | * }); |
| 25 | * ``` |
| 26 | * |
| 27 | * @binding |
| 28 | * @category AIPlatform |
| 29 | */ |
| 30 | export interface QueryReasoningEngine extends Binding.Service< |
| 31 | QueryReasoningEngine, |
| 32 | "GCP.AIPlatform.QueryReasoningEngine", |
| 33 | ( |
| 34 | engine: ReasoningEngine, |
| 35 | ) => Effect.Effect< |
| 36 | ( |
| 37 | request?: QueryReasoningEngineRequest, |
| 38 | ) => Effect.Effect< |
| 39 | aiplatform.GoogleCloudAiplatformV1QueryReasoningEngineResponse, |
| 40 | aiplatform.QueryReasoningEnginesError, |
| 41 | RuntimeContext |
| 42 | > |
| 43 | > |
| 44 | > {} |
| 45 | |
| 46 | export const QueryReasoningEngine = Binding.Service<QueryReasoningEngine>( |
| 47 | "GCP.AIPlatform.QueryReasoningEngine", |
| 48 | ); |