currentSession method

JsonMap currentSession(
  1. String threadId,
  2. String agentId
)

The current agent session of agentId in threadId, created on first use (09 9).

Implementation

JsonMap currentSession(String threadId, String agentId) {
  final list = sessions.putIfAbsent(threadId, () => []);
  for (final s in list) {
    if (s['is_current'] == true) return s;
  }
  return _newSession(threadId, agentId);
}