AS AgentScopeAPI 手册 / API Reference

SessionHistorySource

@FunctionalInterface public interface SessionHistorySource
源码Source io/agentscope/extensions/controlplane/adapter/SessionHistorySource.java:29–38

定义会话历史来源契约的接口。位于 io.agentscope.extensions.controlplane.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
sessionIdString会话标识(类型 `String`)。session key
userIdString用户标识(类型 `String`)。user slot recorded when the session was first seen; may be empty
返回Returns Optional<List<MessagePage.MessageItem>>
返回可选>。full message list (not yet paginated), or empty when no log is available
源码Source io/agentscope/extensions/controlplane/adapter/SessionHistorySource.java:37
基于官方固定版本源码静态生成Generated from pinned official sources · Python 2.0.11 · Java 2.0.4
签名与文档为静态抽取;如有疑问请以源码为准。Signatures and docs are extracted statically; verify against the source when in doubt.