@hddjs/hdd-cloud-types 1.0.1 → 1.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/HddCloud/common/index.d.ts +4 -4
- package/HddCloud/index.d.ts +59 -59
- package/README.md +2 -2
- package/hdd-ai-cloud/common/AISceneEnum.d.ts +54 -21
- package/hdd-ai-cloud/common/{IAliFcContext.ts → IAliFcContext.d.ts} +5 -5
- package/hdd-ai-cloud/common/ICallUniCloudParams.js +2 -0
- package/hdd-ai-cloud/common/ICallUniCloudParams.ts +20 -0
- package/hdd-ai-cloud/common/IChatAiMessageItem.d.ts +23 -23
- package/hdd-ai-cloud/common/ICommonReqRes.d.ts +30 -30
- package/hdd-ai-cloud/common/ICommonRequstHead.js +2 -0
- package/hdd-ai-cloud/common/ICommonRequstHead.ts +17 -0
- package/hdd-ai-cloud/common/ICounselor.d.ts +4 -4
- package/hdd-ai-cloud/common/ISceneAiConfig.d.ts +27 -27
- package/hdd-ai-cloud/common/ISessionContent.d.ts +9 -9
- package/hdd-ai-cloud/common/ISessionRole.d.ts +21 -21
- package/hdd-ai-cloud/common/ISseChunk.d.ts +57 -53
- package/hdd-ai-cloud/common/IThisContext.d.ts +128 -128
- package/hdd-ai-cloud/common/index.d.ts +11 -9
- package/hdd-ai-cloud/index.d.ts +171 -131
- package/index.d.ts +2 -2
- package/npmPublish.md +10 -10
- package/package.json +1 -1
- package/hdd-ai-cloud/common/IAliFcContext.js +0 -2
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export interface IOpenAiMessage {
|
|
2
|
-
content?: string;
|
|
3
|
-
role?: 'user' | 'assistant' | 'system' | 'tool';
|
|
4
|
-
}
|
|
1
|
+
export interface IOpenAiMessage {
|
|
2
|
+
content?: string;
|
|
3
|
+
role?: 'user' | 'assistant' | 'system' | 'tool';
|
|
4
|
+
}
|
package/HddCloud/index.d.ts
CHANGED
|
@@ -1,59 +1,59 @@
|
|
|
1
|
-
export * from './common';
|
|
2
|
-
export interface HddCloud {}
|
|
3
|
-
/**
|
|
4
|
-
* 符合openai格式的大模型调用入参
|
|
5
|
-
* @tutorial https://help.aliyun.com/zh/model-studio/developer-reference/use-qwen-by-calling-api?spm=a2c4g.11186623.help-menu-2400256.d_3_3_0.1ff14823Prcy7Z&scm=20140722.H_2712576._.OR_help-T_cn~zh-V_1
|
|
6
|
-
*/
|
|
7
|
-
export interface IChatOpenAiParams {
|
|
8
|
-
/**
|
|
9
|
-
* 调用配置信息 如apikey url等
|
|
10
|
-
*/
|
|
11
|
-
hddOptions: {
|
|
12
|
-
/**
|
|
13
|
-
* 模型地址
|
|
14
|
-
*/
|
|
15
|
-
baseUrl: string;
|
|
16
|
-
/**
|
|
17
|
-
* 调用大模型的apiKey
|
|
18
|
-
*/
|
|
19
|
-
apiKey: string;
|
|
20
|
-
};
|
|
21
|
-
/**
|
|
22
|
-
* 调用的模型
|
|
23
|
-
*/
|
|
24
|
-
model?: 'qwq-plus' | 'qwen-max' | 'deepseek-r1' | 'deepseek-v3';
|
|
25
|
-
/**
|
|
26
|
-
* 对话消息
|
|
27
|
-
*/
|
|
28
|
-
messages?: IOpenAiMessage[];
|
|
29
|
-
/**
|
|
30
|
-
* 是否开启流式传输
|
|
31
|
-
*/
|
|
32
|
-
stream?: boolean;
|
|
33
|
-
/**
|
|
34
|
-
* 是否包含使用情况 流式传输时候生效
|
|
35
|
-
*/
|
|
36
|
-
stream_options?: {
|
|
37
|
-
include_usage?: boolean;
|
|
38
|
-
};
|
|
39
|
-
/**
|
|
40
|
-
* 返回的格式 默认text
|
|
41
|
-
*/
|
|
42
|
-
response_format?: {
|
|
43
|
-
type: 'text' | 'json_object';
|
|
44
|
-
};
|
|
45
|
-
/**
|
|
46
|
-
* 最大生成token数
|
|
47
|
-
*/
|
|
48
|
-
max_tokens?: number;
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
/**
|
|
52
|
-
* 符合openai规范的 大模型调用的流式chunk消息体
|
|
53
|
-
*/
|
|
54
|
-
export interface IChatOpenAiChunk {}
|
|
55
|
-
|
|
56
|
-
/**
|
|
57
|
-
* 符合openai格式的大模型调用出参
|
|
58
|
-
*/
|
|
59
|
-
export interface IChatOpenAiRes extends AsyncIterable<IChatOpenAiChunk> {}
|
|
1
|
+
export * from './common';
|
|
2
|
+
export interface HddCloud {}
|
|
3
|
+
/**
|
|
4
|
+
* 符合openai格式的大模型调用入参
|
|
5
|
+
* @tutorial https://help.aliyun.com/zh/model-studio/developer-reference/use-qwen-by-calling-api?spm=a2c4g.11186623.help-menu-2400256.d_3_3_0.1ff14823Prcy7Z&scm=20140722.H_2712576._.OR_help-T_cn~zh-V_1
|
|
6
|
+
*/
|
|
7
|
+
export interface IChatOpenAiParams {
|
|
8
|
+
/**
|
|
9
|
+
* 调用配置信息 如apikey url等
|
|
10
|
+
*/
|
|
11
|
+
hddOptions: {
|
|
12
|
+
/**
|
|
13
|
+
* 模型地址
|
|
14
|
+
*/
|
|
15
|
+
baseUrl: string;
|
|
16
|
+
/**
|
|
17
|
+
* 调用大模型的apiKey
|
|
18
|
+
*/
|
|
19
|
+
apiKey: string;
|
|
20
|
+
};
|
|
21
|
+
/**
|
|
22
|
+
* 调用的模型
|
|
23
|
+
*/
|
|
24
|
+
model?: 'qwq-plus' | 'qwen-max' | 'deepseek-r1' | 'deepseek-v3';
|
|
25
|
+
/**
|
|
26
|
+
* 对话消息
|
|
27
|
+
*/
|
|
28
|
+
messages?: IOpenAiMessage[];
|
|
29
|
+
/**
|
|
30
|
+
* 是否开启流式传输
|
|
31
|
+
*/
|
|
32
|
+
stream?: boolean;
|
|
33
|
+
/**
|
|
34
|
+
* 是否包含使用情况 流式传输时候生效
|
|
35
|
+
*/
|
|
36
|
+
stream_options?: {
|
|
37
|
+
include_usage?: boolean;
|
|
38
|
+
};
|
|
39
|
+
/**
|
|
40
|
+
* 返回的格式 默认text
|
|
41
|
+
*/
|
|
42
|
+
response_format?: {
|
|
43
|
+
type: 'text' | 'json_object';
|
|
44
|
+
};
|
|
45
|
+
/**
|
|
46
|
+
* 最大生成token数
|
|
47
|
+
*/
|
|
48
|
+
max_tokens?: number;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* 符合openai规范的 大模型调用的流式chunk消息体
|
|
53
|
+
*/
|
|
54
|
+
export interface IChatOpenAiChunk {}
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* 符合openai格式的大模型调用出参
|
|
58
|
+
*/
|
|
59
|
+
export interface IChatOpenAiRes extends AsyncIterable<IChatOpenAiChunk> {}
|
package/README.md
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
### 项目定位
|
|
2
|
-
各云函数、工具集类型
|
|
1
|
+
### 项目定位
|
|
2
|
+
各云函数、工具集类型
|
|
3
3
|
npm包名 @hddjs/hdd-cloud-types
|
|
@@ -1,21 +1,54 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* AI场景枚举
|
|
3
|
-
*/
|
|
4
|
-
export const enum AISceneEnum {
|
|
5
|
-
/**
|
|
6
|
-
* 高考志愿填报
|
|
7
|
-
*/
|
|
8
|
-
GAOKAO = 'gaokao',
|
|
9
|
-
/**
|
|
10
|
-
* 高考志愿填报 基本情况问答
|
|
11
|
-
*/
|
|
12
|
-
GAOKAO_BASE_ASK = 'gaokao_base_ask',
|
|
13
|
-
/**
|
|
14
|
-
* 高考志愿填报 可能的答案
|
|
15
|
-
*/
|
|
16
|
-
GAOKAO_MAYBE_ANSWER = 'gaokao_maybe_answer',
|
|
17
|
-
/**
|
|
18
|
-
* 学习助手
|
|
19
|
-
*/
|
|
20
|
-
Study_Helper = 'study_helper'
|
|
21
|
-
|
|
1
|
+
/**
|
|
2
|
+
* AI场景枚举
|
|
3
|
+
*/
|
|
4
|
+
export const enum AISceneEnum {
|
|
5
|
+
/**
|
|
6
|
+
* 高考志愿填报
|
|
7
|
+
*/
|
|
8
|
+
GAOKAO = 'gaokao',
|
|
9
|
+
/**
|
|
10
|
+
* 高考志愿填报 基本情况问答
|
|
11
|
+
*/
|
|
12
|
+
GAOKAO_BASE_ASK = 'gaokao_base_ask',
|
|
13
|
+
/**
|
|
14
|
+
* 高考志愿填报 可能的答案
|
|
15
|
+
*/
|
|
16
|
+
GAOKAO_MAYBE_ANSWER = 'gaokao_maybe_answer',
|
|
17
|
+
/**
|
|
18
|
+
* 学习助手
|
|
19
|
+
*/
|
|
20
|
+
Study_Helper = 'study_helper',
|
|
21
|
+
/**
|
|
22
|
+
* 会话总结
|
|
23
|
+
*/
|
|
24
|
+
CONVERSATION_SUMMARY = 'conversation_summary',
|
|
25
|
+
/**
|
|
26
|
+
* 自我评估
|
|
27
|
+
*/
|
|
28
|
+
SELF_EVALUATION = 'self_evaluation',
|
|
29
|
+
/**
|
|
30
|
+
* 性格测试
|
|
31
|
+
*/
|
|
32
|
+
PERSONALITY_TEST = 'personality_test',
|
|
33
|
+
/**
|
|
34
|
+
* 职业倾向评估
|
|
35
|
+
*/
|
|
36
|
+
CAREER_ORIENTATION = 'career_orientation',
|
|
37
|
+
/**
|
|
38
|
+
* 职业倾向评估(JSON格式)
|
|
39
|
+
*/
|
|
40
|
+
CAREER_ORIENTATION_JSON = 'career_orientation_json',
|
|
41
|
+
/**
|
|
42
|
+
* 专业推荐(JSON格式)
|
|
43
|
+
*/
|
|
44
|
+
MAJOR_RECOMMENDATION = 'major_recommendation',
|
|
45
|
+
/**
|
|
46
|
+
* 三维评估
|
|
47
|
+
*/
|
|
48
|
+
THREE_DIMENSIONAL_EVALUATION = 'three_dimensional_evaluation',
|
|
49
|
+
/**
|
|
50
|
+
* 建议
|
|
51
|
+
*/
|
|
52
|
+
GAOKAO_THINKING = 'gaokao_thinking',
|
|
53
|
+
DEBUG_GAOKAO = 'DEBUG_GAOKAO'
|
|
54
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Aliyun FC context
|
|
3
|
-
* @tutorial https://help.aliyun.com/zh/functioncompute/context?spm=a2c4g.11186623.help-menu-2508973.d_2_2_3_1.4fe7626axuNlJW
|
|
4
|
-
*/
|
|
5
|
-
export interface IAliFcContext {}
|
|
1
|
+
/**
|
|
2
|
+
* Aliyun FC context
|
|
3
|
+
* @tutorial https://help.aliyun.com/zh/functioncompute/context?spm=a2c4g.11186623.help-menu-2508973.d_2_2_3_1.4fe7626axuNlJW
|
|
4
|
+
*/
|
|
5
|
+
export interface IAliFcContext {}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 阿里云调用uniCloud接口的通用方法
|
|
3
|
+
* @param params 请求业务参数
|
|
4
|
+
* @param ctx Koa上下文对象
|
|
5
|
+
* @returns 接口返回数据
|
|
6
|
+
*/
|
|
7
|
+
export interface ICallUniCloudParams<IReq> {
|
|
8
|
+
/**
|
|
9
|
+
* 云对象名称
|
|
10
|
+
*/
|
|
11
|
+
cloudObj: string;
|
|
12
|
+
/**
|
|
13
|
+
* 要调用的方法名称
|
|
14
|
+
*/
|
|
15
|
+
methodName: string;
|
|
16
|
+
/**
|
|
17
|
+
* 请求参数
|
|
18
|
+
*/
|
|
19
|
+
params: IReq;
|
|
20
|
+
}
|
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
import { type SessionRoleEnum } from './SessionRoleEnum';
|
|
2
|
-
export interface IChatAiMessageItem {
|
|
3
|
-
/**
|
|
4
|
-
* 会话角色 前端禁止传入系统消息 服务端需要过滤前端传入的系统消息
|
|
5
|
-
*/
|
|
6
|
-
role: SessionRoleEnum;
|
|
7
|
-
/**
|
|
8
|
-
* 消息内容
|
|
9
|
-
*/
|
|
10
|
-
content: string;
|
|
11
|
-
/**
|
|
12
|
-
* 发送者昵称
|
|
13
|
-
*/
|
|
14
|
-
nickName?: string;
|
|
15
|
-
/**
|
|
16
|
-
* 发送时间戳
|
|
17
|
-
*/
|
|
18
|
-
timeStamp?: number;
|
|
19
|
-
/**
|
|
20
|
-
* 发送时间字符串展示 YYYY-MM-DD HH:mm:ss / HH:mm:ss
|
|
21
|
-
*/
|
|
22
|
-
timeStr?: string;
|
|
23
|
-
}
|
|
1
|
+
import { type SessionRoleEnum } from './SessionRoleEnum';
|
|
2
|
+
export interface IChatAiMessageItem {
|
|
3
|
+
/**
|
|
4
|
+
* 会话角色 前端禁止传入系统消息 服务端需要过滤前端传入的系统消息
|
|
5
|
+
*/
|
|
6
|
+
role: SessionRoleEnum;
|
|
7
|
+
/**
|
|
8
|
+
* 消息内容
|
|
9
|
+
*/
|
|
10
|
+
content: string;
|
|
11
|
+
/**
|
|
12
|
+
* 发送者昵称
|
|
13
|
+
*/
|
|
14
|
+
nickName?: string;
|
|
15
|
+
/**
|
|
16
|
+
* 发送时间戳
|
|
17
|
+
*/
|
|
18
|
+
timeStamp?: number;
|
|
19
|
+
/**
|
|
20
|
+
* 发送时间字符串展示 YYYY-MM-DD HH:mm:ss / HH:mm:ss
|
|
21
|
+
*/
|
|
22
|
+
timeStr?: string;
|
|
23
|
+
}
|
|
@@ -1,30 +1,30 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* 通用res返回参数
|
|
3
|
-
*/
|
|
4
|
-
export interface ICommonRes {
|
|
5
|
-
/**
|
|
6
|
-
* 错误码 0:成功
|
|
7
|
-
*/
|
|
8
|
-
errCode?: string;
|
|
9
|
-
/**
|
|
10
|
-
* 错误信息
|
|
11
|
-
*/
|
|
12
|
-
errMsg?: string;
|
|
13
|
-
/**
|
|
14
|
-
* 运行时间 ms
|
|
15
|
-
*/
|
|
16
|
-
funRunTime?: number;
|
|
17
|
-
/**
|
|
18
|
-
* 开始时间时间戳
|
|
19
|
-
*/
|
|
20
|
-
funStartTime?: number;
|
|
21
|
-
/**
|
|
22
|
-
* 结束时间时间戳
|
|
23
|
-
*/
|
|
24
|
-
funEndTime?: number;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
/**
|
|
28
|
-
* 通用请求参数
|
|
29
|
-
*/
|
|
30
|
-
export interface ICommonReq {}
|
|
1
|
+
/**
|
|
2
|
+
* 通用res返回参数
|
|
3
|
+
*/
|
|
4
|
+
export interface ICommonRes {
|
|
5
|
+
/**
|
|
6
|
+
* 错误码 0:成功
|
|
7
|
+
*/
|
|
8
|
+
errCode?: string;
|
|
9
|
+
/**
|
|
10
|
+
* 错误信息
|
|
11
|
+
*/
|
|
12
|
+
errMsg?: string;
|
|
13
|
+
/**
|
|
14
|
+
* 运行时间 ms
|
|
15
|
+
*/
|
|
16
|
+
funRunTime?: number;
|
|
17
|
+
/**
|
|
18
|
+
* 开始时间时间戳
|
|
19
|
+
*/
|
|
20
|
+
funStartTime?: number;
|
|
21
|
+
/**
|
|
22
|
+
* 结束时间时间戳
|
|
23
|
+
*/
|
|
24
|
+
funEndTime?: number;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* 通用请求参数
|
|
29
|
+
*/
|
|
30
|
+
export interface ICommonReq {}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @description: 通用请求头
|
|
3
|
+
*/
|
|
4
|
+
export interface ICommonRequestHead {
|
|
5
|
+
/**
|
|
6
|
+
* @description: 符合uniCloud的token
|
|
7
|
+
*/
|
|
8
|
+
uniIdToken?: string;
|
|
9
|
+
/**
|
|
10
|
+
* @description: 请求的时间戳
|
|
11
|
+
*/
|
|
12
|
+
timestamp?: number;
|
|
13
|
+
/**
|
|
14
|
+
* @description: 待扩展的请求头信息
|
|
15
|
+
*/
|
|
16
|
+
[key: string]: unknown;
|
|
17
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* 咨询师
|
|
3
|
-
*/
|
|
4
|
-
export interface ICounselor {}
|
|
1
|
+
/**
|
|
2
|
+
* 咨询师
|
|
3
|
+
*/
|
|
4
|
+
export interface ICounselor {}
|
|
@@ -1,27 +1,27 @@
|
|
|
1
|
-
import { type AISceneEnum } from './AISceneEnum';
|
|
2
|
-
/**
|
|
3
|
-
* AI场景hdd-ai-config配置
|
|
4
|
-
*/
|
|
5
|
-
export interface ISceneAiConfig {
|
|
6
|
-
/**
|
|
7
|
-
* apiKey
|
|
8
|
-
*/
|
|
9
|
-
apiKey?: string;
|
|
10
|
-
/**
|
|
11
|
-
* baseURL
|
|
12
|
-
*/
|
|
13
|
-
baseURL?: string;
|
|
14
|
-
/**
|
|
15
|
-
* 提问场景
|
|
16
|
-
*/
|
|
17
|
-
scene?: AISceneEnum;
|
|
18
|
-
/**
|
|
19
|
-
* 场景描述
|
|
20
|
-
*/
|
|
21
|
-
desc?: string;
|
|
22
|
-
/**
|
|
23
|
-
* 该场景需要调用的模型
|
|
24
|
-
* @enum 'qwen-max' | 'deepseek-r1' | 'qwen-plus'
|
|
25
|
-
*/
|
|
26
|
-
model?: string;
|
|
27
|
-
}
|
|
1
|
+
import { type AISceneEnum } from './AISceneEnum';
|
|
2
|
+
/**
|
|
3
|
+
* AI场景hdd-ai-config配置
|
|
4
|
+
*/
|
|
5
|
+
export interface ISceneAiConfig {
|
|
6
|
+
/**
|
|
7
|
+
* apiKey
|
|
8
|
+
*/
|
|
9
|
+
apiKey?: string;
|
|
10
|
+
/**
|
|
11
|
+
* baseURL
|
|
12
|
+
*/
|
|
13
|
+
baseURL?: string;
|
|
14
|
+
/**
|
|
15
|
+
* 提问场景
|
|
16
|
+
*/
|
|
17
|
+
scene?: AISceneEnum;
|
|
18
|
+
/**
|
|
19
|
+
* 场景描述
|
|
20
|
+
*/
|
|
21
|
+
desc?: string;
|
|
22
|
+
/**
|
|
23
|
+
* 该场景需要调用的模型
|
|
24
|
+
* @enum 'qwen-max' | 'deepseek-r1' | 'qwen-plus'
|
|
25
|
+
*/
|
|
26
|
+
model?: string;
|
|
27
|
+
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* 会话内容
|
|
3
|
-
*/
|
|
4
|
-
export interface ISessionContent {
|
|
5
|
-
/**
|
|
6
|
-
* 消息内容id
|
|
7
|
-
*/
|
|
8
|
-
_id?: string;
|
|
9
|
-
}
|
|
1
|
+
/**
|
|
2
|
+
* 会话内容
|
|
3
|
+
*/
|
|
4
|
+
export interface ISessionContent {
|
|
5
|
+
/**
|
|
6
|
+
* 消息内容id
|
|
7
|
+
*/
|
|
8
|
+
_id?: string;
|
|
9
|
+
}
|
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* 会话角色枚举
|
|
3
|
-
*/
|
|
4
|
-
export const enum SessionRoleEnum {
|
|
5
|
-
/**
|
|
6
|
-
* 用户
|
|
7
|
-
*/
|
|
8
|
-
USER = 'user',
|
|
9
|
-
/**
|
|
10
|
-
* ai
|
|
11
|
-
*/
|
|
12
|
-
ASSISTANT = 'assistant',
|
|
13
|
-
/**
|
|
14
|
-
* 系统
|
|
15
|
-
*/
|
|
16
|
-
SYSTEM = 'system',
|
|
17
|
-
/**
|
|
18
|
-
* 工具
|
|
19
|
-
* */
|
|
20
|
-
TOOL = 'tool'
|
|
21
|
-
}
|
|
1
|
+
/**
|
|
2
|
+
* 会话角色枚举
|
|
3
|
+
*/
|
|
4
|
+
export const enum SessionRoleEnum {
|
|
5
|
+
/**
|
|
6
|
+
* 用户
|
|
7
|
+
*/
|
|
8
|
+
USER = 'user',
|
|
9
|
+
/**
|
|
10
|
+
* ai
|
|
11
|
+
*/
|
|
12
|
+
ASSISTANT = 'assistant',
|
|
13
|
+
/**
|
|
14
|
+
* 系统
|
|
15
|
+
*/
|
|
16
|
+
SYSTEM = 'system',
|
|
17
|
+
/**
|
|
18
|
+
* 工具
|
|
19
|
+
* */
|
|
20
|
+
TOOL = 'tool'
|
|
21
|
+
}
|
|
@@ -1,53 +1,57 @@
|
|
|
1
|
-
import { type SessionRoleEnum } from './ISessionRole';
|
|
2
|
-
/**
|
|
3
|
-
* sse流式返回片段
|
|
4
|
-
*/
|
|
5
|
-
export interface ISseChunk {
|
|
6
|
-
/**
|
|
7
|
-
* sse流式返回片段的类型
|
|
8
|
-
*/
|
|
9
|
-
type: ISseChunkType;
|
|
10
|
-
/**
|
|
11
|
-
* sse流式返回片段的角色
|
|
12
|
-
*/
|
|
13
|
-
role?: SessionRoleEnum;
|
|
14
|
-
/**
|
|
15
|
-
* 当type为content时sse流式返回片段的内容
|
|
16
|
-
*/
|
|
17
|
-
content?: string | null;
|
|
18
|
-
/**
|
|
19
|
-
* 当type为reason时sse流式返回片段的原因
|
|
20
|
-
*/
|
|
21
|
-
reason?: string | null;
|
|
22
|
-
/**
|
|
23
|
-
* 当type为formatJson时sse流式返回片段的格式化json
|
|
24
|
-
* */
|
|
25
|
-
formatJson?: {
|
|
26
|
-
/**
|
|
27
|
-
* 是否开始下一个流程
|
|
28
|
-
*/
|
|
29
|
-
startNextStep?: boolean;
|
|
30
|
-
/**
|
|
31
|
-
*
|
|
32
|
-
*/
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
/**
|
|
46
|
-
*
|
|
47
|
-
*/
|
|
48
|
-
|
|
49
|
-
/**
|
|
50
|
-
*
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
1
|
+
import { type SessionRoleEnum } from './ISessionRole';
|
|
2
|
+
/**
|
|
3
|
+
* sse流式返回片段
|
|
4
|
+
*/
|
|
5
|
+
export interface ISseChunk {
|
|
6
|
+
/**
|
|
7
|
+
* sse流式返回片段的类型
|
|
8
|
+
*/
|
|
9
|
+
type: ISseChunkType;
|
|
10
|
+
/**
|
|
11
|
+
* sse流式返回片段的角色
|
|
12
|
+
*/
|
|
13
|
+
role?: SessionRoleEnum;
|
|
14
|
+
/**
|
|
15
|
+
* 当type为content时sse流式返回片段的内容
|
|
16
|
+
*/
|
|
17
|
+
content?: string | null;
|
|
18
|
+
/**
|
|
19
|
+
* 当type为reason时sse流式返回片段的原因
|
|
20
|
+
*/
|
|
21
|
+
reason?: string | null;
|
|
22
|
+
/**
|
|
23
|
+
* 当type为formatJson时sse流式返回片段的格式化json
|
|
24
|
+
* */
|
|
25
|
+
formatJson?: {
|
|
26
|
+
/**
|
|
27
|
+
* 是否开始下一个流程
|
|
28
|
+
*/
|
|
29
|
+
startNextStep?: boolean;
|
|
30
|
+
/**
|
|
31
|
+
* 是否是总结
|
|
32
|
+
*/
|
|
33
|
+
isSummary?: boolean;
|
|
34
|
+
/**
|
|
35
|
+
* 可能的答案选项
|
|
36
|
+
*/
|
|
37
|
+
guessAnswerList?: string[];
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* sse流式返回片段的类型
|
|
43
|
+
*/
|
|
44
|
+
export const enum ISseChunkType {
|
|
45
|
+
/**
|
|
46
|
+
* 内容
|
|
47
|
+
*/
|
|
48
|
+
CONTENT = 'content',
|
|
49
|
+
/**
|
|
50
|
+
* 原因
|
|
51
|
+
*/
|
|
52
|
+
REASON = 'reason',
|
|
53
|
+
/**
|
|
54
|
+
* 格式化的json
|
|
55
|
+
* */
|
|
56
|
+
FORMATJSON = 'formatJson'
|
|
57
|
+
}
|
|
@@ -1,128 +1,128 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* uniCloud云对象的this上下文
|
|
3
|
-
*/
|
|
4
|
-
export interface IThisContext {
|
|
5
|
-
/**
|
|
6
|
-
* 函数执行开始的时间戳 毫秒 在_before中赋值
|
|
7
|
-
*/
|
|
8
|
-
funStartTime?: number;
|
|
9
|
-
/**
|
|
10
|
-
* 函数执行结束的时间戳 毫秒 在_after中赋值
|
|
11
|
-
*/
|
|
12
|
-
funEndTime?: number;
|
|
13
|
-
/**
|
|
14
|
-
* 函数执行的总时间 毫秒 在_after中赋值funEndTime - funStartTime
|
|
15
|
-
*/
|
|
16
|
-
funRunTime?: number;
|
|
17
|
-
/**
|
|
18
|
-
* 通过token解析出来的用户信息 _before中赋值 未登录时候赋值为null
|
|
19
|
-
*/
|
|
20
|
-
tokenRes?: ITokenRes | null;
|
|
21
|
-
/**
|
|
22
|
-
* 获取的云对象信息
|
|
23
|
-
*/
|
|
24
|
-
getCloudInfo?: () => ICloudInfo;
|
|
25
|
-
/**
|
|
26
|
-
* 获取客户端信息
|
|
27
|
-
*/
|
|
28
|
-
getClientInfo?: () => IClientInfo;
|
|
29
|
-
/**
|
|
30
|
-
* 获取token
|
|
31
|
-
*/
|
|
32
|
-
getUniIdToken?: () => string;
|
|
33
|
-
/**
|
|
34
|
-
* 获取调用的云对象方法名
|
|
35
|
-
*/
|
|
36
|
-
getMethodName?: () => string;
|
|
37
|
-
/**
|
|
38
|
-
* 获取调用云对象时候传入的参数
|
|
39
|
-
*/
|
|
40
|
-
getParams?: () => any;
|
|
41
|
-
/**
|
|
42
|
-
* 获取请求id
|
|
43
|
-
*/
|
|
44
|
-
getUniCloudRequestId?: () => string;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
/**
|
|
48
|
-
* this.tokenRes解析出来的用户信息
|
|
49
|
-
*/
|
|
50
|
-
export interface ITokenRes {
|
|
51
|
-
/**
|
|
52
|
-
* 错误码 0为成功
|
|
53
|
-
*/
|
|
54
|
-
errCode?: number;
|
|
55
|
-
/**
|
|
56
|
-
* token解析出来的uid
|
|
57
|
-
*/
|
|
58
|
-
uid?: string;
|
|
59
|
-
/**
|
|
60
|
-
* token解析出来的role角色
|
|
61
|
-
*/
|
|
62
|
-
role?: string[];
|
|
63
|
-
/**
|
|
64
|
-
* token解析出来的permission权限
|
|
65
|
-
*/
|
|
66
|
-
permission?: string[];
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
/**
|
|
70
|
-
* this.getClientInfo返回的客户端信息
|
|
71
|
-
*/
|
|
72
|
-
export interface IClientInfo {
|
|
73
|
-
/**
|
|
74
|
-
* 客户端ip
|
|
75
|
-
*/
|
|
76
|
-
clientIP?: string;
|
|
77
|
-
/**
|
|
78
|
-
* 客户端ua,注意非本地运行环境下客户端getSystemInfoSync也会获取ua参数并上传给云对象,但是云对象会从http请求头里面获取ua而不是clientInfo里面的ua
|
|
79
|
-
*/
|
|
80
|
-
userAgent?: string;
|
|
81
|
-
/**
|
|
82
|
-
* 调用来源
|
|
83
|
-
* client uni-app客户端导入云对象调用
|
|
84
|
-
* function 由其他云函数或云对象调用
|
|
85
|
-
* http 云对象URL化后通过http访问调用 HBuilderX 3.5.2+
|
|
86
|
-
* timing 定时任务调用云对象 HBuilderX 3.5.2+
|
|
87
|
-
* server 云函数上传并运行
|
|
88
|
-
*/
|
|
89
|
-
source?: 'client' | 'function' | 'http' | 'timing' | 'server';
|
|
90
|
-
/**
|
|
91
|
-
* 请求id
|
|
92
|
-
*/
|
|
93
|
-
requestId?: string;
|
|
94
|
-
/**
|
|
95
|
-
* 场景值 客户端uni.getLaunchOptionsSync返回的scene参数,新增于HBuilderX 3.5.1
|
|
96
|
-
*/
|
|
97
|
-
scene?: string;
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
/**
|
|
101
|
-
* this.getCloudInfo获取的云对象信息
|
|
102
|
-
*/
|
|
103
|
-
export interface ICloudInfo {
|
|
104
|
-
/**
|
|
105
|
-
* 服务空间供应商,支付宝云为:alipay,阿里云为:aliyun,腾讯云为:tencent
|
|
106
|
-
*/
|
|
107
|
-
provider: 'alipay' | 'aliyun' | 'tencent';
|
|
108
|
-
/**
|
|
109
|
-
* 服务空间Id
|
|
110
|
-
*/
|
|
111
|
-
spaceId: string;
|
|
112
|
-
/**
|
|
113
|
-
* 当前获取的服务空间id是否为迁移前的服务空间id
|
|
114
|
-
*/
|
|
115
|
-
useOldSpaceId: boolean;
|
|
116
|
-
/**
|
|
117
|
-
* 云对象名称
|
|
118
|
-
*/
|
|
119
|
-
functionName: string;
|
|
120
|
-
/**
|
|
121
|
-
* 云对象此值固定为cloudobject
|
|
122
|
-
*/
|
|
123
|
-
functionType: 'cloudobject';
|
|
124
|
-
/**
|
|
125
|
-
* 运行环境,取值为local(本地运行)或cloud(云端运行) 新增于HBuilderX 4.25
|
|
126
|
-
*/
|
|
127
|
-
runtimeEnv: 'local' | 'cloud';
|
|
128
|
-
}
|
|
1
|
+
/**
|
|
2
|
+
* uniCloud云对象的this上下文
|
|
3
|
+
*/
|
|
4
|
+
export interface IThisContext {
|
|
5
|
+
/**
|
|
6
|
+
* 函数执行开始的时间戳 毫秒 在_before中赋值
|
|
7
|
+
*/
|
|
8
|
+
funStartTime?: number;
|
|
9
|
+
/**
|
|
10
|
+
* 函数执行结束的时间戳 毫秒 在_after中赋值
|
|
11
|
+
*/
|
|
12
|
+
funEndTime?: number;
|
|
13
|
+
/**
|
|
14
|
+
* 函数执行的总时间 毫秒 在_after中赋值funEndTime - funStartTime
|
|
15
|
+
*/
|
|
16
|
+
funRunTime?: number;
|
|
17
|
+
/**
|
|
18
|
+
* 通过token解析出来的用户信息 _before中赋值 未登录时候赋值为null
|
|
19
|
+
*/
|
|
20
|
+
tokenRes?: ITokenRes | null;
|
|
21
|
+
/**
|
|
22
|
+
* 获取的云对象信息
|
|
23
|
+
*/
|
|
24
|
+
getCloudInfo?: () => ICloudInfo;
|
|
25
|
+
/**
|
|
26
|
+
* 获取客户端信息
|
|
27
|
+
*/
|
|
28
|
+
getClientInfo?: () => IClientInfo;
|
|
29
|
+
/**
|
|
30
|
+
* 获取token
|
|
31
|
+
*/
|
|
32
|
+
getUniIdToken?: () => string;
|
|
33
|
+
/**
|
|
34
|
+
* 获取调用的云对象方法名
|
|
35
|
+
*/
|
|
36
|
+
getMethodName?: () => string;
|
|
37
|
+
/**
|
|
38
|
+
* 获取调用云对象时候传入的参数
|
|
39
|
+
*/
|
|
40
|
+
getParams?: () => any;
|
|
41
|
+
/**
|
|
42
|
+
* 获取请求id
|
|
43
|
+
*/
|
|
44
|
+
getUniCloudRequestId?: () => string;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* this.tokenRes解析出来的用户信息
|
|
49
|
+
*/
|
|
50
|
+
export interface ITokenRes {
|
|
51
|
+
/**
|
|
52
|
+
* 错误码 0为成功
|
|
53
|
+
*/
|
|
54
|
+
errCode?: number;
|
|
55
|
+
/**
|
|
56
|
+
* token解析出来的uid
|
|
57
|
+
*/
|
|
58
|
+
uid?: string;
|
|
59
|
+
/**
|
|
60
|
+
* token解析出来的role角色
|
|
61
|
+
*/
|
|
62
|
+
role?: string[];
|
|
63
|
+
/**
|
|
64
|
+
* token解析出来的permission权限
|
|
65
|
+
*/
|
|
66
|
+
permission?: string[];
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* this.getClientInfo返回的客户端信息
|
|
71
|
+
*/
|
|
72
|
+
export interface IClientInfo {
|
|
73
|
+
/**
|
|
74
|
+
* 客户端ip
|
|
75
|
+
*/
|
|
76
|
+
clientIP?: string;
|
|
77
|
+
/**
|
|
78
|
+
* 客户端ua,注意非本地运行环境下客户端getSystemInfoSync也会获取ua参数并上传给云对象,但是云对象会从http请求头里面获取ua而不是clientInfo里面的ua
|
|
79
|
+
*/
|
|
80
|
+
userAgent?: string;
|
|
81
|
+
/**
|
|
82
|
+
* 调用来源
|
|
83
|
+
* client uni-app客户端导入云对象调用
|
|
84
|
+
* function 由其他云函数或云对象调用
|
|
85
|
+
* http 云对象URL化后通过http访问调用 HBuilderX 3.5.2+
|
|
86
|
+
* timing 定时任务调用云对象 HBuilderX 3.5.2+
|
|
87
|
+
* server 云函数上传并运行
|
|
88
|
+
*/
|
|
89
|
+
source?: 'client' | 'function' | 'http' | 'timing' | 'server';
|
|
90
|
+
/**
|
|
91
|
+
* 请求id
|
|
92
|
+
*/
|
|
93
|
+
requestId?: string;
|
|
94
|
+
/**
|
|
95
|
+
* 场景值 客户端uni.getLaunchOptionsSync返回的scene参数,新增于HBuilderX 3.5.1
|
|
96
|
+
*/
|
|
97
|
+
scene?: string;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
/**
|
|
101
|
+
* this.getCloudInfo获取的云对象信息
|
|
102
|
+
*/
|
|
103
|
+
export interface ICloudInfo {
|
|
104
|
+
/**
|
|
105
|
+
* 服务空间供应商,支付宝云为:alipay,阿里云为:aliyun,腾讯云为:tencent
|
|
106
|
+
*/
|
|
107
|
+
provider: 'alipay' | 'aliyun' | 'tencent';
|
|
108
|
+
/**
|
|
109
|
+
* 服务空间Id
|
|
110
|
+
*/
|
|
111
|
+
spaceId: string;
|
|
112
|
+
/**
|
|
113
|
+
* 当前获取的服务空间id是否为迁移前的服务空间id
|
|
114
|
+
*/
|
|
115
|
+
useOldSpaceId: boolean;
|
|
116
|
+
/**
|
|
117
|
+
* 云对象名称
|
|
118
|
+
*/
|
|
119
|
+
functionName: string;
|
|
120
|
+
/**
|
|
121
|
+
* 云对象此值固定为cloudobject
|
|
122
|
+
*/
|
|
123
|
+
functionType: 'cloudobject';
|
|
124
|
+
/**
|
|
125
|
+
* 运行环境,取值为local(本地运行)或cloud(云端运行) 新增于HBuilderX 4.25
|
|
126
|
+
*/
|
|
127
|
+
runtimeEnv: 'local' | 'cloud';
|
|
128
|
+
}
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
export * from './ICommonReqRes';
|
|
2
|
-
export * from './ISessionRole';
|
|
3
|
-
export * from './ISessionContent';
|
|
4
|
-
export * from './ICounselor';
|
|
5
|
-
export * from './IChatAiMessageItem';
|
|
6
|
-
export * from './AISceneEnum';
|
|
7
|
-
export * from './ISceneAiConfig';
|
|
8
|
-
export * from './IAliFcContext';
|
|
9
|
-
export * from './ISseChunk';
|
|
1
|
+
export * from './ICommonReqRes';
|
|
2
|
+
export * from './ISessionRole';
|
|
3
|
+
export * from './ISessionContent';
|
|
4
|
+
export * from './ICounselor';
|
|
5
|
+
export * from './IChatAiMessageItem';
|
|
6
|
+
export * from './AISceneEnum';
|
|
7
|
+
export * from './ISceneAiConfig';
|
|
8
|
+
export * from './IAliFcContext';
|
|
9
|
+
export * from './ISseChunk';
|
|
10
|
+
export * from './ICallUniCloudParams';
|
|
11
|
+
export * from './ICommonRequstHead';
|
package/hdd-ai-cloud/index.d.ts
CHANGED
|
@@ -1,131 +1,171 @@
|
|
|
1
|
-
import { type IChatAiMessageItem } from './common/IChatAiMessageItem';
|
|
2
|
-
import { type ICommonReq, type AISceneEnum } from './common';
|
|
3
|
-
|
|
4
|
-
export * from './common';
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
1
|
+
import { type IChatAiMessageItem } from './common/IChatAiMessageItem';
|
|
2
|
+
import { type ICommonReq, type ICommonRes, type AISceneEnum } from './common';
|
|
3
|
+
|
|
4
|
+
export * from './common';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* 千问AI聊天api 请求参数
|
|
8
|
+
*/
|
|
9
|
+
export interface IChatQwenReq extends ICommonReq {
|
|
10
|
+
/**
|
|
11
|
+
* 历史对话消息
|
|
12
|
+
*/
|
|
13
|
+
messages: IChatAiMessageItem[];
|
|
14
|
+
/**
|
|
15
|
+
* 是否开启流式传输
|
|
16
|
+
*/
|
|
17
|
+
stream: boolean;
|
|
18
|
+
/**
|
|
19
|
+
* 提问场景
|
|
20
|
+
*/
|
|
21
|
+
scene?: AISceneEnum;
|
|
22
|
+
/**
|
|
23
|
+
* 通道id(如果开启流式传输stream为true则必传)
|
|
24
|
+
*/
|
|
25
|
+
channel?: string;
|
|
26
|
+
/**
|
|
27
|
+
* 是否开发模式 仅调式使用 默认false 前端禁止使用
|
|
28
|
+
*/
|
|
29
|
+
devMode?: boolean;
|
|
30
|
+
/**
|
|
31
|
+
*会话id 如有则表示是已经创建的聊天 没有则表示是新聊天
|
|
32
|
+
*/
|
|
33
|
+
sessionId?: string;
|
|
34
|
+
/**
|
|
35
|
+
*会话步骤id
|
|
36
|
+
*/
|
|
37
|
+
stepId?: string;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* 千问AI聊天api 返回参数
|
|
42
|
+
*/
|
|
43
|
+
export interface IChatQwenRes extends ICommonReq {
|
|
44
|
+
/**
|
|
45
|
+
* ai回复消息(完成拼接之后的消息)
|
|
46
|
+
*/
|
|
47
|
+
message: string;
|
|
48
|
+
/**
|
|
49
|
+
* llm运行总时间 单位ms
|
|
50
|
+
*/
|
|
51
|
+
llmRunTime: number;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* AI聊天api 单次流式传输返回参数
|
|
56
|
+
*/
|
|
57
|
+
export interface IChatAIStreamRes {
|
|
58
|
+
/**
|
|
59
|
+
* 当前返回的消息
|
|
60
|
+
*/
|
|
61
|
+
chunkMessage: string;
|
|
62
|
+
/**
|
|
63
|
+
* 深度思考的原因 仅deepseek模型返回
|
|
64
|
+
*/
|
|
65
|
+
chunkReasonMessage?: string;
|
|
66
|
+
/**
|
|
67
|
+
* 索引(从0开始) 本次流式消息是整体流式消息的第几个
|
|
68
|
+
*/
|
|
69
|
+
index: number;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* DeepSeek AI聊天api 请求参数
|
|
74
|
+
*/
|
|
75
|
+
export interface IChatDeepSeekReq extends ICommonReq {
|
|
76
|
+
/**
|
|
77
|
+
* 历史对话消息
|
|
78
|
+
*/
|
|
79
|
+
messages: IChatAiMessageItem[];
|
|
80
|
+
/**
|
|
81
|
+
* 是否开启流式传输
|
|
82
|
+
*/
|
|
83
|
+
stream: boolean;
|
|
84
|
+
/**
|
|
85
|
+
* 通道id(如果开启流式传输stream为true则必传)
|
|
86
|
+
*/
|
|
87
|
+
channel?: string;
|
|
88
|
+
/**
|
|
89
|
+
* 提问场景
|
|
90
|
+
*/
|
|
91
|
+
scene?: AISceneEnum;
|
|
92
|
+
/**
|
|
93
|
+
* 是否开发模式 仅调式使用 默认false 前端禁止使用
|
|
94
|
+
*/
|
|
95
|
+
devMode?: boolean;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
/**
|
|
99
|
+
* DeepSeek AI聊天api 返回参数
|
|
100
|
+
*/
|
|
101
|
+
export interface IChatDeepSeekRes extends ICommonReq {
|
|
102
|
+
/**
|
|
103
|
+
* ai回复消息(完成拼接之后的消息)
|
|
104
|
+
*/
|
|
105
|
+
message: string;
|
|
106
|
+
/**
|
|
107
|
+
* deepseek深度思考给出的原因
|
|
108
|
+
*/
|
|
109
|
+
reasonMessage: string;
|
|
110
|
+
/**
|
|
111
|
+
* llm运行总时间 单位ms
|
|
112
|
+
*/
|
|
113
|
+
llmRunTime: number;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
export interface IGuessAnswerListReq extends ICommonReq {
|
|
117
|
+
/**
|
|
118
|
+
* 问题内容
|
|
119
|
+
*/
|
|
120
|
+
content: string;
|
|
121
|
+
/**
|
|
122
|
+
* 临时消息id
|
|
123
|
+
*/
|
|
124
|
+
tempMsgId: string;
|
|
125
|
+
/**
|
|
126
|
+
* 场景
|
|
127
|
+
*/
|
|
128
|
+
scene?: AISceneEnum;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
export interface IGuessAnswerListRes extends ICommonRes {
|
|
132
|
+
/**
|
|
133
|
+
* 关联的问题id
|
|
134
|
+
*/
|
|
135
|
+
relatedTempMsgId?: string;
|
|
136
|
+
/**
|
|
137
|
+
* 可能的答案选项
|
|
138
|
+
*/
|
|
139
|
+
choices?: string[];
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
/**
|
|
143
|
+
* 生成报告的req
|
|
144
|
+
*/
|
|
145
|
+
export interface IGenerateReportReq extends ICommonReq {
|
|
146
|
+
/**
|
|
147
|
+
* 会话id
|
|
148
|
+
*/
|
|
149
|
+
sessionId?: string;
|
|
150
|
+
/**
|
|
151
|
+
* 报告id
|
|
152
|
+
*/
|
|
153
|
+
reportId?: string;
|
|
154
|
+
/**
|
|
155
|
+
* 报告类型,例如:专业、性格
|
|
156
|
+
*/
|
|
157
|
+
reportType?: string;
|
|
158
|
+
/**
|
|
159
|
+
* 咨询类型
|
|
160
|
+
*/
|
|
161
|
+
counselorId?: string;
|
|
162
|
+
/**
|
|
163
|
+
* 报告所需数据
|
|
164
|
+
*/
|
|
165
|
+
params?: any;
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
/**
|
|
169
|
+
* 生成报告的res
|
|
170
|
+
*/
|
|
171
|
+
export interface IGenerateReportRes extends ICommonRes {}
|
package/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from './hdd-ai-cloud';
|
|
2
|
-
export * from './HddCloud';
|
|
1
|
+
export * from './hdd-ai-cloud';
|
|
2
|
+
export * from './HddCloud';
|
package/npmPublish.md
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
### 发布前切换到官方的站点
|
|
2
|
-
npm config set registry https://registry.npmjs.org/
|
|
3
|
-
### 执行登录
|
|
4
|
-
npm login
|
|
5
|
-
### 发公有包
|
|
6
|
-
npm publish --access=public
|
|
7
|
-
```
|
|
8
|
-
--access=public必须要加上,不然发布的是私有包,而NPM上要发布私有包是要收费的,如果第一步init时没有加上--scope=hddjs,那么这里可以不加上这个后缀,因为不带作用域的包发布时,默认是公有的
|
|
9
|
-
```
|
|
10
|
-
### 发布完包之后切会淘宝源
|
|
1
|
+
### 发布前切换到官方的站点
|
|
2
|
+
npm config set registry https://registry.npmjs.org/
|
|
3
|
+
### 执行登录
|
|
4
|
+
npm login
|
|
5
|
+
### 发公有包
|
|
6
|
+
npm publish --access=public
|
|
7
|
+
```
|
|
8
|
+
--access=public必须要加上,不然发布的是私有包,而NPM上要发布私有包是要收费的,如果第一步init时没有加上--scope=hddjs,那么这里可以不加上这个后缀,因为不带作用域的包发布时,默认是公有的
|
|
9
|
+
```
|
|
10
|
+
### 发布完包之后切会淘宝源
|
|
11
11
|
npm config set registry https://registry.npmmirror.com
|
package/package.json
CHANGED