| 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:GetPersonalizedRanking` — Re-ranks a caller-supplied list of items for a user using a campaign |
| 7 | * backed by the Personalized-Ranking recipe. Campaign ARNs are chosen at |
| 8 | * runtime, so the binding takes no arguments and grants |
| 9 | * `personalize:GetPersonalizedRanking` on `*`. |
| 10 | * Provide the implementation with |
| 11 | * `Effect.provide(AWS.Personalize.GetPersonalizedRankingHttp)`. |
| 12 | * |
| 13 | * ### Serving Recommendations |
| 14 | * **Example:** Rank Items for a User |
| 15 | * ```typescript |
| 16 | * // init |
| 17 | * const getPersonalizedRanking = yield* Personalize.GetPersonalizedRanking(); |
| 18 | * |
| 19 | * const { personalizedRanking } = yield* getPersonalizedRanking({ |
| 20 | * campaignArn, |
| 21 | * userId: "user-1", |
| 22 | * inputList: ["item-1", "item-2", "item-3"], |
| 23 | * }); |
| 24 | * ``` |
| 25 | * |
| 26 | * @binding |
| 27 | */ |
| 28 | export interface GetPersonalizedRanking extends Binding.Service< |
| 29 | GetPersonalizedRanking, |
| 30 | "AWS.Personalize.GetPersonalizedRanking", |
| 31 | () => Effect.Effect< |
| 32 | ( |
| 33 | request: personalizeruntime.GetPersonalizedRankingRequest, |
| 34 | ) => Effect.Effect< |
| 35 | personalizeruntime.GetPersonalizedRankingResponse, |
| 36 | personalizeruntime.GetPersonalizedRankingError |
| 37 | > |
| 38 | > |
| 39 | > {} |
| 40 | export const GetPersonalizedRanking = Binding.Service<GetPersonalizedRanking>( |
| 41 | "AWS.Personalize.GetPersonalizedRanking", |
| 42 | ); |