Package org.imixs.workflow.office.forms
Class AIController
java.lang.Object
org.imixs.workflow.office.forms.AIController
- All Implemented Interfaces:
Serializable
@Named("aiController")
@ConversationScoped
public class AIController
extends Object
implements Serializable
The AIController integrates the imixs-ai module providing a AI Chat history.
The method 'sendAsync' can be used to stream a prompt. This feature is used
by the front end component 'workitem.ai.xhtml' to display the life-answering.
After the answer was received completely the method automatically updates
the workitem ''
The method buildContextPrompt creates a complex prompt based on a given
question and the workflow information stored in the current workitem.
- Author:
- rsoika
- See Also:
-
workitem_chronicle.xhtml- Serialized Form
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final Stringprotected ChronicleControllerstatic final Stringstatic final Stringprotected org.imixs.workflow.faces.util.LoginControllerprotected org.imixs.marty.profile.UserControllerprotected org.imixs.workflow.faces.data.WorkflowController -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionList<org.imixs.workflow.ItemCollection>Returns the chat history in reverse order.booleanvoidonWorkflowEvent(org.imixs.workflow.faces.data.WorkflowEvent workflowEvent) WorkflowEvent listener If a new WorkItem was created or changed, the imixs.ai.chat.history view will be initialized or updated.voidSends an asynchronous prompt '{"prompt": "Building a website","n_predict": 128}'
-
Field Details
-
ERROR_PROMPT_TEMPLATE
- See Also:
-
ERROR_PROMPT_INFERENCE
- See Also:
-
AI_CHAT_HISTORY
- See Also:
-
AI_STREAM_EOS
- See Also:
-
workflowController
@Inject protected org.imixs.workflow.faces.data.WorkflowController workflowController -
chronicleController
-
userController
@Inject protected org.imixs.marty.profile.UserController userController -
loginController
@Inject protected org.imixs.workflow.faces.util.LoginController loginController
-
-
Constructor Details
-
AIController
public AIController()
-
-
Method Details
-
getChatHistory
Returns the chat history in reverse order. Used by the frontend component- Returns:
-
onWorkflowEvent
public void onWorkflowEvent(@Observes org.imixs.workflow.faces.data.WorkflowEvent workflowEvent) WorkflowEvent listener If a new WorkItem was created or changed, the imixs.ai.chat.history view will be initialized or updated.- Parameters:
workflowEvent-
-
sendAsync
public void sendAsync() throws org.imixs.workflow.exceptions.PluginExceptionSends an asynchronous prompt '{"prompt": "Building a website","n_predict": 128}'- Throws:
org.imixs.workflow.exceptions.PluginException
-
isStreamingComplete
public boolean isStreamingComplete() -
getStreamResult
-