AS AgentScopeAPI 手册 / API Reference

Builder

public static final class Builder
源码Source io/agentscope/extensions/aistio/model/SessionEvent.java:156–235

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

Mutable builder for SessionEvent.

方法摘要Method Summary

方法Method说明Description
public Builder sessionId(String sessionId)
设置会话标识。
Performs the session id operation.
public Builder eventType(String eventType)
设置事件类型。
Performs the event type operation.
public Builder occurredAt(long occurredAt)
设置该配置项。
Performs the occurred at operation.
public Builder role(String role)
设置角色。
Performs the role operation.
public Builder content(String content)
设置内容。
Performs the content operation.
public Builder toolName(String toolName)
设置工具名称。
Performs the tool name operation.
public Builder toolInput(byte[] toolInput)
设置工具输入。
Performs the tool input operation.
public Builder toolInputJson(String json)
设置工具输入 JSON。
Performs the tool input json operation.
public Builder toolOutput(String toolOutput)
设置工具输出。
Performs the tool output operation.
public Builder tokens(int tokensIn, int tokensOut)
设置令牌数。
Performs the tokens operation.
public Builder durationMs(int durationMs)
设置时长 Ms。
Performs the duration ms operation.
public Builder frameworkMeta(byte[] frameworkMeta)
设置该配置项。
Performs the framework meta operation.
public SessionEvent build()
构建并返回最终实例。
Creates and returns an instance.

方法详情Method Detail

sessionId

public Builder sessionId(String sessionId)

设置会话标识。

Performs the session id operation.

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

eventType

public Builder eventType(String eventType)

设置事件类型。

Performs the event type operation.

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

occurredAt

public Builder occurredAt(long occurredAt)

设置该配置项。

Performs the occurred at operation.

参数Parameters
名称Name类型Type说明Description
occurredAtlongoccurred At(类型 `long`)。The occurred at.
返回Returns Builder
返回当前实例,以支持链式调用。Returns the current instance for chaining.
源码Source io/agentscope/extensions/aistio/model/SessionEvent.java:181–184

role

public Builder role(String role)

设置角色。

Performs the role operation.

参数Parameters
名称Name类型Type说明Description
roleString角色(类型 `String`)。The role.
返回Returns Builder
返回当前实例,以支持链式调用。Returns the current instance for chaining.
源码Source io/agentscope/extensions/aistio/model/SessionEvent.java:186–189

content

public Builder content(String content)

设置内容。

Performs the content operation.

参数Parameters
名称Name类型Type说明Description
contentString内容(类型 `String`)。The content.
返回Returns Builder
返回当前实例,以支持链式调用。Returns the current instance for chaining.
源码Source io/agentscope/extensions/aistio/model/SessionEvent.java:191–194

toolName

public Builder toolName(String toolName)

设置工具名称。

Performs the tool name operation.

参数Parameters
名称Name类型Type说明Description
toolNameString工具名称(类型 `String`)。The tool name.
返回Returns Builder
返回当前实例,以支持链式调用。Returns the current instance for chaining.
源码Source io/agentscope/extensions/aistio/model/SessionEvent.java:196–199

toolInput

public Builder toolInput(byte[] toolInput)

设置工具输入。

Performs the tool input operation.

参数Parameters
名称Name类型Type说明Description
toolInputbyte[]工具输入(类型 `byte[]`)。The tool input.
返回Returns Builder
返回当前实例,以支持链式调用。Returns the current instance for chaining.
源码Source io/agentscope/extensions/aistio/model/SessionEvent.java:201–204

toolInputJson

public Builder toolInputJson(String json)

设置工具输入 JSON。

Performs the tool input json operation.

参数Parameters
名称Name类型Type说明Description
jsonStringJSON(类型 `String`)。The json.
返回Returns Builder
返回当前实例,以支持链式调用。Returns the current instance for chaining.
源码Source io/agentscope/extensions/aistio/model/SessionEvent.java:206–209

toolOutput

public Builder toolOutput(String toolOutput)

设置工具输出。

Performs the tool output operation.

参数Parameters
名称Name类型Type说明Description
toolOutputString工具输出(类型 `String`)。The tool output.
返回Returns Builder
返回当前实例,以支持链式调用。Returns the current instance for chaining.
源码Source io/agentscope/extensions/aistio/model/SessionEvent.java:211–214

tokens

public Builder tokens(int tokensIn, int tokensOut)

设置令牌数。

Performs the tokens operation.

参数Parameters
名称Name类型Type说明Description
tokensInint令牌数 In(类型 `int`)。The tokens in.
tokensOutint令牌数 Out(类型 `int`)。The tokens out.
返回Returns Builder
返回当前实例,以支持链式调用。Returns the current instance for chaining.
源码Source io/agentscope/extensions/aistio/model/SessionEvent.java:216–220

durationMs

public Builder durationMs(int durationMs)

设置时长 Ms。

Performs the duration ms operation.

参数Parameters
名称Name类型Type说明Description
durationMsint时长 Ms(类型 `int`)。The duration ms.
返回Returns Builder
返回当前实例,以支持链式调用。Returns the current instance for chaining.
源码Source io/agentscope/extensions/aistio/model/SessionEvent.java:222–225

frameworkMeta

public Builder frameworkMeta(byte[] frameworkMeta)

设置该配置项。

Performs the framework meta operation.

参数Parameters
名称Name类型Type说明Description
frameworkMetabyte[]framework 元数据(类型 `byte[]`)。The framework meta.
返回Returns Builder
返回当前实例,以支持链式调用。Returns the current instance for chaining.
源码Source io/agentscope/extensions/aistio/model/SessionEvent.java:227–230

build

public SessionEvent build()

构建并返回最终实例。

Creates and returns an instance.

返回Returns SessionEvent
返回SessionEvent。Returns session event.
源码Source io/agentscope/extensions/aistio/model/SessionEvent.java:232–234
基于官方固定版本源码静态生成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.