Package lumis.service.virtualassistant
Class VirtualAssistantResource
- java.lang.Object
-
- lumis.service.virtualassistant.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$
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
VirtualAssistantResource.PromptRequest
-
Constructor Summary
Constructors Constructor Description VirtualAssistantResource()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
getConfig()
Returns configurations for the virtual assistant.SearchQuery
getSearchQuery(java.lang.String userQuery, java.util.Collection<java.lang.String> knowledgeServiceInstanceIds, int maxRows)
Returns the search query using the given parameters.void
prompt(javax.ws.rs.sse.SseEventSink eventSink, javax.ws.rs.sse.Sse sse, VirtualAssistantResource.PromptRequest request)
Prompts the virtual assistant for a response to a conversation.
-
-
-
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
-
-