1 package com.netease.nimlib.sdk.v2.ai.params;
6 import java.io.Serializable;
13 private static final String TAG =
"V2NIMAIModelCallMessage";
24 this(null, null, null);
83 if (NimLog.isDebugLog()){
84 final StringBuilder sb =
new StringBuilder(
"V2NIMAIModelCallMessage{");
85 sb.append(
"role=").append(role);
86 sb.append(
", msg='").append(msg).append(
'\'');
87 sb.append(
", type=").append(type);
91 final StringBuilder sb =
new StringBuilder(
"V2NIMAIModelCallMessage{");
92 sb.append(
"role=").append(role);
93 sb.append(
", msg='").append(EncryptUtil.encryptBase64(msg)).append(
'\'');
94 sb.append(
", type=").append(type);
103 NimLog.e(TAG,
"type is null");
107 NimLog.e(TAG,
"role is null");
115 return "type is null";
118 return "role is null";
128 return msg == null || msg.trim().isEmpty();
void setType(Integer type)
设置类型
void setMsg(String msg)
设置上下文的内容
V2NIMAIModelCallMessage(V2NIMAIModelRoleType role, String msg, Integer type)
void setRole(V2NIMAIModelRoleType role)
设置上下文内容的角色
V2NIMAIModelCallMessage()
boolean shouldBeFiltered()
判断 msg 是否需要被过滤掉(msg 为 null 或 trim 后为空字符串)
V2NIMAIModelRoleType getRole()
获取上下文内容的角色