Class VirtualAssistantResource


  • @Path("/lumis/service/virtualassistant/{serviceInstanceId: [A-F0-9]{32}}")
    public class VirtualAssistantResource
    extends java.lang.Object
    REST resource used by the virtual assistant service.
    Since:
    16.1.0
    Version:
    $Revision$ $Date$
    • Constructor Detail

      • VirtualAssistantResource

        public VirtualAssistantResource()
    • Method Detail

      • getConfig

        @GET
        @Path("config")
        @Produces("application/json")
        public java.lang.String getConfig()
                                   throws PortalException
        Returns configurations for the virtual assistant.
        Returns:
        a JSON object with the configurations, or an object with an error string field if the virtual assistant is not available.
        Throws:
        PortalException
        Since:
        16.1.0
      • prompt

        @POST
        @Path("prompt")
        @Produces("text/event-stream")
        @Consumes("application/json")
        public void prompt​(@Context
                           javax.ws.rs.sse.SseEventSink eventSink,
                           @Context
                           javax.ws.rs.sse.Sse sse,
                           VirtualAssistantResource.PromptRequest request)
                    throws PortalException
        Prompts the virtual assistant for a response to a conversation.
        Parameters:
        eventSink - SSE event sink.
        sse - SSE API object.
        request - the request data.
        Throws:
        PortalException
        Since:
        16.1.0
      • getSearchQuery

        public SearchQuery getSearchQuery​(java.lang.String userQuery,
                                          java.util.Collection<java.lang.String> knowledgeServiceInstanceIds,
                                          int maxRows)
                                   throws PortalException
        Returns the search query using the given parameters.
        Parameters:
        userQuery - the user query.
        knowledgeServiceInstanceIds - the identifiers of the service instances to search for knowledge.
        maxRows - the maximum number of rows to search for.
        Returns:
        the created search query.
        Throws:
        PortalException
        Since:
        16.1.0