SessionEvent
public final class SessionEvent
io/agentscope/extensions/aistio/model/SessionEvent.java:30–236会话事件,描述执行过程中的事件。位于 io.agentscope.extensions.aistio.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_STARTstaticfinal | String | 会话启动字段。 The SESSION START field. |
MESSAGEstaticfinal | String | 消息字段。 The MESSAGE field. |
TOOL_CALLstaticfinal | String | 工具调用字段。 The TOOL CALL field. |
TOOL_RESULTstaticfinal | String | 工具结果字段。 The TOOL RESULT field. |
SESSION_ENDstaticfinal | String | 会话结束字段。 The SESSION END field. |
COMPACTIONstaticfinal | String | 压缩字段。 The COMPACTION field. |
ROLE_USERstaticfinal | String | 角色用户字段。 The ROLE USER field. |
ROLE_ASSISTANTstaticfinal | String | 角色 ASSISTANT字段。 The ROLE ASSISTANT field. |
ROLE_SYSTEMstaticfinal | String | 角色系统字段。 The ROLE SYSTEM field. |
ROLE_TOOLstaticfinal | 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
会话启动字段。声明为 public static final String SESSION_START。
The SESSION START field.
io/agentscope/extensions/aistio/model/SessionEvent.java:32MESSAGE
public static final String MESSAGE
消息字段。声明为 public static final String MESSAGE。
The MESSAGE field.
io/agentscope/extensions/aistio/model/SessionEvent.java:33TOOL_CALL
public static final String TOOL_CALL
工具调用字段。声明为 public static final String TOOL_CALL。
The TOOL CALL field.
io/agentscope/extensions/aistio/model/SessionEvent.java:34TOOL_RESULT
public static final String TOOL_RESULT
工具结果字段。声明为 public static final String TOOL_RESULT。
The TOOL RESULT field.
io/agentscope/extensions/aistio/model/SessionEvent.java:35SESSION_END
public static final String SESSION_END
会话结束字段。声明为 public static final String SESSION_END。
The SESSION END field.
io/agentscope/extensions/aistio/model/SessionEvent.java:36COMPACTION
public static final String COMPACTION
压缩字段。声明为 public static final String COMPACTION。
The COMPACTION field.
io/agentscope/extensions/aistio/model/SessionEvent.java:37ROLE_USER
public static final String ROLE_USER
角色用户字段。声明为 public static final String ROLE_USER。
The ROLE USER field.
io/agentscope/extensions/aistio/model/SessionEvent.java:39ROLE_ASSISTANT
public static final String ROLE_ASSISTANT
角色 ASSISTANT字段。声明为 public static final String ROLE_ASSISTANT。
The ROLE ASSISTANT field.
io/agentscope/extensions/aistio/model/SessionEvent.java:40ROLE_SYSTEM
public static final String ROLE_SYSTEM
角色系统字段。声明为 public static final String ROLE_SYSTEM。
The ROLE SYSTEM field.
io/agentscope/extensions/aistio/model/SessionEvent.java:41ROLE_TOOL
public static final String ROLE_TOOL
角色工具字段。声明为 public static final String ROLE_TOOL。
The ROLE TOOL field.
io/agentscope/extensions/aistio/model/SessionEvent.java:42方法详情Method Detail
builder
public static Builder builder(String sessionId, String eventType)
返回构建器实例。
Performs the builder operation.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
sessionId | String | 会话标识(类型 `String`)。The session id. |
eventType | String | 事件类型(类型 `String`)。The event type. |
Builderio/agentscope/extensions/aistio/model/SessionEvent.java:75–77getSessionId
public String getSessionId()
获取会话标识。
Returns the session id.
Stringio/agentscope/extensions/aistio/model/SessionEvent.java:79–81getEventType
public String getEventType()
获取事件类型。
Returns the event type.
Stringio/agentscope/extensions/aistio/model/SessionEvent.java:83–85getOccurredAt
public long getOccurredAt()
获取 getOccurredAt。
Returns the occurred at.
longio/agentscope/extensions/aistio/model/SessionEvent.java:87–89getRole
public String getRole()
获取角色。
Returns the role.
Stringio/agentscope/extensions/aistio/model/SessionEvent.java:91–93getContent
public String getContent()
获取内容。
Returns the content.
Stringio/agentscope/extensions/aistio/model/SessionEvent.java:95–97getToolName
public String getToolName()
获取工具名称。
Returns the tool name.
Stringio/agentscope/extensions/aistio/model/SessionEvent.java:99–101getToolOutput
public String getToolOutput()
获取工具输出。
Returns the tool output.
Stringio/agentscope/extensions/aistio/model/SessionEvent.java:103–105getTokensIn
public int getTokensIn()
获取令牌数 In。
Returns the tokens in.
intio/agentscope/extensions/aistio/model/SessionEvent.java:107–109getTokensOut
public int getTokensOut()
获取 getTokensOut。
Returns the tokens out.
intio/agentscope/extensions/aistio/model/SessionEvent.java:111–113getDurationMs
public int getDurationMs()
获取时长 Ms。
Returns the duration ms.
intio/agentscope/extensions/aistio/model/SessionEvent.java:115–117getSeq
public int getSeq()
获取 getSeq。
Returns the seq.
intio/agentscope/extensions/aistio/model/SessionEvent.java:119–121setSeq
public void setSeq(int seq)
设置 setSeq。
Assigns the per-session sequence number; called by the bridge on ingest.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
seq | int | seq(类型 `int`)。The seq. |
io/agentscope/extensions/aistio/model/SessionEvent.java:124–126toProto
public SessionEventMsg toProto()
返回到协议。
Returns the to proto.
SessionEventMsgio/agentscope/extensions/aistio/model/SessionEvent.java:128–149嵌套类详情Nested Class Detail
Builder
public static final class Builder用于SessionEvent的可变构建器。位于 io.agentscope.extensions.aistio.model 包。核心成员包括 sessionId、eventType、occurredAt、role、content、toolName。
Mutable builder for SessionEvent.