AS AgentScopeAPI 手册 / API Reference

SessionEvent

public final class SessionEvent
源码Source io/agentscope/extensions/controlplane/model/SessionEvent.java:30–236

会话事件,描述执行过程中的事件。位于 io.agentscope.extensions.controlplane.model 包。核心成员包括 builder、getSessionId、getEventType、getOccurredAt、getRole、getContent。

One Level-2 session event, mirroring the ASDP SessionEventMsg.

The durable event stream is the canonical conversation history, so message and tool payloads are preserved rather than depending on the optional Level-3 message-query capability.

seq increases monotonically within a session and is the control plane's idempotency key; it is assigned by the bridge, not by adapters.

嵌套类摘要Nested Class Summary

类Class类型Kind说明Description
Builder类class
用于`SessionEvent`的可变构建器。
Mutable builder for `SessionEvent`.

字段摘要Field Summary

字段Field类型Type说明Description
SESSION_START
staticfinal
String
会话启动字段。
The SESSION START field.
MESSAGE
staticfinal
String
消息字段。
The MESSAGE field.
TOOL_CALL
staticfinal
String
工具调用字段。
The TOOL CALL field.
TOOL_RESULT
staticfinal
String
工具结果字段。
The TOOL RESULT field.
SESSION_END
staticfinal
String
会话结束字段。
The SESSION END field.
COMPACTION
staticfinal
String
压缩字段。
The COMPACTION field.
ROLE_USER
staticfinal
String
角色用户字段。
The ROLE USER field.
ROLE_ASSISTANT
staticfinal
String
角色 ASSISTANT字段。
The ROLE ASSISTANT field.
ROLE_SYSTEM
staticfinal
String
角色系统字段。
The ROLE SYSTEM field.
ROLE_TOOL
staticfinal
String
角色工具字段。
The ROLE TOOL field.

方法摘要Method Summary

方法Method说明Description
public static Builder builder(String sessionId, String eventType)
static
返回构建器实例。
Performs the builder operation.
public String getSessionId()
获取会话标识。
Returns the session id.
public String getEventType()
获取事件类型。
Returns the event type.
public long getOccurredAt()
获取 `getOccurredAt`。
Returns the occurred at.
public String getRole()
获取角色。
Returns the role.
public String getContent()
获取内容。
Returns the content.
public String getToolName()
获取工具名称。
Returns the tool name.
public String getToolOutput()
获取工具输出。
Returns the tool output.
public int getTokensIn()
获取令牌数 In。
Returns the tokens in.
public int getTokensOut()
获取 `getTokensOut`。
Returns the tokens out.
public int getDurationMs()
获取时长 Ms。
Returns the duration ms.
public int getSeq()
获取 `getSeq`。
Returns the seq.
public void setSeq(int seq)
设置 `setSeq`。
Assigns the per-session sequence number; called by the bridge on ingest.
public SessionEventMsg toProto()
返回到协议。
Returns the to proto.

字段详情Field Detail

SESSION_START

public static final String SESSION_START
staticfinal

会话启动字段。声明为 public static final String SESSION_START。

The SESSION START field.

源码Source io/agentscope/extensions/controlplane/model/SessionEvent.java:32

MESSAGE

public static final String MESSAGE
staticfinal

消息字段。声明为 public static final String MESSAGE。

The MESSAGE field.

源码Source io/agentscope/extensions/controlplane/model/SessionEvent.java:33

TOOL_CALL

public static final String TOOL_CALL
staticfinal

工具调用字段。声明为 public static final String TOOL_CALL。

The TOOL CALL field.

源码Source io/agentscope/extensions/controlplane/model/SessionEvent.java:34

TOOL_RESULT

public static final String TOOL_RESULT
staticfinal

工具结果字段。声明为 public static final String TOOL_RESULT。

The TOOL RESULT field.

源码Source io/agentscope/extensions/controlplane/model/SessionEvent.java:35

SESSION_END

public static final String SESSION_END
staticfinal

会话结束字段。声明为 public static final String SESSION_END。

The SESSION END field.

源码Source io/agentscope/extensions/controlplane/model/SessionEvent.java:36

COMPACTION

public static final String COMPACTION
staticfinal

压缩字段。声明为 public static final String COMPACTION。

The COMPACTION field.

源码Source io/agentscope/extensions/controlplane/model/SessionEvent.java:37

ROLE_USER

public static final String ROLE_USER
staticfinal

角色用户字段。声明为 public static final String ROLE_USER。

The ROLE USER field.

源码Source io/agentscope/extensions/controlplane/model/SessionEvent.java:39

ROLE_ASSISTANT

public static final String ROLE_ASSISTANT
staticfinal

角色 ASSISTANT字段。声明为 public static final String ROLE_ASSISTANT。

The ROLE ASSISTANT field.

源码Source io/agentscope/extensions/controlplane/model/SessionEvent.java:40

ROLE_SYSTEM

public static final String ROLE_SYSTEM
staticfinal

角色系统字段。声明为 public static final String ROLE_SYSTEM。

The ROLE SYSTEM field.

源码Source io/agentscope/extensions/controlplane/model/SessionEvent.java:41

ROLE_TOOL

public static final String ROLE_TOOL
staticfinal

角色工具字段。声明为 public static final String ROLE_TOOL。

The ROLE TOOL field.

源码Source io/agentscope/extensions/controlplane/model/SessionEvent.java:42

方法详情Method Detail

builder

public static Builder builder(String sessionId, String eventType)
static

返回构建器实例。

Performs the builder operation.

参数Parameters
名称Name类型Type说明Description
sessionIdString会话标识(类型 `String`)。The session id.
eventTypeString事件类型(类型 `String`)。The event type.
返回Returns Builder
返回当前实例,以支持链式调用。Returns the current instance for chaining.
源码Source io/agentscope/extensions/controlplane/model/SessionEvent.java:75–77

getSessionId

public String getSessionId()

获取会话标识。

Returns the session id.

返回Returns String
返回字符串结果。Returns a string.
源码Source io/agentscope/extensions/controlplane/model/SessionEvent.java:79–81

getEventType

public String getEventType()

获取事件类型。

Returns the event type.

返回Returns String
返回字符串结果。Returns a string.
源码Source io/agentscope/extensions/controlplane/model/SessionEvent.java:83–85

getOccurredAt

public long getOccurredAt()

获取 getOccurredAt。

Returns the occurred at.

返回Returns long
返回数值结果。Returns a numeric result.
源码Source io/agentscope/extensions/controlplane/model/SessionEvent.java:87–89

getRole

public String getRole()

获取角色。

Returns the role.

返回Returns String
返回字符串结果。Returns a string.
源码Source io/agentscope/extensions/controlplane/model/SessionEvent.java:91–93

getContent

public String getContent()

获取内容。

Returns the content.

返回Returns String
返回字符串结果。Returns a string.
源码Source io/agentscope/extensions/controlplane/model/SessionEvent.java:95–97

getToolName

public String getToolName()

获取工具名称。

Returns the tool name.

返回Returns String
返回字符串结果。Returns a string.
源码Source io/agentscope/extensions/controlplane/model/SessionEvent.java:99–101

getToolOutput

public String getToolOutput()

获取工具输出。

Returns the tool output.

返回Returns String
返回字符串结果。Returns a string.
源码Source io/agentscope/extensions/controlplane/model/SessionEvent.java:103–105

getTokensIn

public int getTokensIn()

获取令牌数 In。

Returns the tokens in.

返回Returns int
返回数值结果。Returns a numeric result.
源码Source io/agentscope/extensions/controlplane/model/SessionEvent.java:107–109

getTokensOut

public int getTokensOut()

获取 getTokensOut。

Returns the tokens out.

返回Returns int
返回数值结果。Returns a numeric result.
源码Source io/agentscope/extensions/controlplane/model/SessionEvent.java:111–113

getDurationMs

public int getDurationMs()

获取时长 Ms。

Returns the duration ms.

返回Returns int
返回数值结果。Returns a numeric result.
源码Source io/agentscope/extensions/controlplane/model/SessionEvent.java:115–117

getSeq

public int getSeq()

获取 getSeq。

Returns the seq.

返回Returns int
返回数值结果。Returns a numeric result.
源码Source io/agentscope/extensions/controlplane/model/SessionEvent.java:119–121

setSeq

public void setSeq(int seq)

设置 setSeq。

Assigns the per-session sequence number; called by the bridge on ingest.

参数Parameters
名称Name类型Type说明Description
seqintseq(类型 `int`)。The seq.
源码Source io/agentscope/extensions/controlplane/model/SessionEvent.java:124–126

toProto

public SessionEventMsg toProto()

返回到协议。

Returns the to proto.

返回Returns SessionEventMsg
返回SessionEventMsg。Returns session event msg.
源码Source io/agentscope/extensions/controlplane/model/SessionEvent.java:128–149

嵌套类详情Nested Class Detail

Builder

public static final class Builder

用于SessionEvent的可变构建器。位于 io.agentscope.extensions.controlplane.model 包。核心成员包括 sessionId、eventType、occurredAt、role、content、toolName。

Mutable builder for SessionEvent.

基于官方固定版本源码静态生成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.