ChatController class
Inheritance
Object
GetLifeCycle
DisposableInterface
GetxController
ChatController
Implemented types
Methods
$configureLifeCycle ()
→ void
inherited
addKbBackupToMessage (PupauMessage message )
→ void
addListener (GetStateUpdate listener )
→ Disposer
Register a closure to be called when the object notifies its listeners.
inherited
addListenerId (Object ? key , GetStateUpdate listener )
→ Disposer
inherited
addMessage (PupauMessage message , {bool bypassCheck = false })
→ void
addTaggedAssistants ()
→ void
clearEmptyMessages ()
→ void
clearTaggedAssistants ()
→ void
createNewConversation ()
→ Future <void >
dispose ()
→ void
inherited
disposeId (Object id )
→ void
To dispose an id from future updates(), this ids are registered
by GetBuilder() or similar, so is a way to unlink the state change with
the Widget from the Controller.
inherited
forkConversation ()
→ Future <void >
getAssistant ()
→ Future <void >
getMessageInputFieldHeight (BuildContext ? context )
→ void
handleKbMessage (PupauMessage message )
→ void
handleLayerMessage (PupauMessage message )
→ void
handleToolUseMessage (Map <String , dynamic > data )
→ void
handleToolUseStartMessage (PupauMessage message )
→ void
handleUiToolMessage (Map <String , dynamic > data )
→ void
handleWebSearchQueryMessage (PupauMessage message )
→ void
hideUiToolBubble (String messageId )
→ void
initChatController ()
→ Future <void >
initLanguage ()
→ void
initScrollControllers ()
→ void
isAdvanced ()
→ bool
isFirstMessageInGroup (String groupId )
→ bool
isLoadingMessageActive ()
→ bool
isToolUseExpanded (String messageId )
→ bool
isUiToolBubbleHidden (String messageId )
→ bool
loadConversation (String conversationId , {bool isManualLoad = false })
→ Future <void >
loadConversationMessages ({bool reset = false })
→ Future <void >
manageCancelAndErrorMessage ()
→ void
manageChatAutoScroll ({bool bypassHeightCheck = false })
→ void
manageForceBack ()
→ void
manageNoVisionCapability ()
→ void
manageSendSuccess (bool isExternalSearch )
→ void
manageSSEData (Map <String , dynamic > data , bool isExternalSearch )
→ void
noSuchMethod (Invocation invocation )
→ dynamic
Invoked when a nonexistent method or property is accessed.
inherited
notifyChildrens ()
→ void
inherited
onClose ()
→ void
Called before onDelete method. onClose might be used to
dispose resources used by the controller. Like closing events,
or streams before the controller is destroyed.
Or dispose objects that can potentially create some memory leaks,
like TextEditingControllers, AnimationControllers.
Might be useful as well to persist some data on disk.
override
onInit ()
→ void
Called immediately after the widget is allocated in memory.
You might use this to initialize something for the controller.
override
onMention (String ? value )
→ void
onMentionTap ()
→ void
onReady ()
→ void
Called 1 frame after onInit(). It is the perfect place to enter
navigation events, like snackbar, dialogs, or a new route, or
async request.
inherited
openChatWithConfig (PupauConfig ? newConfig )
→ Future <void >
Called when chat is opened (via PupauChatUtils or tapping avatar)
Resets conversation state and updates config if assistant changed
Re-initializes the chat every time it's called (even with same config)
openCustomActionsModal ()
→ void
openForkConversationModal (String messageId )
→ void
reactMessage (PupauMessage message , Reaction reaction )
→ void
refresh ()
→ void
inherited
refreshGroup (Object id )
→ void
inherited
removeListener (VoidCallback listener )
→ void
Remove a previously registered closure from the list of closures that the
object notifies.
inherited
removeListenerId (Object id , VoidCallback listener )
→ void
inherited
removeTaggedAssistant (Assistant assistant )
→ void
reportMessage (PupauMessage message )
→ void
resetChatState ({bool isManualReset = false })
→ void
Resets all chat state when the chat is opened
This ensures a fresh state each time the chat is opened
resetConversation ()
→ void
resetLoadingMessage ()
→ void
scrollToBottomChat ({bool withAnimation = false })
→ void
scrollToTopChat ({bool withAnimation = false })
→ void
selectImage (String value , ImageType type )
→ void
sendCancel ()
→ void
sendIsActive ()
→ bool
sendMessage (String query , bool isExternalSearch )
→ Future <void >
sendToolAnswer (String messageId , List <AskUserChoice > selectedOptions , String ? answer )
→ Future <void >
sendUiToolApproval (String messageId )
→ Future <void >
sendUiToolAuth (String messageId , String toolId )
→ Future <void >
setAssistantSettings ()
→ Future <void >
setCollapseCallback (VoidCallback ? callback )
→ void
setDefautMessageInputFieldHeight ()
→ void
setExternalSearchButton (bool isVisible )
→ void
setForkConversationTitle (String title )
→ void
setMessageInputFieldFocused (bool isFocused )
→ void
setModalContext (BuildContext context )
→ void
setOnFirstInitCompleteCallback (VoidCallback ? callback )
→ void
stopAutoScroll ()
→ void
stopIsActive ()
→ bool
toggleToolsFab ({bool ? value })
→ void
toggleToolUseExpanded (String messageId )
→ void
toggleWebSearch ()
→ void
toString ()
→ String
A string representation of this object.
inherited
update ([List <Object > ? ids , bool condition = true ])
→ void
Rebuilds GetBuilder each time you call update();
Can take a List of ids, that will only update the matching
GetBuilder( id: ),
ids can be reused among GetBuilders like group tags.
The update will only notify the Widgets, if condition is true.
inherited
updateConversationTitle ({String ? title })
→ Future <void >
updateSSEMessages (PupauMessage newSseMessage )
→ PupauMessage
flutter_agent_pupau 1.0.1