query_assistant

ConnectWisdomService.Client.query_assistant(**kwargs)

Performs a manual search against the specified assistant. To retrieve recommendations for an assistant, use GetRecommendations.

See also: AWS API Documentation

Request Syntax

response = client.query_assistant(
    assistantId='string',
    maxResults=123,
    nextToken='string',
    queryText='string'
)
Parameters
  • assistantId (string) --

    [REQUIRED]

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

  • maxResults (integer) -- The maximum number of results to return per page.
  • nextToken (string) -- The token for the next set of results. Use the value returned in the previous response in the next request to retrieve the next set of results.
  • queryText (string) --

    [REQUIRED]

    The text to search for.

Return type

dict

Returns

Response Syntax

{
    'nextToken': 'string',
    'results': [
        {
            'document': {
                'contentReference': {
                    'contentArn': 'string',
                    'contentId': 'string',
                    'knowledgeBaseArn': 'string',
                    'knowledgeBaseId': 'string'
                },
                'excerpt': {
                    'highlights': [
                        {
                            'beginOffsetInclusive': 123,
                            'endOffsetExclusive': 123
                        },
                    ],
                    'text': 'string'
                },
                'title': {
                    'highlights': [
                        {
                            'beginOffsetInclusive': 123,
                            'endOffsetExclusive': 123
                        },
                    ],
                    'text': 'string'
                }
            },
            'relevanceScore': 123.0,
            'resultId': 'string'
        },
    ]
}

Response Structure

  • (dict) --

    • nextToken (string) --

      If there are additional results, this is the token for the next set of results.

    • results (list) --

      The results of the query.

      • (dict) --

        Information about the result.

        • document (dict) --

          The document.

          • contentReference (dict) --

            A reference to the content resource.

            • contentArn (string) --

              The Amazon Resource Name (ARN) of the content.

            • contentId (string) --

              The identifier of the content.

            • knowledgeBaseArn (string) --

              The Amazon Resource Name (ARN) of the knowledge base.

            • knowledgeBaseId (string) --

              The identifier of the knowledge base.

          • excerpt (dict) --

            The excerpt from the document.

            • highlights (list) --

              Highlights in the document text.

              • (dict) --

                Offset specification to describe highlighting of document excerpts for rendering search results and recommendations.

                • beginOffsetInclusive (integer) --

                  The offset for the start of the highlight.

                • endOffsetExclusive (integer) --

                  The offset for the end of the highlight.

            • text (string) --

              Text in the document.

          • title (dict) --

            The title of the document.

            • highlights (list) --

              Highlights in the document text.

              • (dict) --

                Offset specification to describe highlighting of document excerpts for rendering search results and recommendations.

                • beginOffsetInclusive (integer) --

                  The offset for the start of the highlight.

                • endOffsetExclusive (integer) --

                  The offset for the end of the highlight.

            • text (string) --

              Text in the document.

        • relevanceScore (float) --

          The relevance score of the results.

        • resultId (string) --

          The identifier of the result data.

Exceptions

  • ConnectWisdomService.Client.exceptions.ValidationException
  • ConnectWisdomService.Client.exceptions.AccessDeniedException
  • ConnectWisdomService.Client.exceptions.ResourceNotFoundException