public class Message extends AbstractModel
header, skipSign
Constructor and Description |
---|
Message() |
Message(Message source)
NOTE: Any ambiguous key set via .set("AnyKey", "value") will be a shallow copy,
and any explicit key, i.e Foo, set via .setFoo("value") will be a deep copy.
|
Modifier and Type | Method and Description |
---|---|
String |
getContent()
Get 文本内容
|
Content[] |
getContents()
Get 多种类型内容(目前支持图片和文本),仅 hunyuan-vision 和 hunyuan-turbo-vision 模型支持
注意:此字段可能返回 null,表示取不到有效值。
|
String[] |
getFileIDs()
Get 文件标识符。单次最大 50 个文件。
注意:此字段可能返回 null,表示取不到有效值。
|
String |
getReasoningContent()
Get 思维链内容。用于展示模型思考过程,仅 Hunyuan-T1 系列模型可用。注意:在进行多轮对话时,请**不要**将此字段拼接到 messages 中。请求 messages 的请求参数中包含 reasoning_content,接口将报错。
|
String |
getRole()
Get 角色,可选值包括 system、user、assistant、 tool。
|
String |
getToolCallId()
Get 当role为tool时传入,标识具体的函数调用
注意:此字段可能返回 null,表示取不到有效值。
|
ToolCall[] |
getToolCalls()
Get 模型生成的工具调用,仅 hunyuan-pro 或者 hunyuan-functioncall 模型支持
注意:此字段可能返回 null,表示取不到有效值。
|
void |
setContent(String Content)
Set 文本内容
|
void |
setContents(Content[] Contents)
Set 多种类型内容(目前支持图片和文本),仅 hunyuan-vision 和 hunyuan-turbo-vision 模型支持
注意:此字段可能返回 null,表示取不到有效值。
|
void |
setFileIDs(String[] FileIDs)
Set 文件标识符。单次最大 50 个文件。
注意:此字段可能返回 null,表示取不到有效值。
|
void |
setReasoningContent(String ReasoningContent)
Set 思维链内容。用于展示模型思考过程,仅 Hunyuan-T1 系列模型可用。注意:在进行多轮对话时,请**不要**将此字段拼接到 messages 中。请求 messages 的请求参数中包含 reasoning_content,接口将报错。
|
void |
setRole(String Role)
Set 角色,可选值包括 system、user、assistant、 tool。
|
void |
setToolCallId(String ToolCallId)
Set 当role为tool时传入,标识具体的函数调用
注意:此字段可能返回 null,表示取不到有效值。
|
void |
setToolCalls(ToolCall[] ToolCalls)
Set 模型生成的工具调用,仅 hunyuan-pro 或者 hunyuan-functioncall 模型支持
注意:此字段可能返回 null,表示取不到有效值。
|
void |
toMap(HashMap<String,String> map,
String prefix)
Internal implementation, normal users should not use it.
|
any, fromJsonString, getBinaryParams, GetHeader, getMultipartRequestParams, getSkipSign, isStream, set, SetHeader, setParamArrayObj, setParamArraySimple, setParamObj, setParamSimple, setSkipSign, toJsonString
public Message()
public Message(Message source)
public String getRole()
public void setRole(String Role)
Role
- 角色,可选值包括 system、user、assistant、 tool。public String getContent()
public void setContent(String Content)
Content
- 文本内容public Content[] getContents()
public void setContents(Content[] Contents)
Contents
- 多种类型内容(目前支持图片和文本),仅 hunyuan-vision 和 hunyuan-turbo-vision 模型支持
注意:此字段可能返回 null,表示取不到有效值。public String getToolCallId()
public void setToolCallId(String ToolCallId)
ToolCallId
- 当role为tool时传入,标识具体的函数调用
注意:此字段可能返回 null,表示取不到有效值。public ToolCall[] getToolCalls()
public void setToolCalls(ToolCall[] ToolCalls)
ToolCalls
- 模型生成的工具调用,仅 hunyuan-pro 或者 hunyuan-functioncall 模型支持
注意:此字段可能返回 null,表示取不到有效值。public String[] getFileIDs()
public void setFileIDs(String[] FileIDs)
FileIDs
- 文件标识符。单次最大 50 个文件。
注意:此字段可能返回 null,表示取不到有效值。public String getReasoningContent()
public void setReasoningContent(String ReasoningContent)
ReasoningContent
- 思维链内容。用于展示模型思考过程,仅 Hunyuan-T1 系列模型可用。注意:在进行多轮对话时,请**不要**将此字段拼接到 messages 中。请求 messages 的请求参数中包含 reasoning_content,接口将报错。Copyright © 2025. All rights reserved.