RecommenderArn is not in GetRecommendationsRequest.builder

0

I am begginning in aws personalize basics so I imported data sets and created recommenders in the console and now I want to get the recommendations in code using aws SDK for java the problem is when I wanted to create a GetRecommendationsRequest to send to the getRecommendations in the builder a recommenderArn does not exist only a campaignArn but I am using domain data groups and in the docs it says there is supposed to be a recommenderArn this code is from DOCS:

public static void getRecs(PersonalizeRuntimeClient personalizeRuntimeClient, String recommenderArn, String userId){
      try {
          GetRecommendationsRequest recommendationsRequest = GetRecommendationsRequest.builder()
                  .recommenderArn(recommenderArn)
                  .numResults(10)
                  .userId(userId)
                  .build();

          GetRecommendationsResponse recommendationsResponse = personalizeRuntimeClient.getRecommendations(recommendationsRequest);
          List<PredictedItem> items = recommendationsResponse.itemList();

          for (PredictedItem item: items) {
              System.out.println("Item Id is : "+item.itemId());
          }
      } catch (AwsServiceException e) {
          System.err.println(e.awsErrorDetails().errorMessage());
          System.exit(1);
      }
  }

does anyone know what might be the issue ?

IKE
已提問 2 年前檢視次數 225 次
1 個回答
1

its ok its solved now was using older version that did not have the recommenderArn

IKE
已回答 2 年前

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南