CometChatStreamService class
Manages real-time AI response streaming with event queues, delta buffers, and reconnect handling.
Constructors
- CometChatStreamService()
-
factory
Properties
-
aiAssistantMessages
→ Map<
int, AIAssistantMessage> -
final
-
aiToolArgumentMessages
→ Map<
int, AIToolArgumentMessage> -
final
-
aiToolResultMessages
→ Map<
int, AIToolResultMessage> -
final
-
disconnectedRunIds
→ Set<
int> -
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- isConnected → bool
-
no setter
- maxConcurrentQueues ↔ int
-
getter/setter pair
-
queueCompletionCallbacks
→ Map<
int, QueueCompletionCallback> -
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- streamDelay ↔ Duration
-
getter/setter pair
Methods
-
addSmallDelay(
) → Future< void> -
checkAndTriggerQueueCompletion(
int runId) → void -
checkMessageExists(
int messageId) → bool -
cleanupAll(
) → void -
clearBuffer(
int runId) → void -
getAllRunIds(
) → Set< int> -
getBufferContent(
int runId) → String? -
getCurrentQueueCount(
) → int -
getMessageById(
int messageId) → StreamMessage? -
getMessageIdForRun(
int runId) → int? -
getOrCreateBuffer(
int runId) → StringBuffer -
handleIncomingEvent(
int runId, AIAssistantBaseEvent event) → void -
hasEvents(
int runId) → bool -
isQueueEmpty(
int runId) → bool -
isQueueFull(
) → bool -
isRunActive(
int runId) → bool -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
onConnected(
) → void -
onConnectionError(
CometChatException e, BuildContext context) → void -
onDisconnected(
BuildContext context) → void -
queueCompletionCallback(
int runId) → AIAssistantMessage? -
registerMessage(
StreamMessage message) → void -
removeBuffer(
int runId) → void -
removeMessageById(
int messageId) → void -
removeMessageIdMapping(
int runId) → void -
runExists(
int runId) → bool -
setMessageIdForRun(
int runId, int messageId) → void -
setQueueCompletionCallback(
int runId, QueueCompletionCallback callback) → void -
startStreamingForRunId(
int runId, {dynamic onAiAssistantEvent(AIAssistantBaseEvent event)?, dynamic onError(CometChatException excep)?}) → Stream< AIAssistantBaseEvent> -
stopStreamingForRunId(
int runId) → void -
toString(
) → String -
A string representation of this object.
inherited
-
updateMessage(
StreamMessage message) → void
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited