Class AiAssistantResource
java.lang.Object
ch.tocco.nice2.rest.core.spi.AbstractRestResource
ch.tocco.nice2.optional.aiassistant.impl.rest.AiAssistantResource
- All Implemented Interfaces:
RestResource
Endpoints for the AI assistant. A request selects an assistant
function (e.g. MANUAL);
all endpoints require an authenticated user and conversations are stored/returned per user,
tagged with the function they belong to.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordstatic final record -
Field Summary
Fields inherited from class AbstractRestResource
uriInfo -
Constructor Summary
ConstructorsConstructorDescriptionAiAssistantResource(AssistantConversationService conversationService, AssistantFunctionRegistry functionRegistry) -
Method Summary
Modifier and TypeMethodDescriptionask(AssistantRequest request) voiddeleteConversation(String key) getConversation(String key) listConversations(String function) Methods inherited from class AbstractRestResource
getPathParameter, setUriInfo, tryGetInt
-
Constructor Details
-
AiAssistantResource
public AiAssistantResource(AssistantConversationService conversationService, AssistantFunctionRegistry functionRegistry)
-
-
Method Details
-
ask
@POST @Consumes("application/json") @Produces("application/json") public AssistantResponse ask(AssistantRequest request) -
listConversations
@GET @Path("conversations") @Produces("application/json") public AiAssistantResource.ConversationsBean listConversations(@QueryParam("function") String function) -
getConversation
@GET @Path("conversations/{key}") @Produces("application/json") public AssistantConversationService.ConversationDetail getConversation(@PathParam("key") String key) -
deleteConversation
-
functions
@GET @Path("functions") @Produces("application/json") public AiAssistantResource.FunctionsBean functions()
-