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
| 1 | import type * as featurestore from "@distilled.cloud/aws/sagemaker-featurestore-runtime"; |
| 2 | import * as Binding from "alchemy/Binding"; |
| 3 | import type * as Effect from "effect/Effect"; |
| 4 | import type { FeatureGroup } from "./FeatureGroup.ts"; |
| 5 | |
| 6 | export interface PutRecordRequest extends Omit<featurestore.PutRecordRequest, "FeatureGroupName"> {} |
| 7 | |
| 8 | /** |
| 9 | * Runtime binding for `sagemaker:PutRecord` — write a record to a |
| 10 | * `FeatureGroup`'s online store (and, when configured, its offline store). |
| 11 | * |
| 12 | * Bind this operation to a `FeatureGroup` inside a function runtime to get a |
| 13 | * callable that automatically injects the feature group name. Every feature |
| 14 | * value is passed as a string (`ValueAsString`) — the feature group's schema |
| 15 | * declares the actual types. |
| 16 | * ### Writing Records |
| 17 | * **Example:** Put a Record |
| 18 | * ```typescript |
| 19 | * // init |
| 20 | * const putRecord = yield* AWS.SageMaker.PutRecord(featureGroup); |
| 21 | * |
| 22 | * // runtime |
| 23 | * yield* putRecord({ |
| 24 | * Record: [ |
| 25 | * { FeatureName: "user_id", ValueAsString: "user-123" }, |
| 26 | * { FeatureName: "event_time", ValueAsString: new Date().toISOString() }, |
| 27 | * { FeatureName: "clicks", ValueAsString: "42" }, |
| 28 | * ], |
| 29 | * }); |
| 30 | * ``` |
| 31 | * |
| 32 | * @binding |
| 33 | */ |
| 34 | export interface PutRecord extends Binding.Service< |
| 35 | PutRecord, |
| 36 | "AWS.SageMaker.PutRecord", |
| 37 | <F extends FeatureGroup>( |
| 38 | featureGroup: F, |
| 39 | ) => Effect.Effect< |
| 40 | ( |
| 41 | request: PutRecordRequest, |
| 42 | ) => Effect.Effect<featurestore.PutRecordResponse, featurestore.PutRecordError> |
| 43 | > |
| 44 | > {} |
| 45 | export const PutRecord = Binding.Service<PutRecord>("AWS.SageMaker.PutRecord"); |