会话(Session)
data class Session(val key: SessionKey, val state: State = State(), val events: MutableList<Event> = concurrentMutableListOf(), var lastUpdateTime: Instant = Instant.fromEpochMilliseconds(0))
A Session object that encapsulates the State and Events of a session.
构造函数(Constructors)
Link copied to clipboard
constructor(key: SessionKey, state: State = State(), events: MutableList<Event> = concurrentMutableListOf(), lastUpdateTime: Instant = Instant.fromEpochMilliseconds(0))
类型
Link copied to clipboard
class Builder
Fluent Builder for 会话(Session)该功能主要为 Java 语言的调用者提供支持;如果某个属性未被设置,其值将默认使用构造函数中指定的默认值。
属性(Properties)
Link copied to clipboard
会话中的所有事件(例如用户输入、模型响应、函数调用/响应等)会被存储在一个列表中。该列表默认采用“并发处理”的方式(即多个事件可以同时被添加到列表中)。这样一来,当某个事件(例如来自某个并行处理分支的事件)被添加到列表中时,另一个进程(例如正在读取会话历史记录的进程)不会因此出现错误或异常。 ConcurrentModificationException.
Link copied to clipboard
会话的复合标识符(Composite Identifier of the Session)SessionKey.appName, SessionKey.userId, SessionKey.id).
Link copied to clipboard
会话的最后更新时间。默认值为 Unix 时间戳(即从 1970 年 1 月 1 日 00:00:00 开始计算的秒数)。