Skip to content

Get Recommendations

connectwisdomservice_get_recommendations R Documentation

Retrieves recommendations for the specified session

Description

Retrieves recommendations for the specified session. To avoid retrieving the same recommendations in subsequent calls, use notify_recommendations_received. This API supports long-polling behavior with the waitTimeSeconds parameter. Short poll is the default behavior and only returns recommendations already available. To perform a manual query against an assistant, use query_assistant.

Usage

connectwisdomservice_get_recommendations(assistantId, maxResults,
  sessionId, waitTimeSeconds)

Arguments

assistantId

[required] The identifier of the Wisdom assistant. Can be either the ID or the ARN. URLs cannot contain the ARN.

maxResults

The maximum number of results to return per page.

sessionId

[required] The identifier of the session. Can be either the ID or the ARN. URLs cannot contain the ARN.

waitTimeSeconds

The duration (in seconds) for which the call waits for a recommendation to be made available before returning. If a recommendation is available, the call returns sooner than WaitTimeSeconds. If no messages are available and the wait time expires, the call returns successfully with an empty list.

Value

A list with the following syntax:

list(
  recommendations = list(
    list(
      document = list(
        contentReference = list(
          contentArn = "string",
          contentId = "string",
          knowledgeBaseArn = "string",
          knowledgeBaseId = "string"
        ),
        excerpt = list(
          highlights = list(
            list(
              beginOffsetInclusive = 123,
              endOffsetExclusive = 123
            )
          ),
          text = "string"
        ),
        title = list(
          highlights = list(
            list(
              beginOffsetInclusive = 123,
              endOffsetExclusive = 123
            )
          ),
          text = "string"
        )
      ),
      recommendationId = "string",
      relevanceLevel = "HIGH"|"MEDIUM"|"LOW",
      relevanceScore = 123.0,
      type = "KNOWLEDGE_CONTENT"
    )
  ),
  triggers = list(
    list(
      data = list(
        query = list(
          text = "string"
        )
      ),
      id = "string",
      recommendationIds = list(
        "string"
      ),
      source = "ISSUE_DETECTION"|"RULE_EVALUATION"|"OTHER",
      type = "QUERY"
    )
  )
)

Request syntax

svc$get_recommendations(
  assistantId = "string",
  maxResults = 123,
  sessionId = "string",
  waitTimeSeconds = 123
)