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년 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠