NIM 跨平台 C++ SDK
载入中...
搜索中...
未找到
nim_ai_def.h
浏览该文件的文档.
1#ifndef NIM_SDK_DLL_EXPORT_HEADERS_NIM_AI_DEF_H_
2#define NIM_SDK_DLL_EXPORT_HEADERS_NIM_AI_DEF_H_
3
4#include "nim_global_def.h"
5
6#ifdef __cplusplus
7extern "C" {
8#endif
9
11static const char* kNIMAICallKeyAccountID = "account_id";
13static const char* kNIMAICallKeyRequestID = "request_id";
15static const char* kNIMAICallKeyStatus = "status";
17static const char* kNIMAICallKeyStreaming = "streaming";
19static const char* kNIMAICallKeyStreamingMessageStatus = "streaming_message_status";
21static const char* kNIMAICallKeyAIRAGs = "rags";
23static const char* kNIMAICallKeyAIRAGName = "name";
25static const char* kNIMAICallKeyAIRAGIcon = "icon";
27static const char* kNIMAICallKeyAIRAGUrl = "url";
29static const char* kNIMAICallKeyAIRAGTitle = "title";
31static const char* kNIMAICallKeyAIRAGTime = "time";
33static const char* kNIMAICallKeyAIRAGDescription = "desc";
35static const char* kNIMAICallKeyStreamingMessageChunk = "chunk";
39static const char* kNIMAICallKeyStreamingMessageChunkMessageTime = "message_time";
41static const char* kNIMAICallKeyStreamingMessageChunkChunkTime = "timestamp";
43static const char* kNIMAICallKeyStreamingMessageChunkType = "type";
45static const char* kNIMAICallKeyStreamingMessageChunkIndex = "index";
46
48static const char* kNIMAICallKeyContent = "content";
50static const char* kNIMAICallKeyContentKeyMsg = "msg";
52static const char* kNIMAICallKeyContentKeyType = "type";
54static const char* kNIMAICallKeyContentKeyTimestamp = "timestamp";
55
57static const char* kNIMAICallKeyMessages = "messages";
59static const char* kNIMAICallKeyMessageKeyRole = "role";
61static const char* kNIMAICallKeyMessageKeyMsg = "msg";
63static const char* kNIMAICallKeyMessageKeyType = "type";
64
66static const char* kNIMAICallKeyPromptVariables = "prompt_variables";
67
69static const char* kNIMAICallKeyModelConfig = "model_config";
71static const char* kNIMAICallKeyModelConfigKeyPrompt = "prompt";
73static const char* kNIMAICallKeyModelConfigKeyMaxTokens = "tokens";
75static const char* kNIMAICallKeyModelConfigKeyTopP = "top_p";
77static const char* kNIMAICallKeyModelConfigKeyTemperature = "temperature";
78
80static const char* kNIMAICallKeyAntispamConfig = "antispam_config";
82static const char* kNIMAICallKeyAntispamConfigKeyEnable = "enable";
84static const char* kNIMAICallKeyAntispamConfigKeyBizID = "antispam_business_id";
85
86static const char* kNIMAICallKeyMessageRoleAssist = "assistant";
87static const char* kNIMAICallKeyMessageRoleUser = "user";
88static const char* kNIMAICallKeyMessageRoleUnknown = "unknown";
89
98};
99
110
111typedef void (*nim_ai_get_ai_user_list_cb)(enum NIMResCode code, const char* result, const void* user_data);
112
113typedef void (*nim_ai_proxy_ai_model_call_cb)(enum NIMResCode code, const void* user_data);
114
115typedef void (*nim_ai_stop_ai_model_streaming_call_cb)(enum NIMResCode code, const void* user_data);
116
117#ifdef __cplusplus
118}
119#endif
120
121#endif // NIM_SDK_DLL_EXPORT_HEADERS_NIM_AI_DEF_H_
static const char * kNIMAICallKeyModelConfigKeyTemperature
取值范围 (0, 2), 用于控制随机性和多样性的程度。
Definition: nim_ai_def.h:77
static const char * kNIMAICallKeyMessageRoleUnknown
Definition: nim_ai_def.h:88
static const char * kNIMAICallKeyPromptVariables
提示词变量占位符替换
Definition: nim_ai_def.h:66
void(* nim_ai_proxy_ai_model_call_cb)(enum NIMResCode code, const void *user_data)
Definition: nim_ai_def.h:113
static const char * kNIMAICallKeyModelConfigKeyPrompt
提示词
Definition: nim_ai_def.h:71
static const char * kNIMAICallKeyAntispamConfig
AI proxy 反垃圾配置
Definition: nim_ai_def.h:80
static const char * kNIMAICallKeyMessageRoleUser
Definition: nim_ai_def.h:87
static const char * kNIMAICallKeyAIRAGIcon
string AI RAG 信息图标
Definition: nim_ai_def.h:25
static const char * kNIMAICallKeyMessageKeyType
类型, 暂时只有 0, 代表文本, 预留扩展能力
Definition: nim_ai_def.h:63
static const char * kNIMAICallKeyAntispamConfigKeyBizID
AI proxy 反垃圾配置易盾业务 ID
Definition: nim_ai_def.h:84
static const char * kNIMAICallKeyStreamingMessageChunkType
AI 流式消息分片类型,当前仅支持 0 表示文本
Definition: nim_ai_def.h:43
void(* nim_ai_get_ai_user_list_cb)(enum NIMResCode code, const char *result, const void *user_data)
Definition: nim_ai_def.h:111
static const char * kNIMAICallKeyModelConfigKeyMaxTokens
模型最大 tokens 数量
Definition: nim_ai_def.h:73
static const char * kNIMAICallKeyAIRAGTitle
string AI RAG 信息标题
Definition: nim_ai_def.h:29
static const char * kNIMAICallKeyAntispamConfigKeyEnable
AI proxy 反垃圾配置 enable
Definition: nim_ai_def.h:82
NIMAIModelType
AI 数字人消息模型类型
Definition: nim_ai_def.h:101
@ kNIMMessageAIModelTypeAzure
微软 Azure
Definition: nim_ai_def.h:106
@ kNIMMessageAIModelTypeQianWen
通义千问
Definition: nim_ai_def.h:104
@ kNIMMessageAIModelTypeUnknown
Definition: nim_ai_def.h:102
@ kNIMMessageAIModelTypePrivate
私有本地大模型
Definition: nim_ai_def.h:108
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
@ kNIMMessageAIModelRoleTypeUser
用户
Definition: nim_ai_def.h:95
@ kNIMMessageAIModelRoleTypeAssistant
助手
Definition: nim_ai_def.h:97
static const char * kNIMAICallKeyAIRAGUrl
string AI RAG 信息地址
Definition: nim_ai_def.h:27
static const char * kNIMAICallKeyMessageKeyMsg
上下文的内容
Definition: nim_ai_def.h:61
static const char * kNIMAICallKeyMessages
上下文内容
Definition: nim_ai_def.h:57
static const char * kNIMAICallKeyModelConfig
请求接口模型相关参数配置, 如果参数不为空, 则默认覆盖控制相关配置
Definition: nim_ai_def.h:69
static const char * kNIMAICallKeyStreamingMessageChunk
AI 流式消息分片信息
Definition: nim_ai_def.h:35
static const char * kNIMAICallKeyModelConfigKeyTopP
取值范围 (0, 1), 生成时, 核采样方法的概率阈值。
Definition: nim_ai_def.h:75
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 * kNIMAICallKeyMessageRoleAssist
Definition: nim_ai_def.h:86
static const char * kNIMAICallKeyRequestID
AI proxy 请求 ID
Definition: nim_ai_def.h:13
void(* nim_ai_stop_ai_model_streaming_call_cb)(enum NIMResCode code, const void *user_data)
Definition: nim_ai_def.h:115
static const char * kNIMAICallKeyStreamingMessageChunkIndex
AI 流式消息分片序号,从 0 开始
Definition: nim_ai_def.h:45
static const char * kNIMAICallKeyStreamingMessageChunkMessageTime
AI 流式消息分片消息时间,即消息创建占位时间
Definition: nim_ai_def.h:39
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 * kNIMAICallKeyMessageKeyRole
上下文内容的角色
Definition: nim_ai_def.h:59
static const char * kNIMAICallKeyStreamingMessageChunkChunkTime
AI 流式消息当前分片时间,chunkTime >= messageTime
Definition: nim_ai_def.h:41
static const char * kNIMAICallKeyStatus
int AI config status
Definition: nim_ai_def.h:15
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
辅助能力 接口相关的常量函数等定义头文件
NIMResCode
Definition: public_defines.h:21