类 AssistantMessage.Builder
java.lang.Object
io.agentscope.core.message.Msg.Builder
io.agentscope.core.message.AssistantMessage.Builder
- 封闭类:
AssistantMessage
Fluent builder for
AssistantMessage. The role is fixed to
MsgRole.ASSISTANT and role(MsgRole) is unsupported.-
字段概要
-
构造器概要
构造器 -
方法概要
修饰符和类型方法说明build()Builds a new message instance with the configured properties.content(ContentBlock block) Set content from a single content block (convenience method).content(ContentBlock... blocks) Set content from varargs content blocks (convenience method).content(List<ContentBlock> content) Set content from a list of content blocks.generateReason(GenerateReason reason) Sets the unique identifier for the message.Set metadata for structured output.Sets the optional name for the message.Unsupported onAssistantMessage.Builder: role is fixed to ASSISTANT.textContent(String text) Set text content from a string.Sets the timestamp for the message.Sets the token usage information for this message.
-
构造器详细资料
-
Builder
public Builder()
-
-
方法详细资料
-
role
Unsupported onAssistantMessage.Builder: role is fixed to ASSISTANT.- 覆盖:
role在类中Msg.Builder- 参数:
role- The message role (user, assistant, system, or tool)- 返回:
- This builder for chaining
-
id
从类复制的说明:Msg.BuilderSets the unique identifier for the message.- 覆盖:
id在类中Msg.Builder- 参数:
id- The message ID- 返回:
- This builder for chaining
-
name
从类复制的说明:Msg.BuilderSets the optional name for the message.- 覆盖:
name在类中Msg.Builder- 参数:
name- The message name- 返回:
- This builder for chaining
-
content
从类复制的说明:Msg.BuilderSet content from a list of content blocks.- 覆盖:
content在类中Msg.Builder- 参数:
content- List of content blocks- 返回:
- This builder
-
content
从类复制的说明:Msg.BuilderSet content from a single content block (convenience method). The block will be wrapped in a list automatically.- 覆盖:
content在类中Msg.Builder- 参数:
block- Single content block- 返回:
- This builder
-
content
从类复制的说明:Msg.BuilderSet content from varargs content blocks (convenience method).- 覆盖:
content在类中Msg.Builder- 参数:
blocks- Content blocks- 返回:
- This builder
-
textContent
从类复制的说明:Msg.BuilderSet text content from a string.- 覆盖:
textContent在类中Msg.Builder- 参数:
text- Text content- 返回:
- This builder
-
metadata
从类复制的说明:Msg.BuilderSet metadata for structured output.- 覆盖:
metadata在类中Msg.Builder- 参数:
metadata- Metadata map- 返回:
- This builder
-
timestamp
从类复制的说明:Msg.BuilderSets the timestamp for the message.- 覆盖:
timestamp在类中Msg.Builder- 参数:
timestamp- The timestamp string- 返回:
- This builder for chaining
-
usage
从类复制的说明:Msg.BuilderSets the token usage information for this message.- 覆盖:
usage在类中Msg.Builder- 参数:
usage- The ChatUsage containing token counts- 返回:
- This builder for chaining
-
generateReason
- 覆盖:
generateReason在类中Msg.Builder
-
build
从类复制的说明:Msg.BuilderBuilds a new message instance with the configured properties. If timestamp is not set, it will be auto-generated.- 覆盖:
build在类中Msg.Builder- 返回:
- A new immutable message
-