41 bool antispam_enabled_{
true};
45 std::string ToJsonString()
const;
68 int32_t max_tokens_{0};
72 float temperature_{0.0};
80 max_tokens_ = max_tokens;
90 temperature_ = temperature;
98 unsigned int field_valid_flags_{0};
115 bool streaming_{
false};
167 std::list<NIMAIMessageRAGInfo>
rags_;
169 time_t timestamp_{0};
171 bool streaming_{
false};
192 rags_.push_back(rag_info);
209 time_t chunk_time_{0};
262 std::list<NIMAIMessageRAGInfo>
rags_;
264 time_t timestamp_{0};
278 rags_.push_back(rag_info);
299 prompt_keys_ = prompt_keys;
318 model_type_ = model_type;
324 model_config_ = model_config;
329 std::string ToJsonString()
const;
Represents a JSON value.
Definition: value.h:196
bool isMember(const char *key) const
Definition: json_value.cpp:1241
bool isArray() const
Definition: json_value.cpp:1386
UInt asUInt() const
Definition: json_value.cpp:684
bool asBool() const
Definition: json_value.cpp:839
Int asInt() const
Definition: json_value.cpp:657
String asString() const
Embedded zeroes are possible.
Definition: json_value.cpp:632
bool ParseJsonValue(const std::string &content, nim_cpp_wrapper_util::Json::Value &values)
解析JsonString
Definition: nim_json_util.cpp:70
@ kUserNameCardKeyModelConfig
Model config 字段有效
Definition: nim_user_helper.h:44
@ kUserNameCardKeyModelType
Model type 字段有效
Definition: nim_user_helper.h:42
void ParseAIUserModelConfig(const nim_cpp_wrapper_util::Json::Value &model_config_json, NIMAIModelConfig &model_config)
解析数字人模型配置
Definition: nim_ai_helper.cpp:180
bool ParseAIUserNameCards(const std::string &namecards_json, std::list< AIUserNameCard > &namecards)
Definition: nim_ai_helper.cpp:115
NIMAIModelConfigFieldFlag
Definition: nim_ai_helper.h:48
@ kAIModelConfigFieldFlagTemperature
Temperature 字段有效
Definition: nim_ai_helper.h:56
@ kAIModelConfigFieldFlagPromptKeys
Prompt keys 字段有效
Definition: nim_ai_helper.h:60
@ kAIModelConfigFieldFlagModel
Model 字段有效
Definition: nim_ai_helper.h:58
@ kAIModelConfigFieldFlagMaxTokens
Max tokens 字段有效
Definition: nim_ai_helper.h:52
@ kAIModelConfigFieldFlagTopP
Top p 字段有效
Definition: nim_ai_helper.h:54
@ kAIModelConfigFieldFlagPrompt
Prompt 字段有效
Definition: nim_ai_helper.h:50
bool ParseAIUserNameCard(const std::string &namecard_json, AIUserNameCard &namecard)
Definition: nim_ai_helper.cpp:137
AIUserNameCardFieldFlag
AI 数字人名片字段有效性校验
Definition: nim_ai_helper.h:306
static const char * kNIMAICallKeyAIRAGIcon
string AI RAG 信息图标
Definition: nim_ai_def.h:25
static const char * kNIMAICallKeyStreamingMessageChunkType
AI 流式消息分片类型,当前仅支持 0 表示文本
Definition: nim_ai_def.h:43
static const char * kNIMAICallKeyAIRAGTitle
string AI RAG 信息标题
Definition: nim_ai_def.h:29
NIMAIModelType
AI 数字人消息模型类型
Definition: nim_ai_def.h:101
static const char * kNIMAICallKeyStreamingMessageChunkContent
AI 流式消息分片内容
Definition: nim_ai_def.h:37
NIMAIModelRoleType
AI 数字人消息角色类型
Definition: nim_ai_def.h:91
@ kNIMMessageAIModelRoleTypeSystem
系统
Definition: nim_ai_def.h:93
static const char * kNIMAICallKeyAIRAGUrl
string AI RAG 信息地址
Definition: nim_ai_def.h:27
static const char * kNIMAICallKeyStreamingMessageChunk
AI 流式消息分片信息
Definition: nim_ai_def.h:35
static const char * kNIMAICallKeyAIRAGDescription
time_t AI RAG 信息时间
Definition: nim_ai_def.h:33
static const char * kNIMAICallKeyContentKeyMsg
请求/响应的文本内容
Definition: nim_ai_def.h:50
static const char * kNIMAICallKeyRequestID
AI proxy 请求 ID
Definition: nim_ai_def.h:13
static const char * kNIMAICallKeyStreamingMessageChunkIndex
AI 流式消息分片序号,从 0 开始
Definition: nim_ai_def.h:45
static const char * kNIMAICallKeyAIRAGs
JSON array AI RAG(Retrieval-Augmented Generation) 信息
Definition: nim_ai_def.h:21
static const char * kNIMAICallKeyAIRAGName
string AI RAG 信息名称
Definition: nim_ai_def.h:23
static const char * kNIMAICallKeyContentKeyTimestamp
分片时间
Definition: nim_ai_def.h:54
static const char * kNIMAICallKeyAIRAGTime
time_t AI RAG 信息时间
Definition: nim_ai_def.h:31
static const char * kNIMAICallKeyStreaming
bool AI streaming message
Definition: nim_ai_def.h:17
static const char * kNIMAICallKeyStreamingMessageChunkChunkTime
AI 流式消息当前分片时间,chunkTime >= messageTime
Definition: nim_ai_def.h:41
static const char * kNIMAICallKeyAccountID
string AI account id
Definition: nim_ai_def.h:11
static const char * kNIMAICallKeyStreamingMessageStatus
int AI streaming message status
Definition: nim_ai_def.h:19
static const char * kNIMAICallKeyContentKeyType
类型, 暂时只有 0, 代表文本, 预留扩展能力
Definition: nim_ai_def.h:52
static const char * kNIMAICallKeyContent
请求大模型的内容
Definition: nim_ai_def.h:48
static const char * kNIMResCode
int, NIMResCode
Definition: nim_global_def.h:20
NIMAIStreamingMessageStatus
AI 流式消息状态
Definition: nim_msglog_def.h:547
@ kNIMAIStreamingMessageNone
非流式状态
Definition: nim_msglog_def.h:551
#define NIM_SDK_CPPWRAPPER_DLL_API
Definition: nim_sdk_cpp_wrapper.h:38
static const char * kNIMMsgKeyTime
long,消息时间戳(毫秒)
Definition: nim_talk_def.h:196
NIMResCode
Definition: public_defines.h:21
@ kNIMResSuccess
没有错误,一切正常
Definition: public_defines.h:26
AI 数字人用户信息
Definition: nim_ai_helper.h:311
NIMAIModelType model_type_
模型选择
Definition: nim_ai_helper.h:313
void SetModelType(NIMAIModelType model_type)
Definition: nim_ai_helper.h:317
NIMAIModelConfig GetModelConfig() const
Definition: nim_ai_helper.h:327
NIMAIModelConfig model_config_
模型相关配置文件
Definition: nim_ai_helper.h:315
void SetModelConfig(const NIMAIModelConfig &model_config)
Definition: nim_ai_helper.h:323
NIMAIModelType GetModelType() const
Definition: nim_ai_helper.h:321
消息 AI RAG 信息
Definition: nim_ai_helper.h:121
std::string title_
引用资源的标题
Definition: nim_ai_helper.h:131
std::string description_
引用资源的描述
Definition: nim_ai_helper.h:125
void ToJsonValue(nim_cpp_wrapper_util::Json::Value &values) const
Definition: nim_ai_helper.h:134
std::string name_
引用资源的名称
Definition: nim_ai_helper.h:123
std::string icon_
引用资源的图标
Definition: nim_ai_helper.h:127
void FromJsonValue(const nim_cpp_wrapper_util::Json::Value &values)
Definition: nim_ai_helper.h:142
std::string url_
引用资源的链接
Definition: nim_ai_helper.h:129
Definition: nim_ai_helper.h:103
NIMAIModelCallContent content_
请求大模型的内容
Definition: nim_ai_helper.h:107
std::string prompt_variables_
提示词变量占位符替换
Definition: nim_ai_helper.h:111
NIMAIModelConfigParams model_config_params_
请求接口模型相关参数配置, 如果参数不为空,则默认覆盖控制相关配置
Definition: nim_ai_helper.h:113
std::string account_id_
机器人账号 ID
Definition: nim_ai_helper.h:105
std::list< NIMAIModelCallMessage > messages_
上下文内容
Definition: nim_ai_helper.h:109
调用大模型的请求内容
Definition: nim_ai_helper.h:21
std::string msg_
请求/响应的文本内容
Definition: nim_ai_helper.h:23
int32_t type_
类型, 暂时只有 0, 代表文本, 预留扩展能力
Definition: nim_ai_helper.h:25
AI 数字人消息上下文参数
Definition: nim_ai_helper.h:29
std::string msg_
上下文的内容
Definition: nim_ai_helper.h:33
AI 数字人代理请求结果
Definition: nim_ai_helper.h:159
void FromJsonString(const std::string &json_string)
Definition: nim_ai_helper.h:174
std::list< NIMAIMessageRAGInfo > rags_
数字人回复内容的引用资源列表
Definition: nim_ai_helper.h:167
std::string request_id_
本次响应的标识
Definition: nim_ai_helper.h:163
NIMAIModelCallContent content_
请求 AI 的回复
Definition: nim_ai_helper.h:165
std::string account_id_
数字人的账号 ID
Definition: nim_ai_helper.h:161
AI 数字人模型配置参数
Definition: nim_ai_helper.h:64
bool ExistValue(NIMAIModelConfigFieldFlag flag) const
Definition: nim_ai_helper.h:95
void SetTemperature(float temperature)
Definition: nim_ai_helper.h:89
float GetTopP() const
Definition: nim_ai_helper.h:88
void SetPrompt(const std::string &prompt)
Definition: nim_ai_helper.h:74
std::string prompt_
提示词
Definition: nim_ai_helper.h:66
std::string GetPrompt() const
Definition: nim_ai_helper.h:78
int32_t GetMaxTokens() const
Definition: nim_ai_helper.h:83
void SetMaxTokens(int32_t max_tokens)
Definition: nim_ai_helper.h:79
float GetTemperature() const
Definition: nim_ai_helper.h:93
void SetTopP(float top_p)
Definition: nim_ai_helper.h:84
AI 数字人模型类型
Definition: nim_ai_helper.h:287
std::list< std::string > prompt_keys_
提示词对应的变量
Definition: nim_ai_helper.h:291
std::list< std::string > GetPromptKeys() const
Definition: nim_ai_helper.h:302
std::string model_
具体大模型版本模型名
Definition: nim_ai_helper.h:289
void SetModel(const std::string &model)
Definition: nim_ai_helper.h:293
void SetPromptKeys(const std::list< std::string > &prompt_keys)
Definition: nim_ai_helper.h:298
std::string GetModel() const
Definition: nim_ai_helper.h:297
消息 AI 流式消息分片信息
Definition: nim_ai_helper.h:205
void ToJsonValue(nim_cpp_wrapper_util::Json::Value &values) const
Definition: nim_ai_helper.h:214
std::string content_
流式消息回复分片文本
Definition: nim_ai_helper.h:207
void FromJsonValue(const nim_cpp_wrapper_util::Json::Value &values)
Definition: nim_ai_helper.h:220
消息 AI 流式消息内容
Definition: nim_ai_helper.h:233
void FromJsonValue(const nim_cpp_wrapper_util::Json::Value &values)
Definition: nim_ai_helper.h:240
NIMAIModelStreamingCallChunk chunk_
流式消息最后分片的信息
Definition: nim_ai_helper.h:239
std::string message_
流式消息经过拼接后的完整内容
Definition: nim_ai_helper.h:235
AI 数字人流式消息结果
Definition: nim_ai_helper.h:252
std::string account_id_
数字人的账号 ID
Definition: nim_ai_helper.h:256
std::string request_id_
本次响应的标识
Definition: nim_ai_helper.h:258
std::list< NIMAIMessageRAGInfo > rags_
数字人回复内容的引用资源列表
Definition: nim_ai_helper.h:262
void FromJsonValue(const nim_cpp_wrapper_util::Json::Value &values)
Definition: nim_ai_helper.h:265
NIMAIModelStreamingCallContent content_
请求 AI 的回复
Definition: nim_ai_helper.h:260
AI 数字人代理请求反垃圾配置
Definition: nim_ai_helper.h:39
std::string antispam_business_id_
指定易盾业务id
Definition: nim_ai_helper.h:43
云信用户名片
Definition: nim_user_helper.h:50