| 1 | import type * as personalizeruntime from "@distilled.cloud/aws/personalize-runtime"; |
| 2 | import type * as Effect from "effect/Effect"; |
| 3 | import * as Binding from "../../Binding.ts"; |
| 4 | |
| 5 | /** |
| 6 | * Runtime binding for `personalize:GetActionRecommendations` — Returns a list of recommended actions (next best action) for a user |
| 7 | * from a campaign backed by the NEXT_BEST_ACTION recipe. Campaign ARNs |
| 8 | * are chosen at runtime, so the binding takes no arguments and grants |
| 9 | * `personalize:GetActionRecommendations` on `*`. |
| 10 | * Provide the implementation with |
| 11 | * `Effect.provide(AWS.Personalize.GetActionRecommendationsHttp)`. |
| 12 | * |
| 13 | * ### Serving Recommendations |
| 14 | * **Example:** Recommend Actions for a User |
| 15 | * ```typescript |
| 16 | * // init |
| 17 | * const getActionRecommendations = yield* Personalize.GetActionRecommendations(); |
| 18 | * |
| 19 | * const { actionList } = yield* getActionRecommendations({ |
| 20 | * campaignArn, |
| 21 | * userId: "user-1", |
| 22 | * }); |
| 23 | * ``` |
| 24 | * |
| 25 | * @binding |
| 26 | */ |
| 27 | export interface GetActionRecommendations extends Binding.Service< |
| 28 | GetActionRecommendations, |
| 29 | "AWS.Personalize.GetActionRecommendations", |
| 30 | () => Effect.Effect< |
| 31 | ( |
| 32 | request: personalizeruntime.GetActionRecommendationsRequest, |
| 33 | ) => Effect.Effect< |
| 34 | personalizeruntime.GetActionRecommendationsResponse, |
| 35 | personalizeruntime.GetActionRecommendationsError |
| 36 | > |
| 37 | > |
| 38 | > {} |
| 39 | export const GetActionRecommendations = |
| 40 | Binding.Service<GetActionRecommendations>( |
| 41 | "AWS.Personalize.GetActionRecommendations", |
| 42 | ); |