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 模型支持
注意:此字段可能返回 null,表示取不到有效值。
|
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 模型支持
注意:此字段可能返回 null,表示取不到有效值。
|
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 模型支持
注意:此字段可能返回 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,表示取不到有效值。Copyright © 2024. All rights reserved.