Package com.vaadin.copilot.ai
Class AICommandHandler
java.lang.Object
com.vaadin.copilot.CopilotCommand
com.vaadin.copilot.ai.AICommandHandler
Command handler for AI related operations
-
Field Summary
Fields inherited from class com.vaadin.copilot.CopilotCommand
currentSession, KEY_CANCEL_REQ_ID, KEY_REQ_ID -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanhandleMessage(String command, com.fasterxml.jackson.databind.JsonNode data, com.vaadin.base.devserver.DevToolsInterface devToolsInterface) Handles the message with exception handling, and if there was a caught exception then it will notify the client/browser.booleanhandleMessageWithException(String command, com.fasterxml.jackson.databind.JsonNode data, com.vaadin.base.devserver.DevToolsInterface devToolsInterface) Handles the message.Methods inherited from class com.vaadin.copilot.CopilotCommand
canBeParallelCommand, getProjectFileManager, getVaadinContext, getVaadinSession, handleConnect
-
Constructor Details
-
AICommandHandler
public AICommandHandler()
-
-
Method Details
-
handleMessage
public boolean handleMessage(String command, com.fasterxml.jackson.databind.JsonNode data, com.vaadin.base.devserver.DevToolsInterface devToolsInterface) Handles the message with exception handling, and if there was a caught exception then it will notify the client/browser.- Specified by:
handleMessagein classCopilotCommand- Parameters:
command- - the command, we are getting from the client/browser (can be prompt-text or prompt-cancel), which we handle heredata- - the data object, we are getting from the client/browserdevToolsInterface- - the devtools interface we use to communicate with the client/browser- Returns:
- - true if the message was handled by this handler, false otherwise
-
handleMessageWithException
public boolean handleMessageWithException(String command, com.fasterxml.jackson.databind.JsonNode data, com.vaadin.base.devserver.DevToolsInterface devToolsInterface) Handles the message.- Parameters:
command- - the command, we are getting from the client/browser (can be prompt-text or prompt-cancel), which we handle heredata- - the data object, we are getting from the client/browserdevToolsInterface- - the devtools interface we use to communicate with the client/browser- Returns:
- - true if the message was handled by this handler, false otherwise
-
getDisposables
-