SessionHistorySource
@FunctionalInterface public interface SessionHistorySource
源码Source
io/agentscope/extensions/aistio/adapter/SessionHistorySource.java:29–38定义会话历史来源契约的接口。位于 io.agentscope.extensions.aistio.adapter 包。核心成员包括 loadMessages。
Optional full-history reader for GET /agentscope/sessions/{id}/messages.
AgentScope Harness persists an append-only .log.jsonl; BYO apps that use the harness
can plug a source that reads it (including via a distributed AbstractFilesystem). When
absent, the adapter falls back to the live AgentState context buffer.
方法摘要Method Summary
| 方法Method | 说明Description |
|---|---|
public Optional<List<MessagePage.MessageItem>> loadMessages(String sessionId, String userId) | 加载消息。 Loads the messages. |
方法详情Method Detail
loadMessages
public Optional<List<MessagePage.MessageItem>> loadMessages(String sessionId, String userId)
加载消息。
Loads the messages.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
sessionId | String | 会话标识(类型 `String`)。session key |
userId | String | 用户标识(类型 `String`)。user slot recorded when the session was first seen; may be empty |
Optional<List<MessagePage.MessageItem>>返回可选>。full message list (not yet paginated), or empty when no log is available
源码Source
io/agentscope/extensions/aistio/adapter/SessionHistorySource.java:37