AS AgentScopeAPI 手册 / API Reference

Builder

public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder<Builder> implements io.agentscope.controlplane.proto.SessionCommandOrBuilder
源码Source io/agentscope/controlplane/proto/SessionCommand.java:359–717

构建器,用于构建并配置目标实例。位于 io.agentscope.controlplane.proto 包,继承自 com.google.protobuf.GeneratedMessage.Builder<Builder>,实现 io.agentscope.controlplane.proto.SessionCommandOrBuilder。核心成员包括 getDescriptor、internalGetFieldAccessorTable、clear、getDescriptorForType、getDefaultInstanceForType、build。


SessionCommand is a control-plane → data-plane session instruction.
`command` is a string (not an enum) so new verbs can be added without
breaking wire compatibility. Known values and HTTP parity
(see docs/zh/controlplane/contract.md):

compress ↔ POST /agentscope/sessions/{id}/compress (capability: session-command)
terminate ↔ POST /agentscope/sessions/{id}/terminate (capability: session-command)
abort ↔ POST /agentscope/sessions/{id}/abort (capability: session-abort)
undo ↔ POST /agentscope/sessions/{id}/undo (capability: session-undo, optional)
redo ↔ POST /agentscope/sessions/{id}/redo (capability: session-redo, optional)

Success / error semantics match the HTTP Command contract
(accepted/commandId/phase/result;501 unsupported, 409 busy/wait_idle,
404 not_found, 503 unreachable on CP, 500 failed).

Protobuf type agentscope.protocol.v1.SessionCommand

方法摘要Method Summary

方法Method说明Description
public static final com.google.protobuf.Descriptors.Descriptor getDescriptor()
staticfinal
获取描述符。
Returns the descriptor.
protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable()
返回 `internalGetFieldAccessorTable` 结果。
Returns the internal get field accessor table.
public Builder clear()
清空或重置内部状态。
Clears or resets internal state.
public com.google.protobuf.Descriptors.Descriptor getDescriptorForType()
获取 `getDescriptorForType`。
Returns the descriptor for type.
public io.agentscope.controlplane.proto.SessionCommand getDefaultInstanceForType()
获取默认实例用于类型。
Returns the default instance for type.
public io.agentscope.controlplane.proto.SessionCommand build()
构建并返回最终实例。
Creates and returns an instance.
public io.agentscope.controlplane.proto.SessionCommand buildPartial()
构建 `buildPartial`。
Builds the partial.
public Builder mergeFrom(com.google.protobuf.Message other)
设置该配置项。
Performs the merge from operation.
public Builder mergeFrom(io.agentscope.controlplane.proto.SessionCommand other)
设置该配置项。
Performs the merge from operation.
public final boolean isInitialized()
final
判断是否已初始化。
Returns whether the initialized.
public Builder mergeFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException
设置该配置项。
Performs the merge from operation.
public java.lang.String getSessionId()
获取会话标识。
`string session_id = 1;`
public com.google.protobuf.ByteString getSessionIdBytes()
获取会话标识字节。
`string session_id = 1;`
public Builder setSessionId(java.lang.String value)
设置设置会话标识。
`string session_id = 1;`
public Builder clearSessionId()
清空会话标识。
`string session_id = 1;`
public Builder setSessionIdBytes(com.google.protobuf.ByteString value)
设置设置会话标识字节。
`string session_id = 1;`
public java.lang.String getCommand()
获取命令。
``` compress | terminate | abort | undo | redo | ...
public com.google.protobuf.ByteString getCommandBytes()
获取命令字节。
``` compress | terminate | abort | undo | redo | ...
public Builder setCommand(java.lang.String value)
设置设置命令。
``` compress | terminate | abort | undo | redo | ...
public Builder clearCommand()
清空命令。
``` compress | terminate | abort | undo | redo | ...
public Builder setCommandBytes(com.google.protobuf.ByteString value)
设置设置命令字节。
``` compress | terminate | abort | undo | redo | ...
public com.google.protobuf.ByteString getParams()
获取参数。
`bytes params = 3;`
public Builder setParams(com.google.protobuf.ByteString value)
设置设置参数。
`bytes params = 3;`
public Builder clearParams()
清空参数。
`bytes params = 3;`

方法详情Method Detail

getDescriptor

public static final com.google.protobuf.Descriptors.Descriptor getDescriptor()
staticfinal

获取描述符。

Returns the descriptor.

返回Returns com.google.protobuf.Descriptors.Descriptor
返回com.google.protobuf.Descriptors.Descriptor。Returns com google protobuf descriptors descriptor.
源码Source io/agentscope/controlplane/proto/SessionCommand.java:363–366

internalGetFieldAccessorTable

protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable()

返回 internalGetFieldAccessorTable 结果。

Returns the internal get field accessor table.

返回Returns com.google.protobuf.GeneratedMessage.FieldAccessorTable
返回com.google.protobuf.GeneratedMessage.FieldAccessorTable。Returns com google protobuf generated message field accessor table.
源码Source io/agentscope/controlplane/proto/SessionCommand.java:368–374

clear

public Builder clear()

清空或重置内部状态。

Clears or resets internal state.

返回Returns Builder
返回当前实例,以支持链式调用。Returns the current instance for chaining.
源码Source io/agentscope/controlplane/proto/SessionCommand.java:386–394

getDescriptorForType

public com.google.protobuf.Descriptors.Descriptor getDescriptorForType()

获取 getDescriptorForType。

Returns the descriptor for type.

返回Returns com.google.protobuf.Descriptors.Descriptor
返回com.google.protobuf.Descriptors.Descriptor。Returns com google protobuf descriptors descriptor.
源码Source io/agentscope/controlplane/proto/SessionCommand.java:396–400

getDefaultInstanceForType

public io.agentscope.controlplane.proto.SessionCommand getDefaultInstanceForType()

获取默认实例用于类型。

Returns the default instance for type.

返回Returns io.agentscope.controlplane.proto.SessionCommand
返回io.agentscope.controlplane.协议.SessionCommand。Returns io agentscope controlplane proto session command.
源码Source io/agentscope/controlplane/proto/SessionCommand.java:402–405

build

public io.agentscope.controlplane.proto.SessionCommand build()

构建并返回最终实例。

Creates and returns an instance.

返回Returns io.agentscope.controlplane.proto.SessionCommand
返回io.agentscope.controlplane.协议.SessionCommand。Returns io agentscope controlplane proto session command.
源码Source io/agentscope/controlplane/proto/SessionCommand.java:407–414

buildPartial

public io.agentscope.controlplane.proto.SessionCommand buildPartial()

构建 buildPartial。

Builds the partial.

返回Returns io.agentscope.controlplane.proto.SessionCommand
返回io.agentscope.controlplane.协议.SessionCommand。Returns io agentscope controlplane proto session command.
源码Source io/agentscope/controlplane/proto/SessionCommand.java:416–422

mergeFrom

public Builder mergeFrom(com.google.protobuf.Message other)

设置该配置项。

Performs the merge from operation.

参数Parameters
名称Name类型Type说明Description
othercom.google.protobuf.Messageother(类型 `com.google.protobuf.Message`)。The other.
返回Returns Builder
返回当前实例,以支持链式调用。Returns the current instance for chaining.
源码Source io/agentscope/controlplane/proto/SessionCommand.java:437–445

mergeFrom

public Builder mergeFrom(io.agentscope.controlplane.proto.SessionCommand other)

设置该配置项。

Performs the merge from operation.

参数Parameters
名称Name类型Type说明Description
otherio.agentscope.controlplane.proto.SessionCommandother(类型 `io.agentscope.controlplane.proto.SessionCommand`)。The other.
返回Returns Builder
返回当前实例,以支持链式调用。Returns the current instance for chaining.
源码Source io/agentscope/controlplane/proto/SessionCommand.java:447–465

isInitialized

public final boolean isInitialized()
final

判断是否已初始化。

Returns whether the initialized.

返回Returns boolean
返回布尔值,表示判断结果。Returns a boolean result.
源码Source io/agentscope/controlplane/proto/SessionCommand.java:467–470

mergeFrom

public Builder mergeFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException

设置该配置项。

Performs the merge from operation.

参数Parameters
名称Name类型Type说明Description
inputcom.google.protobuf.CodedInputStream输入消息(类型 `com.google.protobuf.CodedInputStream`)。The input.
extensionRegistrycom.google.protobuf.ExtensionRegistryLite扩展注册表(类型 `com.google.protobuf.ExtensionRegistryLite`)。The extension registry.
返回Returns Builder
返回当前实例,以支持链式调用。Returns the current instance for chaining.
抛出Throws
  • java.io.IOException 可能抛出 `java.io.IOException`。Thrown when the operation cannot be completed.
源码Source io/agentscope/controlplane/proto/SessionCommand.java:472–517

getSessionId

public java.lang.String getSessionId()

获取会话标识。

string session_id = 1;

返回Returns java.lang.String
会话标识。The sessionId.
源码Source io/agentscope/controlplane/proto/SessionCommand.java:525–536

getSessionIdBytes

public com.google.protobuf.ByteString getSessionIdBytes()

获取会话标识字节。

string session_id = 1;

返回Returns com.google.protobuf.ByteString
字节用于会话标识。The bytes for sessionId.
源码Source io/agentscope/controlplane/proto/SessionCommand.java:541–553

setSessionId

public Builder setSessionId(java.lang.String value)

设置设置会话标识。

string session_id = 1;

参数Parameters
名称Name类型Type说明Description
valuejava.lang.String会话标识到设置。The sessionId to set.
返回Returns Builder
返回当前实例,以支持链式调用。This builder for chaining.
源码Source io/agentscope/controlplane/proto/SessionCommand.java:559–566

clearSessionId

public Builder clearSessionId()

清空会话标识。

string session_id = 1;

返回Returns Builder
返回当前实例,以支持链式调用。This builder for chaining.
源码Source io/agentscope/controlplane/proto/SessionCommand.java:571–576

setSessionIdBytes

public Builder setSessionIdBytes(com.google.protobuf.ByteString value)

设置设置会话标识字节。

string session_id = 1;

参数Parameters
名称Name类型Type说明Description
valuecom.google.protobuf.ByteString字节用于会话标识到设置。The bytes for sessionId to set.
返回Returns Builder
返回当前实例,以支持链式调用。This builder for chaining.
源码Source io/agentscope/controlplane/proto/SessionCommand.java:582–590

getCommand

public java.lang.String getCommand()

获取命令。

compress | terminate | abort | undo | redo | ...

返回Returns java.lang.String
命令。The command.
源码Source io/agentscope/controlplane/proto/SessionCommand.java:601–612

getCommandBytes

public com.google.protobuf.ByteString getCommandBytes()

获取命令字节。

compress | terminate | abort | undo | redo | ...

返回Returns com.google.protobuf.ByteString
字节用于命令。The bytes for command.
源码Source io/agentscope/controlplane/proto/SessionCommand.java:621–633

setCommand

public Builder setCommand(java.lang.String value)

设置设置命令。

compress | terminate | abort | undo | redo | ...

参数Parameters
名称Name类型Type说明Description
valuejava.lang.String命令到设置。The command to set.
返回Returns Builder
返回当前实例,以支持链式调用。This builder for chaining.
源码Source io/agentscope/controlplane/proto/SessionCommand.java:643–650

clearCommand

public Builder clearCommand()

清空命令。

compress | terminate | abort | undo | redo | ...

返回Returns Builder
返回当前实例,以支持链式调用。This builder for chaining.
源码Source io/agentscope/controlplane/proto/SessionCommand.java:659–664

setCommandBytes

public Builder setCommandBytes(com.google.protobuf.ByteString value)

设置设置命令字节。

compress | terminate | abort | undo | redo | ...

参数Parameters
名称Name类型Type说明Description
valuecom.google.protobuf.ByteString字节用于命令到设置。The bytes for command to set.
返回Returns Builder
返回当前实例,以支持链式调用。This builder for chaining.
源码Source io/agentscope/controlplane/proto/SessionCommand.java:674–682

getParams

public com.google.protobuf.ByteString getParams()

获取参数。

bytes params = 3;

返回Returns com.google.protobuf.ByteString
参数。The params.
源码Source io/agentscope/controlplane/proto/SessionCommand.java:689–692

setParams

public Builder setParams(com.google.protobuf.ByteString value)

设置设置参数。

bytes params = 3;

参数Parameters
名称Name类型Type说明Description
valuecom.google.protobuf.ByteString参数到设置。The params to set.
返回Returns Builder
返回当前实例,以支持链式调用。This builder for chaining.
源码Source io/agentscope/controlplane/proto/SessionCommand.java:698–704

clearParams

public Builder clearParams()

清空参数。

bytes params = 3;

返回Returns Builder
返回当前实例,以支持链式调用。This builder for chaining.
源码Source io/agentscope/controlplane/proto/SessionCommand.java:709–714
基于官方固定版本源码静态生成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.