@Preview(value="3.8.1") public class InMemoryAgentSession extends InMemoryChatSession implements AgentSession
InMemoryChatSession.BuildermaxMessages, messages, sessionId| 构造器和说明 |
|---|
InMemoryAgentSession(org.noear.solon.flow.FlowContext context) |
InMemoryAgentSession(java.lang.String sessionId) |
InMemoryAgentSession(java.lang.String sessionId,
int maxMessages) |
| 限定符和类型 | 方法和说明 |
|---|---|
void |
addMessage(java.util.Collection<? extends ChatMessage> messages)
添加消息
|
org.noear.solon.flow.FlowContext |
getSnapshot()
获取当前状态快照(用于状态回溯或持久化导出)
|
static InMemoryAgentSession |
of() |
static InMemoryAgentSession |
of(org.noear.solon.flow.FlowContext context) |
static InMemoryAgentSession |
of(java.lang.String sessionId) |
static InMemoryAgentSession |
of(java.lang.String sessionId,
int maxMessages) |
void |
updateSnapshot()
同步/更新执行快照
|
attrs, builder, clear, getLatestMessages, getMaxMessages, getMessages, getSessionId, isEmpty, removeNonSystemMessagesclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitaddMessage, addMessage, addMessage, attrs, clear, getLatestMessages, getMessages, getSessionId, isEmpty, loadNdjson, loadNdjson, toNdjson, toNdjsonpublic InMemoryAgentSession(java.lang.String sessionId)
public InMemoryAgentSession(java.lang.String sessionId,
int maxMessages)
public InMemoryAgentSession(org.noear.solon.flow.FlowContext context)
public static InMemoryAgentSession of()
public static InMemoryAgentSession of(java.lang.String sessionId)
public static InMemoryAgentSession of(java.lang.String sessionId, int maxMessages)
public static InMemoryAgentSession of(org.noear.solon.flow.FlowContext context)
public void addMessage(java.util.Collection<? extends ChatMessage> messages)
InMemoryChatSessionaddMessage 在接口中 ChatSessionaddMessage 在类中 InMemoryChatSessionpublic void updateSnapshot()
AgentSessionupdateSnapshot 在接口中 AgentSessionpublic org.noear.solon.flow.FlowContext getSnapshot()
AgentSessiongetSnapshot 在接口中 AgentSession