chore: initialize qiming workspace repository
This commit is contained in:
524
qiming-mobile/types/interfaces/agent.uts
Normal file
524
qiming-mobile/types/interfaces/agent.uts
Normal file
@@ -0,0 +1,524 @@
|
||||
import type {
|
||||
AgentComponentTypeEnum,
|
||||
AllowCopyEnum,
|
||||
DefaultSelectedEnum,
|
||||
EventBindResponseActionEnum,
|
||||
GuidQuestionSetTypeEnum,
|
||||
ExpandPageAreaEnum,
|
||||
HideChatAreaEnum,
|
||||
AgentTypeEnum,
|
||||
} from "../enums/agent";
|
||||
import type { PermissionsEnum, PublishStatusEnum } from "../enums/common";
|
||||
import type { OpenCloseEnum } from "../enums/space";
|
||||
import type { BindConfigWithSub } from "./common";
|
||||
|
||||
// 智能体基础信息
|
||||
export interface AgentBaseInfo {
|
||||
name: string;
|
||||
icon: string;
|
||||
description: string;
|
||||
}
|
||||
|
||||
// 智能体信息
|
||||
export interface AgentInfo extends AgentBaseInfo {
|
||||
id: number;
|
||||
userId: number;
|
||||
modified: string;
|
||||
created: string;
|
||||
agentId: number;
|
||||
spaceId: number;
|
||||
paymentRequired?: boolean;
|
||||
subscribed?: boolean;
|
||||
}
|
||||
|
||||
// 桌面分享详情
|
||||
export interface ShareFileInfo {
|
||||
id: number;
|
||||
shareKey: string;
|
||||
tenantId: number;
|
||||
userId: number;
|
||||
type: "CONVERSATION" | "DESKTOP" | "MESSAGE";
|
||||
targetId: string;
|
||||
content: unknown;
|
||||
expire: string;
|
||||
modified: string;
|
||||
created: string;
|
||||
}
|
||||
|
||||
// 统计信息(智能体、插件、工作流相关的统计都在该结构里,根据实际情况取值)
|
||||
export interface AgentStatisticsInfo {
|
||||
targetId: number;
|
||||
// 用户人数
|
||||
userCount: number;
|
||||
// 会话次数
|
||||
convCount: number;
|
||||
// 收藏次数
|
||||
collectCount: number;
|
||||
// 点赞次数
|
||||
likeCount: number;
|
||||
// 引用次数
|
||||
referenceCount: number;
|
||||
// 调用总次数
|
||||
callCount: number;
|
||||
// 失败调用次数
|
||||
failCallCount: number;
|
||||
// 调用总时长
|
||||
totalCallDuration: number;
|
||||
}
|
||||
|
||||
// 创建者信息
|
||||
export interface CreatorInfo {
|
||||
// 用户ID
|
||||
userId: number;
|
||||
// 用户名
|
||||
userName?: string;
|
||||
// 昵称
|
||||
nickName: string;
|
||||
// 头像
|
||||
avatar?: string | null;
|
||||
}
|
||||
|
||||
// 智能体配置信息
|
||||
export interface AgentConfigInfo {
|
||||
// 智能体ID
|
||||
id: number;
|
||||
// agent唯一标识
|
||||
uid: string;
|
||||
// 商户ID
|
||||
tenantId: number;
|
||||
spaceId: number;
|
||||
creatorId: number;
|
||||
// Agent名称
|
||||
name: string;
|
||||
// Agent描述
|
||||
description: string;
|
||||
// 图标地址
|
||||
icon: string;
|
||||
// 系统提示词
|
||||
systemPrompt: string;
|
||||
// 用户消息提示词
|
||||
userPrompt: string;
|
||||
// 是否开启问题建议,可用值:Open,Close
|
||||
openSuggest: OpenCloseEnum;
|
||||
// 是否开启定时任务,可用值:Open,Close
|
||||
openScheduledTask: OpenCloseEnum;
|
||||
// 问题建议提示词
|
||||
suggestPrompt: string;
|
||||
// 首次打开聊天框自动回复消息
|
||||
openingChatMsg: string;
|
||||
// 首次打开引导问题
|
||||
openingGuidQuestions: string[];
|
||||
// 是否开启长期记忆,可用值:Open,Close
|
||||
openLongMemory: OpenCloseEnum;
|
||||
// 发布状态,可用值:Developing,Applying,Published,Rejected
|
||||
publishStatus: PublishStatusEnum;
|
||||
// 最后编辑时间
|
||||
modified: string;
|
||||
// 创建时间
|
||||
created: string;
|
||||
// 模型信息
|
||||
modelComponentConfig: AgentComponentInfo;
|
||||
// 统计信息(智能体、插件、工作流相关的统计都在该结构里,根据实际情况取值)
|
||||
agentStatistics: AgentStatisticsInfo;
|
||||
// 发布者信息
|
||||
publishUser: CreatorInfo;
|
||||
// 创建者信息
|
||||
creator: CreatorInfo;
|
||||
// 返回的具体业务数据
|
||||
space: any;
|
||||
devCollected: boolean;
|
||||
// 会话ID
|
||||
devConversationId: number;
|
||||
// 发布时间,如果不为空,与当前modified时间做对比,如果发布时间小于modified,则前端显示:有更新未发布
|
||||
publishDate: string;
|
||||
// 发布备注
|
||||
publishRemark: string;
|
||||
// 智能体分类名称
|
||||
category: string;
|
||||
collected: boolean;
|
||||
// 权限列表
|
||||
permissions?: PermissionsEnum[];
|
||||
}
|
||||
|
||||
// 智能体组件模型信息
|
||||
export interface AgentComponentInfo {
|
||||
id: number;
|
||||
// 商户ID
|
||||
tenantId: number;
|
||||
// 组件名称
|
||||
name: string;
|
||||
// 组件图标
|
||||
icon: string;
|
||||
// 组件描述
|
||||
description: string;
|
||||
agentId: number;
|
||||
// 组件类型,可用值:Plugin,Workflow,Trigger,Knowledge,Variable,Database,Model
|
||||
type: AgentComponentTypeEnum;
|
||||
// 绑定组件配置,不同组件配置不一样
|
||||
bindConfig: any;
|
||||
// 关联的组件ID
|
||||
targetId: number;
|
||||
spaceId: number;
|
||||
// 组件原始配置
|
||||
targetConfig: any;
|
||||
// 异常时中断流程
|
||||
exceptionOut: DefaultSelectedEnum;
|
||||
// 异常时输出给大模型的默认信息
|
||||
fallbackMsg: string;
|
||||
modified: string;
|
||||
created: string;
|
||||
groupDescription: string;
|
||||
groupName: string;
|
||||
}
|
||||
|
||||
// 根据用户消息更新会话主题输入参数
|
||||
export interface AgentConversationUpdateParams {
|
||||
// 会话ID
|
||||
id: number;
|
||||
// 用户第一条消息
|
||||
firstMessage?: string;
|
||||
// 会话主题
|
||||
topic?: string;
|
||||
}
|
||||
|
||||
// 卡片列表参数
|
||||
export interface ArgList {
|
||||
key: string;
|
||||
placeholder: string;
|
||||
// 自定义数据,用于页面渲染操作
|
||||
// [key: string]: React.Key | boolean;
|
||||
}
|
||||
|
||||
// 卡片信息
|
||||
export interface AgentCardInfo {
|
||||
id: number;
|
||||
cardKey: string;
|
||||
name: string;
|
||||
imageUrl: string;
|
||||
argList: ArgList[];
|
||||
}
|
||||
|
||||
// 配置手动选择组件信息
|
||||
export interface AgentManualComponentInfo {
|
||||
// 组件ID
|
||||
id: number;
|
||||
// 组件名称
|
||||
name: string;
|
||||
// 组件图标
|
||||
icon: string;
|
||||
// 组件描述
|
||||
description: string;
|
||||
// 组件类型,可用值:Plugin,Workflow,Trigger,Knowledge,Variable,Database,Model,Agent,Table,Agent
|
||||
type: AgentComponentTypeEnum;
|
||||
// 是否默认选中,0-否,1-是
|
||||
defaultSelected: DefaultSelectedEnum;
|
||||
}
|
||||
|
||||
// 配置已选择组件信息
|
||||
export interface AgentSelectedComponentInfo {
|
||||
// 组件ID
|
||||
id: number;
|
||||
// 组件类型,可用值:Plugin,Workflow,Trigger,Knowledge,Variable,Database,Model,Agent,Table,Agent
|
||||
type: AgentComponentTypeEnum;
|
||||
}
|
||||
|
||||
// 引导问题
|
||||
export interface GuidQuestionDto {
|
||||
// 问题类型,可用值:Question,Page,Link
|
||||
type: GuidQuestionSetTypeEnum;
|
||||
// 问题信息
|
||||
info: string;
|
||||
// 图标
|
||||
icon?: string;
|
||||
// 链接地址,type类型为Link时有效
|
||||
url?: string;
|
||||
// 页面ID,type类型为Page时有效
|
||||
pageId?: number;
|
||||
// 页面基础路径,type类型为Page时有效
|
||||
basePath?: string;
|
||||
// 页面路径,type类型为Page时有效
|
||||
pageUri?: string;
|
||||
//页面地址,配置更新时不需要传递,type类型为Page时有效,完整的页面地址,前端需要使用 BASE_URL+pageUrl
|
||||
pageUrl?: string;
|
||||
// 参数
|
||||
args?: BindConfigWithSub[];
|
||||
// 参数值,配置更新时不需要传递,用户点击跳转时直接使用,type类型为Page时有效
|
||||
params?: any;
|
||||
}
|
||||
|
||||
// Agent信息,已发布过的agent才有此信息
|
||||
export interface AgentDetailDto extends AgentBaseInfo {
|
||||
// 会话ID
|
||||
conversationId: number;
|
||||
// 空间ID
|
||||
spaceId: number;
|
||||
// 智能体ID
|
||||
agentId: number;
|
||||
// 沙盒ID
|
||||
sandboxId?: string;
|
||||
// 发布备注信息
|
||||
remark: string;
|
||||
// 智能体发布时间
|
||||
publishDate: number;
|
||||
// 统计信息(智能体、插件、工作流相关的统计都在该结构里,根据实际情况取值)
|
||||
statistics: AgentStatisticsInfo;
|
||||
// 发布者信息
|
||||
publishUser: CreatorInfo;
|
||||
// 智能体分类名称
|
||||
category: string;
|
||||
// 是否开启问题建议,可用值:Open,Close
|
||||
openSuggest: OpenCloseEnum;
|
||||
// 开场白文案
|
||||
openingChatMsg: string;
|
||||
// 首次打开引导问题(废弃,使用guidQuestionDtos替代)
|
||||
openingGuidQuestions: string[];
|
||||
// 引导问题
|
||||
guidQuestionDtos: GuidQuestionDto[];
|
||||
// 是否开启定时任务,可用值:Open,Close
|
||||
openScheduledTask: OpenCloseEnum;
|
||||
// 参数
|
||||
variables: BindConfigWithSub[];
|
||||
// 分享链接
|
||||
shareLink: string;
|
||||
// 可手动选择的组件列表
|
||||
manualComponents: AgentManualComponentInfo[];
|
||||
// 是否允许复制, 1 允许
|
||||
allowCopy: AllowCopyEnum;
|
||||
// 当前登录用户是否收藏
|
||||
collect: boolean;
|
||||
// 是否默认展开扩展页面区域, 1 展开;0 不展开
|
||||
expandPageArea: ExpandPageAreaEnum;
|
||||
// 是否隐藏聊天区域,1 隐藏;0 不隐藏
|
||||
hideChatArea: HideChatAreaEnum;
|
||||
// 扩展页面首页
|
||||
pageHomeIndex: string;
|
||||
// 智能体类型,ChatBot 问答型;TaskAgent 任务型; PageApp 页面应用智能体,可用值:ChatBot,TaskAgent,PageApp
|
||||
type: AgentTypeEnum;
|
||||
// 是否有权限
|
||||
hasPermission?: boolean;
|
||||
// 允许用户选择自有模型,1 允许
|
||||
allowOtherModel?: DefaultSelectedEnum;
|
||||
// 允许使用@技能, 1 允许
|
||||
allowAtSkill?: DefaultSelectedEnum;
|
||||
// 允许使用私有沙盒, 1 允许
|
||||
allowPrivateSandbox?: DefaultSelectedEnum;
|
||||
}
|
||||
|
||||
// 日志查询过滤条件
|
||||
export interface LogQueryFilter {
|
||||
// 智能体ID
|
||||
agentId: number;
|
||||
|
||||
// 请求ID
|
||||
requestId?: string;
|
||||
|
||||
// 消息ID
|
||||
messageId?: string;
|
||||
|
||||
// 会话ID
|
||||
conversationId?: string;
|
||||
|
||||
// 用户UID
|
||||
userUid?: string;
|
||||
|
||||
// 用户输入,需要支持全文检索,支持多个关键字(AND关系)
|
||||
userInput?: string[];
|
||||
|
||||
// 系统输出,需要支持全文检索,支持多个关键字(AND关系)
|
||||
output?: string[];
|
||||
|
||||
// 开始时间
|
||||
startTime?: string;
|
||||
|
||||
// 结束时间
|
||||
endTime?: string;
|
||||
|
||||
// 租户ID,用于租户隔离,确保只查询特定租户的日志
|
||||
tenantId?: string;
|
||||
|
||||
// 空间ID,可选,用于查询特定空间的日志,支持多个ID(OR关系)
|
||||
spaceId?: string[];
|
||||
}
|
||||
|
||||
// 删除智能体APIKEY输入参数
|
||||
export interface AgentAkDeleteParams {
|
||||
// 智能体ID
|
||||
agentId: number;
|
||||
// APIKEY
|
||||
accessKey: string;
|
||||
}
|
||||
|
||||
// ============ 事件绑定配置类型定义 ============
|
||||
// 事件参数
|
||||
export interface EventArg {
|
||||
// 输入类型
|
||||
inputType?: string;
|
||||
// 参数名称
|
||||
name?: string;
|
||||
// 默认参数值
|
||||
bindValue?: any;
|
||||
}
|
||||
|
||||
// 事件配置
|
||||
export interface EventConfig {
|
||||
// 事件名称
|
||||
name: string;
|
||||
// 事件标识
|
||||
identification: string;
|
||||
// 事件类型,可用值:Page,Link
|
||||
type: EventBindResponseActionEnum;
|
||||
// 页面URL
|
||||
url?: string;
|
||||
// 页面ID
|
||||
pageId?: number;
|
||||
// 页面基础路径
|
||||
basePath?: string;
|
||||
// 页面路径
|
||||
pageUri?: string;
|
||||
// 页面URL
|
||||
pageUrl?: string;
|
||||
// 事件参数
|
||||
args?: EventArg[];
|
||||
// 事件参数JSON模式
|
||||
argJsonSchema?: string;
|
||||
// 页面名称
|
||||
pageName?: string;
|
||||
}
|
||||
|
||||
// 事件绑定配置
|
||||
export interface EventBindConfig {
|
||||
// 事件配置列表
|
||||
eventConfigs: EventConfig[];
|
||||
}
|
||||
|
||||
// 显示页面预览选项
|
||||
export interface ShowPagePreviewOptions {
|
||||
// 页面名称
|
||||
name?: string;
|
||||
// 页面URI
|
||||
uri: string;
|
||||
// 参数
|
||||
params?: any;
|
||||
// 执行ID
|
||||
executeId?: string;
|
||||
|
||||
// 请求方法
|
||||
method?: "browser_navigate_page" | "browser_open_page";
|
||||
// 数据类型
|
||||
data_type?: "html" | "markdown";
|
||||
// 请求ID,用于请求结果回写
|
||||
request_id?: string;
|
||||
}
|
||||
|
||||
// 页面请求结果回写参数
|
||||
export interface ApiAgentConversationChatPageResultParams {
|
||||
// 请求ID
|
||||
requestId: string;
|
||||
// 结果HTML
|
||||
html: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 智能体会话、桌面分享参数
|
||||
*/
|
||||
export interface AgentConversationShareParams {
|
||||
conversationId: number | string;
|
||||
type: string;
|
||||
expireSeconds?: number;
|
||||
content: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 文件节点类型
|
||||
*/
|
||||
export interface FileNode {
|
||||
/** 文件ID(完整路径) */
|
||||
id: string;
|
||||
/** 文件名 */
|
||||
name: string;
|
||||
/** 节点类型 */
|
||||
type: "file" | "folder";
|
||||
/** 文件路径 */
|
||||
path: string;
|
||||
/** 子节点 */
|
||||
children?: FileNode[];
|
||||
/** 是否为二进制文件 */
|
||||
binary?: boolean;
|
||||
/** 文件大小 */
|
||||
size?: number;
|
||||
/** 文件状态 */
|
||||
status?: string | null;
|
||||
/** 完整路径 */
|
||||
fullPath?: string;
|
||||
/** 父路径 */
|
||||
parentPath?: string | null;
|
||||
/** 文件内容 */
|
||||
content?: string;
|
||||
/** 最后修改时间 */
|
||||
lastModified?: number;
|
||||
/** 文件大小是否超限 */
|
||||
sizeExceeded?: boolean;
|
||||
/** 文件代理URL */
|
||||
fileProxyUrl?: string;
|
||||
/** 是否为链接文件 */
|
||||
isLink?: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
* 智能体会话可选模型项
|
||||
*/
|
||||
/** API 信息 */
|
||||
export interface ApiInfo {
|
||||
url: string;
|
||||
key: string;
|
||||
weight: number;
|
||||
}
|
||||
|
||||
export interface AgentModelOption {
|
||||
/** 模型ID */
|
||||
id: number;
|
||||
/** 模型显示名称 */
|
||||
name: string;
|
||||
/** 模型描述 */
|
||||
description: string;
|
||||
/** 租户ID */
|
||||
tenantId: number;
|
||||
/** 空间ID */
|
||||
spaceId: number;
|
||||
/** 作用域 */
|
||||
scope: string;
|
||||
/** 模型标识 */
|
||||
model: string;
|
||||
/** 模型类型 */
|
||||
type: string;
|
||||
/** 是否为推理模型 */
|
||||
isReasonModel: number;
|
||||
/** 网络类型 */
|
||||
networkType: string;
|
||||
/** 函数调用能力 */
|
||||
functionCall: string;
|
||||
/** 最大 Token 数 */
|
||||
maxTokens: number;
|
||||
/** 最大上下文 Token 数 */
|
||||
maxContextTokens: number;
|
||||
/** API 协议 */
|
||||
apiProtocol: string;
|
||||
/** API 信息列表 */
|
||||
apiInfoList: ApiInfo[];
|
||||
/** 策略 */
|
||||
strategy: string;
|
||||
/** 维度 */
|
||||
dimension: number;
|
||||
/** 修改时间 */
|
||||
modified: string;
|
||||
/** 创建时间 */
|
||||
created: string;
|
||||
/** 创建者信息 */
|
||||
creator: CreatorInfo;
|
||||
/** 启用状态 */
|
||||
enabled: number;
|
||||
/** 访问控制 */
|
||||
accessControl: number;
|
||||
/** 使用场景列表 (AgentTypeEnum[]) */
|
||||
usageScenarios: string[];
|
||||
}
|
||||
59
qiming-mobile/types/interfaces/agentConfig.uts
Normal file
59
qiming-mobile/types/interfaces/agentConfig.uts
Normal file
@@ -0,0 +1,59 @@
|
||||
import { AgentComponentTypeEnum } from '../enums/agent';
|
||||
import type {
|
||||
AgentStatisticsInfo,
|
||||
CreatorInfo,
|
||||
} from './agent';
|
||||
|
||||
// 智能体分类信息
|
||||
export interface CategoryInfo {
|
||||
name: string;
|
||||
type: string;
|
||||
}
|
||||
|
||||
// 智能体分类项详细信息
|
||||
export interface CategoryItemInfo {
|
||||
targetType: AgentComponentTypeEnum;
|
||||
targetId: number;
|
||||
name: string;
|
||||
description: string;
|
||||
icon: string;
|
||||
statistics: AgentStatisticsInfo;
|
||||
publishUser: CreatorInfo;
|
||||
collect: boolean;
|
||||
}
|
||||
|
||||
// 主页智能体分类列表
|
||||
export interface HomeAgentCategoryInfo {
|
||||
// 首页分类
|
||||
categories: CategoryInfo[];
|
||||
// 首页分类数据列表
|
||||
categoryItems: {
|
||||
[key: string]: CategoryItemInfo[];
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* 静态文件相关类型定义
|
||||
*/
|
||||
export interface StaticFileInfo {
|
||||
// 文件ID(自定义文件ID)
|
||||
fileId?: string;
|
||||
// 文件名称
|
||||
name: string;
|
||||
// 是否为二进制文件
|
||||
binary: boolean;
|
||||
// 文件大小是否超过限制
|
||||
sizeExceeded: boolean;
|
||||
// 文件内容
|
||||
contents: string;
|
||||
// 文件代理URL
|
||||
fileProxyUrl: string;
|
||||
// 是否为目录
|
||||
isDir: boolean;
|
||||
}
|
||||
|
||||
// 静态文件列表
|
||||
export interface StaticFileListResponse {
|
||||
// 文件列表
|
||||
files: StaticFileInfo[];
|
||||
}
|
||||
34
qiming-mobile/types/interfaces/cardInfo.uts
Normal file
34
qiming-mobile/types/interfaces/cardInfo.uts
Normal file
@@ -0,0 +1,34 @@
|
||||
import type { CardStyleEnum } from '../enums/common';
|
||||
import type { BindCardStyleEnum } from '../enums/plugin';
|
||||
|
||||
// 卡片参数绑定配置信息详情
|
||||
export interface CardArgsBindConfigInfo {
|
||||
// 卡片参数名称key
|
||||
key: string;
|
||||
// 卡片参数引用信息,例如插件的出参 data.xxx
|
||||
bindValue: string;
|
||||
}
|
||||
|
||||
// 卡片绑定配置信息
|
||||
export interface CardBindConfig {
|
||||
cardId: number;
|
||||
cardKey: CardStyleEnum;
|
||||
bindCardStyle: BindCardStyleEnum;
|
||||
maxCardCount: number;
|
||||
bindArray: string;
|
||||
cardArgsBindConfigs: CardArgsBindConfigInfo[];
|
||||
bindLinkUrl: string;
|
||||
}
|
||||
|
||||
// 单张卡片数据
|
||||
export interface CardDataInfo {
|
||||
className?: string;
|
||||
image: string;
|
||||
title: string;
|
||||
content: string;
|
||||
bindLinkUrl: string;
|
||||
// 自定义属性,用于匹配卡片组件
|
||||
cardKey: CardStyleEnum;
|
||||
}
|
||||
|
||||
// 单张卡片
|
||||
67
qiming-mobile/types/interfaces/chat.uts
Normal file
67
qiming-mobile/types/interfaces/chat.uts
Normal file
@@ -0,0 +1,67 @@
|
||||
// 聊天消息类型
|
||||
export interface ChatMessage {
|
||||
id: string
|
||||
role: 'user' | 'assistant' | 'system'
|
||||
content: string
|
||||
timestamp: number
|
||||
status: 'sending' | 'sent' | 'error' | 'processing'
|
||||
error?: string
|
||||
markdownContent?: string
|
||||
rendered?: boolean
|
||||
}
|
||||
|
||||
// 聊天会话类型
|
||||
export interface ChatSession {
|
||||
id: string
|
||||
title: string
|
||||
messages: ChatMessage[]
|
||||
createdAt: number
|
||||
updatedAt: number
|
||||
isActive: boolean
|
||||
}
|
||||
|
||||
// 流式响应块类型
|
||||
export interface StreamChunk {
|
||||
type: 'content' | 'error' | 'done'
|
||||
data: string
|
||||
messageId?: string
|
||||
}
|
||||
|
||||
// Markdown元素类型
|
||||
export interface MarkdownElement {
|
||||
type: 'text' | 'code' | 'table' | 'list' | 'heading' | 'paragraph' | 'link' | 'image' | 'hr' | 'blockquote'
|
||||
content: string
|
||||
language?: string
|
||||
level?: number
|
||||
href?: string
|
||||
alt?: string
|
||||
children?: MarkdownElement[]
|
||||
className?: string
|
||||
}
|
||||
|
||||
// 流式请求配置
|
||||
export interface StreamRequestConfig {
|
||||
url: string
|
||||
method: 'GET' | 'POST'
|
||||
headers?: UTSJSONObject
|
||||
body?: any
|
||||
onChunk?: (chunk: StreamChunk) => void
|
||||
onError?: (error: any) => void
|
||||
onComplete?: () => void
|
||||
onOpen?: (response: any) => void
|
||||
onTimeout?: () => void // 超时回调(微信小程序专用,60秒内无数据流动时触发)
|
||||
}
|
||||
|
||||
// 消息渲染状态
|
||||
export interface MessageRenderState {
|
||||
isRendering: boolean
|
||||
rendered: boolean
|
||||
markdownElements: MarkdownElement[]
|
||||
error?: string
|
||||
}
|
||||
|
||||
// 定义 chat-input-phone 组件的引用类型
|
||||
export interface ChatInputPhoneRef {
|
||||
files: Ref<UploadFileInfo[]>;
|
||||
selectedComponents: Ref<AgentSelectedComponentInfo[]>;
|
||||
}
|
||||
159
qiming-mobile/types/interfaces/common.uts
Normal file
159
qiming-mobile/types/interfaces/common.uts
Normal file
@@ -0,0 +1,159 @@
|
||||
import type {
|
||||
AgentComponentTypeEnum,
|
||||
OptionDataSourceEnum,
|
||||
} from '../enums/agent';
|
||||
import type {
|
||||
BindValueType,
|
||||
InputTypeEnum,
|
||||
UploadFileStatus,
|
||||
} from '../enums/common';
|
||||
import { DataTypeEnum } from '../enums/common';
|
||||
import type {
|
||||
AgentManualComponentInfo,
|
||||
AgentSelectedComponentInfo,
|
||||
} from './agent';
|
||||
|
||||
/**
|
||||
* 定义键值对接口,用于表示具有标签和值的对象。
|
||||
*/
|
||||
export interface KeyValuePairs {
|
||||
// 键值对的标签
|
||||
label: string;
|
||||
// 键值对对应的值
|
||||
value: string;
|
||||
}
|
||||
|
||||
// 级联选项类型
|
||||
export interface CascaderOption {
|
||||
value?: string | number | null;
|
||||
// label?: React.ReactNode;
|
||||
children?: CascaderOption[];
|
||||
disabled?: boolean;
|
||||
disableCheckbox?: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
* 定义 Child 接口,用于描述子节点的数据结构。
|
||||
*/
|
||||
export interface Child {
|
||||
// 子节点标题
|
||||
title: string;
|
||||
// 子节点显示的图像路径
|
||||
// icon: string | React.ReactNode; // 直接使用 SVGProps
|
||||
// 唯一标识符
|
||||
key: string;
|
||||
// 子节点的类型,可能用于区分不同种类的节点
|
||||
type: string;
|
||||
// 节点的内容,可能是纯文本或键值对数组
|
||||
content: string | KeyValuePairs[];
|
||||
// 描述
|
||||
desc?: string;
|
||||
// 节点宽度,可选
|
||||
width?: number;
|
||||
// 节点高度,可选
|
||||
height?: number;
|
||||
// 标记该节点是否可以作为父节点嵌套其他节点,可选
|
||||
isParent?: boolean;
|
||||
// 节点背景颜色,可选
|
||||
backgroundColor?: string;
|
||||
// 没有操作栏
|
||||
noPopover?: boolean;
|
||||
}
|
||||
|
||||
// 插件的单个内容
|
||||
export interface PlugInItem {
|
||||
// 名称
|
||||
label: string;
|
||||
desc: string;
|
||||
id: string;
|
||||
// 子选项
|
||||
children: PlugInItem[];
|
||||
}
|
||||
|
||||
// 上传文件信息
|
||||
export interface UploadFileInfo {
|
||||
url: string;
|
||||
name: string;
|
||||
type: string;
|
||||
key?: string;
|
||||
size: number;
|
||||
width?: number;
|
||||
height?: number;
|
||||
percent?: number;
|
||||
status?: UploadFileStatus;
|
||||
uid?: string;
|
||||
response?: any;
|
||||
}
|
||||
|
||||
// 查询特定数量输入参数
|
||||
export interface ListParams {
|
||||
size: number;
|
||||
pageIndex?: number;
|
||||
// 关键字搜索
|
||||
keyword?: string;
|
||||
}
|
||||
|
||||
// 手动选择组件属性
|
||||
export interface ManualComponentItemProps {
|
||||
// 可手动选择的组件列表
|
||||
manualComponents?: AgentManualComponentInfo[];
|
||||
selectedComponentList?: AgentSelectedComponentInfo[];
|
||||
onSelectComponent?: (infos: AgentSelectedComponentInfo) => void;
|
||||
}
|
||||
|
||||
// 变量下拉参数配置
|
||||
export interface VariableSelectConfig {
|
||||
// 数据源类型,可用值:MANUAL,PLUGIN
|
||||
dataSourceType: OptionDataSourceEnum;
|
||||
// 数据源类型,可用值:Agent,Plugin,Workflow,Knowledge,Table
|
||||
targetType: AgentComponentTypeEnum;
|
||||
// 插件或工作流ID,dataSource选择PLUGIN时有用
|
||||
targetId: number;
|
||||
// 插件或工作流名称
|
||||
targetName: string;
|
||||
// 插件或工作流描述
|
||||
targetDescription: string;
|
||||
// 插件或工作流图标
|
||||
targetIcon: string;
|
||||
// 下拉选项配置
|
||||
options: CascaderOption[];
|
||||
}
|
||||
|
||||
export interface BindConfigWithSub {
|
||||
// key: React.Key;
|
||||
// 参数名称,符合函数命名规则
|
||||
name: string;
|
||||
// 参数展示名称,供前端展示使用
|
||||
displayName: string;
|
||||
// 参数详细描述信息
|
||||
description: string;
|
||||
// 数据类型
|
||||
dataType?: DataTypeEnum;
|
||||
// 是否必须
|
||||
require?: boolean;
|
||||
// 是否为开启,如果不开启,插件使用者和大模型均看不见该参数;如果bindValueType为空且require为true时,该参数必须开启
|
||||
enable?: boolean;
|
||||
// 是否为系统内置变量参数,内置变量前端只可展示不可修改
|
||||
systemVariable?: boolean;
|
||||
// 值引用类型,Input 输入;Reference 变量引用,可用值:Input,Reference
|
||||
bindValueType?: BindValueType;
|
||||
// 参数值,当类型为引用时,示例 1.xxx 绑定节点ID为1的xxx字段;当类型为输入时,该字段为最终使用的值
|
||||
bindValue?: string;
|
||||
// 输入类型, Http插件有用,可用值:Query,Body,Header,Path
|
||||
inputType?: InputTypeEnum;
|
||||
subArgs?: BindConfigWithSub[];
|
||||
// 下拉参数配置
|
||||
selectConfig?: VariableSelectConfig;
|
||||
loopId?: number;
|
||||
children?: BindConfigWithSub[];
|
||||
[key: string]: any;
|
||||
}
|
||||
|
||||
// 菜单列表项
|
||||
export interface MenuListItem {
|
||||
label: string;
|
||||
value: string | number | null;
|
||||
icon?: string | null;
|
||||
disabled?: boolean;
|
||||
onClick?: (value: string | number | null) => void;
|
||||
}
|
||||
382
qiming-mobile/types/interfaces/conversationInfo.uts
Normal file
382
qiming-mobile/types/interfaces/conversationInfo.uts
Normal file
@@ -0,0 +1,382 @@
|
||||
import type {
|
||||
AssistantRoleEnum,
|
||||
ConversationEventTypeEnum,
|
||||
MessageModeEnum,
|
||||
MessageTypeEnum,
|
||||
TaskStatus,
|
||||
TaskTypeEnum,
|
||||
} from "../enums/agent";
|
||||
import { AgentComponentTypeEnum } from "../enums/agent";
|
||||
import type { MessageStatusEnum } from "../enums/common";
|
||||
import { ProcessingEnum } from "../enums/common";
|
||||
import type { OpenCloseEnum } from "../enums/space";
|
||||
import type {
|
||||
AgentCardInfo,
|
||||
AgentManualComponentInfo,
|
||||
AgentSelectedComponentInfo,
|
||||
AgentStatisticsInfo,
|
||||
CreatorInfo,
|
||||
} from "./agent";
|
||||
import { CardBindConfig, CardDataInfo } from "./cardInfo";
|
||||
import type { BindConfigWithSub } from "./common";
|
||||
import type { UploadFileStatus } from "@/types/enums/common.uts";
|
||||
import type { UploadFileInfo } from "./common";
|
||||
|
||||
// 会话聊天消息
|
||||
export interface ConversationChatMessage {
|
||||
attachments?: AttachmentFile[];
|
||||
ext: string;
|
||||
// 是否完成
|
||||
finished: boolean;
|
||||
// 唯一标识
|
||||
id: string;
|
||||
// 可用值:USER,ASSISTANT,SYSTEM,TOOL
|
||||
messageType: MessageTypeEnum;
|
||||
metadata: object;
|
||||
// assistant 模型回复;user 用户消息,可用值:USER,ASSISTANT,SYSTEM,FUNCTION
|
||||
role: AssistantRoleEnum;
|
||||
text: string;
|
||||
think: string;
|
||||
time: number;
|
||||
// 可用值:CHAT,GUID,QUESTION,ANSWER
|
||||
type: MessageModeEnum;
|
||||
}
|
||||
|
||||
// 会话调用插件、工作流等的过程数据
|
||||
export interface ProcessingData {
|
||||
targetId: number;
|
||||
name: string;
|
||||
type: AgentComponentTypeEnum;
|
||||
status: ProcessingEnum;
|
||||
result: {
|
||||
id: number;
|
||||
name: string;
|
||||
type: AgentComponentTypeEnum;
|
||||
success: boolean;
|
||||
error: string;
|
||||
data: unknown;
|
||||
startTime: number;
|
||||
endTime: number;
|
||||
input: {
|
||||
query: string;
|
||||
};
|
||||
};
|
||||
// 卡片绑定配置信息
|
||||
cardBindConfig: CardBindConfig;
|
||||
// 卡片数据
|
||||
cardData: CardDataInfo[] | CardDataInfo;
|
||||
}
|
||||
|
||||
// 调试结果
|
||||
export interface ExecuteResultInfo {
|
||||
data: unknown;
|
||||
error: string;
|
||||
id: number;
|
||||
icon: string;
|
||||
// 可能是字符串,也可能是object,需要根据具体情况处理
|
||||
input: unknown;
|
||||
name: string;
|
||||
startTime: number;
|
||||
endTime: number;
|
||||
success: boolean;
|
||||
type: AgentComponentTypeEnum;
|
||||
}
|
||||
|
||||
// 会话聊天"FINAL_RESULT", 用于会话底部显示时间
|
||||
export interface ConversationFinalResult {
|
||||
completionTokens: number;
|
||||
componentExecuteResults: ExecuteResultInfo[];
|
||||
endTime: number;
|
||||
error: string;
|
||||
outputText: string;
|
||||
promptTokens: number;
|
||||
startTime: number;
|
||||
success: boolean;
|
||||
totalTokens: number;
|
||||
}
|
||||
|
||||
// 会话聊天响应数据
|
||||
export interface ConversationChatResponse {
|
||||
completed: boolean;
|
||||
data:
|
||||
| ConversationChatMessage
|
||||
| ConversationFinalResult
|
||||
| ProcessingData
|
||||
| any;
|
||||
error: string;
|
||||
eventType: ConversationEventTypeEnum;
|
||||
requestId: string;
|
||||
}
|
||||
|
||||
// 附加文件信息
|
||||
export interface AttachmentFile {
|
||||
fileKey: string;
|
||||
// 文件URL
|
||||
fileUrl: string;
|
||||
// 文件名
|
||||
fileName: string;
|
||||
// 文件类型
|
||||
mimeType: string;
|
||||
// 文件大小
|
||||
fileSize: number;
|
||||
}
|
||||
|
||||
// 会话参数
|
||||
export interface ConversationChatParams {
|
||||
// 会话唯一标识
|
||||
conversationId: number;
|
||||
// 变量参数,前端需要根据agent配置组装参数
|
||||
variableParams?: { [key: string]: string | number };
|
||||
// chat消息
|
||||
message: string;
|
||||
// 附件列表
|
||||
attachments: AttachmentFile[];
|
||||
// 是否调试模式
|
||||
debug: boolean;
|
||||
selectedComponents: AgentSelectedComponentInfo[];
|
||||
sandboxId?: string;
|
||||
skillIds?: number[];
|
||||
}
|
||||
|
||||
// 临时会话参数
|
||||
export interface TempConversationChatParams {
|
||||
// 链接Key
|
||||
chatKey: string;
|
||||
// 会话唯一标识
|
||||
conversationUid: string;
|
||||
variableParams?: { [key: string]: string | number };
|
||||
// chat消息
|
||||
message: string;
|
||||
// 附件列表
|
||||
attachments: AttachmentFile[];
|
||||
selectedComponents: AgentSelectedComponentInfo[];
|
||||
skillIds?: number[];
|
||||
}
|
||||
|
||||
// 智能体会话问题建议输入参数
|
||||
export interface ConversationChatSuggestParams extends ConversationChatParams {
|
||||
// 变量参数,前端需要根据agent配置组装参数
|
||||
variableParams?: {
|
||||
[key: string]: any;
|
||||
};
|
||||
}
|
||||
|
||||
// 创建会话输入参数
|
||||
export interface ConversationCreateParams {
|
||||
// 智能体ID
|
||||
agentId: number;
|
||||
// 开发模式
|
||||
devMode: boolean;
|
||||
variableParams?: { [key: string]: string | number };
|
||||
}
|
||||
|
||||
// 消息查询过程信息
|
||||
export interface ProcessingInfo {
|
||||
executeId?: string;
|
||||
cardBindConfig: AgentCardInfo;
|
||||
name: string;
|
||||
result: ExecuteResultInfo;
|
||||
status: ProcessingEnum;
|
||||
targetId: number;
|
||||
type: AgentComponentTypeEnum;
|
||||
}
|
||||
|
||||
// 消息问答扩展信息
|
||||
export interface MessageQuestionExtInfo {
|
||||
uuid: string;
|
||||
index: string;
|
||||
content: string;
|
||||
nextNodeIds: string;
|
||||
}
|
||||
|
||||
// 会话消息列表,会话列表查询时不会返回该字段值
|
||||
export interface ChatMessageDto {
|
||||
// 消息ID
|
||||
id: number | string;
|
||||
// assistant 模型回复;user 用户消息,可用值:USER,ASSISTANT,SYSTEM,FUNCTION
|
||||
role: AssistantRoleEnum;
|
||||
// 可用值:CHAT,THINK,GUID,QUESTION,ANSWER
|
||||
type?: MessageModeEnum;
|
||||
// 消息内容,其中附件放在.*?标签中
|
||||
text?: string;
|
||||
// 思考内容
|
||||
think?: string;
|
||||
// 消息时间
|
||||
time: string;
|
||||
// 消息附件
|
||||
attachments?: AttachmentFile[];
|
||||
// 消息问答扩展信息
|
||||
ext?: MessageQuestionExtInfo[];
|
||||
finished?: boolean;
|
||||
metadata?: unknown;
|
||||
// 可用值:USER,ASSISTANT,SYSTEM,TOOL
|
||||
messageType: MessageTypeEnum;
|
||||
// 请求ID
|
||||
requestId?: string;
|
||||
}
|
||||
|
||||
// 消息markdown元素
|
||||
export type markdownElItem = {
|
||||
uniqueId: string;
|
||||
type: string;
|
||||
datasList: any[][];
|
||||
};
|
||||
|
||||
// 会话消息信息
|
||||
export interface MessageInfo extends ChatMessageDto {
|
||||
// 消息索引(分页游标,用于加载更多历史消息)
|
||||
index?: number;
|
||||
// 消息状态,可选值为 loading | incomplete | complete | error
|
||||
status?: MessageStatusEnum | null;
|
||||
// 自定义添加字段:chat 会话结果
|
||||
finalResult?: ConversationFinalResult;
|
||||
// 消息查询过程信息
|
||||
processingList?: ProcessingInfo[];
|
||||
// 消息markdown元素
|
||||
markdownElList?: markdownElItem[];
|
||||
}
|
||||
|
||||
// 查询会话信息
|
||||
export interface ConversationInfo {
|
||||
// 会话ID
|
||||
id: number;
|
||||
tenantId: number;
|
||||
userId: number;
|
||||
// 会话UUID
|
||||
uid: string;
|
||||
// 智能体ID
|
||||
agentId: number;
|
||||
// 沙盒服务ID
|
||||
sandboxServerId?: string;
|
||||
// 会话主题
|
||||
topic: string;
|
||||
// 会话摘要,当开启长期记忆时,会对每次会话进行总结
|
||||
summary: string;
|
||||
modified: string;
|
||||
created: string;
|
||||
variables?: {
|
||||
[key: string]: string | number;
|
||||
};
|
||||
// Agent信息,已发布过的agent才有此信息
|
||||
agent: {
|
||||
spaceId: number;
|
||||
// 目标对象(智能体、工作流、插件)ID,可用值:Agent,Plugin,Workflow,Knowledge
|
||||
targetType: string;
|
||||
// 目标对象(智能体、工作流、插件)ID
|
||||
targetId: number;
|
||||
// 发布名称
|
||||
name: string;
|
||||
// 描述
|
||||
description: string;
|
||||
// 图标
|
||||
icon: string;
|
||||
// 可手动选择的组件列表
|
||||
manualComponents: AgentManualComponentInfo[];
|
||||
// 发布备注信息
|
||||
remark: string;
|
||||
// 智能体发布时间
|
||||
publishDate: string;
|
||||
// 智能体发布修改时间
|
||||
modified: string;
|
||||
// 智能体发布创建时间
|
||||
created: string;
|
||||
// 统计信息(智能体、插件、工作流相关的统计都在该结构里,根据实际情况取值)
|
||||
statistics: AgentStatisticsInfo;
|
||||
// 发布者信息
|
||||
publishUser: CreatorInfo;
|
||||
// 智能体分类名称
|
||||
category: string;
|
||||
// 是否开启问题建议,可用值:Open,Close
|
||||
openSuggest: OpenCloseEnum;
|
||||
// 开场白文案
|
||||
openingChatMsg: string;
|
||||
// 引导问题
|
||||
openingGuidQuestions: string[];
|
||||
// 是否开启定时任务,可用值:Open,Close
|
||||
openScheduledTask: OpenCloseEnum;
|
||||
variables: BindConfigWithSub[];
|
||||
// 分享链接
|
||||
shareLink: string;
|
||||
collect: boolean;
|
||||
paymentRequired?: boolean;
|
||||
subscribed?: boolean;
|
||||
overCallLimit?: boolean;
|
||||
};
|
||||
// 会话消息列表,会话列表查询时不会返回该字段值
|
||||
messageList: MessageInfo[];
|
||||
// 可用值:Chat,TASK
|
||||
type: TaskTypeEnum;
|
||||
taskId: string;
|
||||
// 可用值:EXECUTING,CANCEL
|
||||
taskStatus: TaskStatus;
|
||||
taskCron: string;
|
||||
taskCronDesc: string;
|
||||
// 开发模式
|
||||
devMode: boolean;
|
||||
}
|
||||
|
||||
// 查询用户历史会话输入参数
|
||||
export interface ConversationListParams {
|
||||
agentId: number | null;
|
||||
}
|
||||
|
||||
// 聊天用户信息
|
||||
export interface ChatUserInfo {
|
||||
name: string;
|
||||
avatar: string;
|
||||
}
|
||||
|
||||
// 角色信息
|
||||
export interface RoleInfo {
|
||||
user?: ChatUserInfo;
|
||||
assistant: ChatUserInfo;
|
||||
system: ChatUserInfo;
|
||||
}
|
||||
|
||||
// 聊天框组件
|
||||
export interface ChatViewProps {
|
||||
className?: string;
|
||||
contentClassName?: string;
|
||||
// 消息信息
|
||||
messageInfo: MessageInfo;
|
||||
// 角色信息
|
||||
roleInfo: RoleInfo;
|
||||
// 聊天框底部样式 none: 不显示底部 home: 聊天主页底部 chat: 智能体编排页底部
|
||||
mode?: "none" | "home" | "chat";
|
||||
}
|
||||
|
||||
// 卡片信息
|
||||
export interface CardInfo {
|
||||
image: string;
|
||||
title: string;
|
||||
content: string;
|
||||
// 卡片key值
|
||||
cardKey: string;
|
||||
// 跳转url
|
||||
bindLinkUrl: string;
|
||||
}
|
||||
|
||||
// 聊天框底部更多操作组件
|
||||
export interface ChatSampleBottomProps {
|
||||
messageInfo: MessageInfo;
|
||||
}
|
||||
|
||||
// 打开应用参数 (独立会话中,用户自定义传入的参数,例如: path?id=1596&con)
|
||||
export interface OpenAppParams {
|
||||
// 会话唯一标识
|
||||
conversationId?: number;
|
||||
// 消息
|
||||
message?: string;
|
||||
// 文件
|
||||
files: UploadFileInfo[];
|
||||
// 已选择组件工具
|
||||
selectedComponents: AgentSelectedComponentInfo[];
|
||||
// 已选择技能
|
||||
skillIds?: number[];
|
||||
// 已选择模型
|
||||
modelId?: number;
|
||||
// 已选择沙盒
|
||||
sandboxId?: string;
|
||||
// 变量参数
|
||||
variableParams?: Record<string, unknown>
|
||||
}
|
||||
19
qiming-mobile/types/interfaces/i18n.uts
Normal file
19
qiming-mobile/types/interfaces/i18n.uts
Normal file
@@ -0,0 +1,19 @@
|
||||
export interface I18nLangDto {
|
||||
id: number;
|
||||
name: string;
|
||||
lang: string;
|
||||
status: number;
|
||||
isDefault: number;
|
||||
sort: number;
|
||||
modified: string;
|
||||
created: string;
|
||||
}
|
||||
|
||||
export interface I18nState {
|
||||
currentLang: string;
|
||||
langMap: Record<string, string>;
|
||||
langList: I18nLangDto[];
|
||||
loaded: boolean;
|
||||
loading: boolean;
|
||||
}
|
||||
|
||||
284
qiming-mobile/types/interfaces/login.uts
Normal file
284
qiming-mobile/types/interfaces/login.uts
Normal file
@@ -0,0 +1,284 @@
|
||||
import type { RoleEnum, UserStatus } from "../enums/common";
|
||||
import type { SendCodeEnum } from "../enums/login";
|
||||
|
||||
// 账号密码登录请求参数
|
||||
export type LoginFieldType = {
|
||||
phoneOrEmail: string;
|
||||
areaCode: string;
|
||||
password?: string;
|
||||
captchaVerifyParam?: string;
|
||||
};
|
||||
|
||||
// 微信登录请求参数
|
||||
export type WechatLoginParams = {
|
||||
code: string;
|
||||
};
|
||||
|
||||
// 微信登录响应数据
|
||||
export interface IWechatLoginResult<T = any> {
|
||||
code: string; // 业务码
|
||||
displayCode: string; // 展示用业务码
|
||||
message: string; // 返回信息
|
||||
data: T | null; // 泛型数据
|
||||
tid: string; // Trace ID
|
||||
success: boolean; // 是否成功
|
||||
}
|
||||
|
||||
// 登录响应数据
|
||||
export interface ILoginResult {
|
||||
token: string;
|
||||
expireDate: string;
|
||||
resetPass: number;
|
||||
redirect: string | null;
|
||||
}
|
||||
|
||||
// 发送验证码
|
||||
export interface SendCode {
|
||||
type: SendCodeEnum;
|
||||
captchaVerifyParam?: string;
|
||||
phone?: string;
|
||||
email?: string;
|
||||
// 验证票据
|
||||
ticket?: string;
|
||||
}
|
||||
|
||||
// 验证码登录请求参数
|
||||
export interface CodeLogin {
|
||||
phone: string;
|
||||
code: string;
|
||||
}
|
||||
|
||||
// 首次登录设置密码
|
||||
export interface SetPasswordParams {
|
||||
password: string;
|
||||
}
|
||||
|
||||
// 设置密码
|
||||
|
||||
// 绑定邮箱输入参数
|
||||
export interface BindEmailParams {
|
||||
email?: string;
|
||||
phone?: string;
|
||||
code: string;
|
||||
}
|
||||
|
||||
// 更新用户信息
|
||||
export interface UserUpdateParams {
|
||||
userName: string;
|
||||
nickName: string;
|
||||
avatar: string;
|
||||
}
|
||||
|
||||
// 重置密码
|
||||
export interface ResetPasswordParams {
|
||||
newPassword: string;
|
||||
code: string;
|
||||
}
|
||||
|
||||
// 重置密码form
|
||||
|
||||
export interface UserInfo {
|
||||
id: number;
|
||||
tenantId: number;
|
||||
userName: string;
|
||||
nickName: string;
|
||||
lang?: string;
|
||||
avatar: string;
|
||||
password: string;
|
||||
// 判断用户是否设置过密码,如果未设置过,需要弹出密码设置框让用户设置密码
|
||||
resetPass: number;
|
||||
// 用户状态
|
||||
status: UserStatus;
|
||||
role: RoleEnum;
|
||||
email: string;
|
||||
phone: string;
|
||||
lastLoginTime: string;
|
||||
created: string;
|
||||
modified: string;
|
||||
}
|
||||
|
||||
// 滑动验证码弹窗类型
|
||||
|
||||
// 租户配置信息
|
||||
export interface TenantConfigInfo {
|
||||
workflowPublishAudit?: number;
|
||||
/*站点名称 */
|
||||
siteName: string;
|
||||
|
||||
/* */
|
||||
siteUrl: string;
|
||||
|
||||
/*站点描述 */
|
||||
siteDescription: string;
|
||||
|
||||
/*站点LOGO,为空使用现有默认的 */
|
||||
siteLogo: string;
|
||||
|
||||
/* */
|
||||
faviconUrl: string;
|
||||
|
||||
/*登录页banner */
|
||||
loginBanner: string;
|
||||
|
||||
/*登录页banner文案 */
|
||||
loginBannerText: string;
|
||||
|
||||
/*广场Banner地址,为空使用现有默认的 */
|
||||
squareBanner: string;
|
||||
|
||||
/*广场Banner文案标题 */
|
||||
squareBannerText: string;
|
||||
|
||||
/*广场Banner文案副标题 */
|
||||
squareBannerSubText: string;
|
||||
|
||||
/*广场Banner链接,如果链接不为空,点击跳转 */
|
||||
squareBannerLinkUrl: string;
|
||||
|
||||
/*开启注册, 0 关闭;1 开启,如果为0,前端不展示注册入口 */
|
||||
openRegister: number;
|
||||
|
||||
/*默认会话模型 */
|
||||
defaultChatModelId: number;
|
||||
|
||||
/*默认嵌入模型 */
|
||||
defaultEmbedModelId: number;
|
||||
|
||||
/*默认知识库模型 */
|
||||
defaultKnowledgeModelId: number;
|
||||
|
||||
/*默认站点Agent */
|
||||
defaultAgentId: number;
|
||||
|
||||
/*首页会话框下的推荐问题 */
|
||||
homeRecommendQuestions: string[] | null;
|
||||
|
||||
// /*官方智能体配置 */
|
||||
// officialAgentIds: Record<string, unknown>[];
|
||||
|
||||
/*官方用户名 */
|
||||
officialUserName: string;
|
||||
|
||||
/*站点域名 */
|
||||
// domainNames: Record<string, unknown>[];
|
||||
|
||||
/* */
|
||||
casClientHostUrl: string;
|
||||
|
||||
/* */
|
||||
casValidateUrl: string;
|
||||
|
||||
/* */
|
||||
casLoginUrl: string;
|
||||
|
||||
/* */
|
||||
authType: number;
|
||||
|
||||
/* */
|
||||
agentPublishAudit: number;
|
||||
|
||||
/* */
|
||||
pluginPublishAudit: number;
|
||||
|
||||
/* */
|
||||
// userWhiteList: Record<string, unknown>[];
|
||||
|
||||
/* */
|
||||
codeSafeCheckPrompt: string | null;
|
||||
|
||||
/* */
|
||||
openCodeSafeCheck: number;
|
||||
|
||||
/* */
|
||||
globalSystemPrompt: string | null;
|
||||
|
||||
/* */
|
||||
smtpHost: string | null;
|
||||
|
||||
/* */
|
||||
smtpPort: number | null;
|
||||
|
||||
/* */
|
||||
smtpUsername: string | null;
|
||||
|
||||
/* */
|
||||
smtpPassword: string | null;
|
||||
|
||||
/* */
|
||||
smsAccessKeyId: string | null;
|
||||
|
||||
/* */
|
||||
smsAccessKeySecret: string | null;
|
||||
|
||||
/* */
|
||||
smsSignName: string | null;
|
||||
|
||||
/* */
|
||||
smsTemplateCode: string | null;
|
||||
|
||||
/* */
|
||||
authExpire: number;
|
||||
|
||||
/* */
|
||||
openCaptcha: number;
|
||||
|
||||
/* */
|
||||
captchaAccessKeyId: string | null;
|
||||
|
||||
/* */
|
||||
captchaAccessKeySecret: string | null;
|
||||
|
||||
/* */
|
||||
captchaPrefix: string;
|
||||
|
||||
/* */
|
||||
captchaSceneId: string;
|
||||
|
||||
// ==================== 新增字段 ====================
|
||||
tenantId?: number;
|
||||
siteConfigUrl?: string | null;
|
||||
loginPageText?: string;
|
||||
loginPageSubText?: string;
|
||||
defaultSummaryModelId?: number | null;
|
||||
defaultSuggestModelId?: number | null;
|
||||
defaultTaskAgentId?: number;
|
||||
defaultAgentIds?: number[] | null;
|
||||
recommendAgentIds?: number[] | null;
|
||||
officialAgentIds?: number[] | null;
|
||||
domainNames?: string[] | null;
|
||||
maxFileSize?: string;
|
||||
casUserAttributesConfig?: string;
|
||||
skillPublishAudit?: number;
|
||||
userWhiteList?: string[] | null;
|
||||
pageFooterText?: string;
|
||||
allowAgentTempChat?: number;
|
||||
allowAgentApi?: number;
|
||||
allowMcpExport?: number;
|
||||
version?: string;
|
||||
templateConfig?: string;
|
||||
homeSlogan?: string;
|
||||
defaultCodingModelId?: number;
|
||||
defaultVisualModelId?: number;
|
||||
mpAppId?: string | null;
|
||||
mpAppSecret?: string | null;
|
||||
sandboxConfig?: string | null;
|
||||
enabledSandbox?: boolean;
|
||||
supportCustomDomain?: boolean;
|
||||
userComputerDefaultSkillIds?: string;
|
||||
officialPluginIds?: string;
|
||||
officialWorkflowIds?: string;
|
||||
officialSkillIds?: string;
|
||||
revenueRatio?: number;
|
||||
paymentGateway?: string;
|
||||
enableSubscription?: number;
|
||||
creditExchangeRate?: number;
|
||||
creditExchangeDesc?: string;
|
||||
enableGiftCredit?: number;
|
||||
giftCreditAmount?: number;
|
||||
giftCreditExpire?: number;
|
||||
enableDailyGiftCredit?: number;
|
||||
dailyGiftCreditAmount?: number;
|
||||
commercialEdition?: boolean;
|
||||
}
|
||||
|
||||
// 设置用户账号信息
|
||||
11
qiming-mobile/types/interfaces/radio.uts
Normal file
11
qiming-mobile/types/interfaces/radio.uts
Normal file
@@ -0,0 +1,11 @@
|
||||
/**
|
||||
* 通用单选列表项接口
|
||||
*/
|
||||
export interface RadioListItem {
|
||||
label: string;
|
||||
value: string;
|
||||
desc?: string;
|
||||
tag?: string;
|
||||
disabled?: boolean;
|
||||
warningDesc?: boolean;
|
||||
}
|
||||
97
qiming-mobile/types/interfaces/request.uts
Normal file
97
qiming-mobile/types/interfaces/request.uts
Normal file
@@ -0,0 +1,97 @@
|
||||
export interface RequestResponse<T> {
|
||||
code: string;
|
||||
displayCode: string;
|
||||
message: string;
|
||||
data: T;
|
||||
debugInfo: object;
|
||||
success: boolean;
|
||||
tid: string;
|
||||
}
|
||||
|
||||
// 排序字段信息,可空,一般没有默认为创建时间排序
|
||||
export interface Sort {
|
||||
column: string;
|
||||
asc: boolean;
|
||||
}
|
||||
|
||||
// 分页响应数据
|
||||
export interface Page<T> {
|
||||
records: T[];
|
||||
total: number;
|
||||
size: number;
|
||||
current: number;
|
||||
pages: number;
|
||||
orders: Sort[];
|
||||
optimizeCountSql: boolean;
|
||||
searchCount: boolean;
|
||||
optimizeJoinOfCountSql: boolean;
|
||||
maxLimit: number;
|
||||
countId: string;
|
||||
}
|
||||
|
||||
// 表格列扩展配置
|
||||
export interface TableExtInfo {
|
||||
// 列固定位置
|
||||
fixed: string;
|
||||
// 是否可见
|
||||
visible: boolean;
|
||||
// 子标签
|
||||
subLabel: string;
|
||||
// 列宽度
|
||||
width: string;
|
||||
// 最小宽度
|
||||
minWidth: string;
|
||||
// 是否可设置
|
||||
settable: boolean;
|
||||
// 对齐方式
|
||||
align: string;
|
||||
// 格式化器
|
||||
formatter: string;
|
||||
// 提示信息
|
||||
tips: string;
|
||||
// 是否省略
|
||||
ellipsis: boolean;
|
||||
}
|
||||
|
||||
// 表格列信息
|
||||
export interface SuperTableColumn {
|
||||
// 序号
|
||||
serialNumber: number;
|
||||
// 列标签
|
||||
label: string;
|
||||
// 列名称
|
||||
name: string;
|
||||
// 是否可排序
|
||||
sortable: boolean;
|
||||
// 提示信息
|
||||
tips: string;
|
||||
// 扩展配置
|
||||
ext: TableExtInfo;
|
||||
}
|
||||
|
||||
// table分页请求基础信息
|
||||
export interface TablePageRequest<T> {
|
||||
queryFilter: T;
|
||||
// 当前页,示例值(1)
|
||||
current: number;
|
||||
// 分页pageSize,示例值(10)
|
||||
pageSize: number;
|
||||
// 排序字段信息,可空,一般没有默认为创建时间排序
|
||||
orders: Sort[];
|
||||
// 列的筛选条件,可空
|
||||
filters: {
|
||||
column: string;
|
||||
operator: string;
|
||||
value: object;
|
||||
}[];
|
||||
// 表格的列信息,可空
|
||||
columns: {
|
||||
serialNumber: number;
|
||||
label: string;
|
||||
name: string;
|
||||
sortable: boolean;
|
||||
tips: string;
|
||||
ext: TableExtInfo;
|
||||
children: SuperTableColumn[];
|
||||
}[];
|
||||
}
|
||||
10
qiming-mobile/types/interfaces/sandbox.uts
Normal file
10
qiming-mobile/types/interfaces/sandbox.uts
Normal file
@@ -0,0 +1,10 @@
|
||||
export interface SandboxInfo {
|
||||
sandboxId: string;
|
||||
name: string;
|
||||
description: string;
|
||||
}
|
||||
|
||||
export interface SandboxListResponse {
|
||||
sandboxes: SandboxInfo[];
|
||||
agentSelected: { [key: string]: string }; // agentId: sandboxId
|
||||
}
|
||||
59
qiming-mobile/types/interfaces/skill.uts
Normal file
59
qiming-mobile/types/interfaces/skill.uts
Normal file
@@ -0,0 +1,59 @@
|
||||
import type { AgentStatisticsInfo, CreatorInfo } from './agent';
|
||||
|
||||
// 已收藏的技能列表接口 - 参数接口
|
||||
export interface SkillListForAtParams {
|
||||
/*目标类型,Agent,Plugin,Workflow,可用值:Agent,Plugin,Workflow,Knowledge,Table,Skill */
|
||||
targetType?: string;
|
||||
|
||||
/*子类型,可用值:Multi,Single,WorkflowChat,ChatBot,TaskAgent,Agent,PageApp */
|
||||
targetSubType?: string;
|
||||
|
||||
/*页码 */
|
||||
page?: number;
|
||||
|
||||
/*每页数量 */
|
||||
pageSize?: number;
|
||||
|
||||
/*分类名称 */
|
||||
category?: string;
|
||||
|
||||
/*关键字搜索 */
|
||||
kw?: string;
|
||||
|
||||
/*空间ID(可选)需要通过空间过滤时有用 */
|
||||
spaceId?: number;
|
||||
|
||||
/*只返回空间的组件 */
|
||||
justReturnSpaceData?: boolean;
|
||||
|
||||
/*访问控制过滤,0 无需过滤,1 过滤出需要权限管控的内容 */
|
||||
accessControl?: number;
|
||||
|
||||
/*是否只返回官方标识的内容 */
|
||||
official?: boolean;
|
||||
}
|
||||
|
||||
// 技能信息
|
||||
export interface SkillInfoForAt {
|
||||
id: number;
|
||||
tenantId: number;
|
||||
spaceId: number;
|
||||
targetType: string;
|
||||
targetId: number;
|
||||
name: string;
|
||||
description: string;
|
||||
icon: string;
|
||||
remark: string;
|
||||
modified: string;
|
||||
created: string;
|
||||
statistics: AgentStatisticsInfo;
|
||||
publishUser: CreatorInfo;
|
||||
category: string;
|
||||
allowCopy: number;
|
||||
accessControl: number;
|
||||
pluginType: string;
|
||||
agentType: string;
|
||||
coverImg: string;
|
||||
coverImgSourceType: string;
|
||||
collect: boolean;
|
||||
}
|
||||
77
qiming-mobile/types/interfaces/square.uts
Normal file
77
qiming-mobile/types/interfaces/square.uts
Normal file
@@ -0,0 +1,77 @@
|
||||
import { AgentComponentTypeEnum, AllowCopyEnum } from '../enums/agent';
|
||||
import { PluginTypeEnum } from '../enums/plugin';
|
||||
import type { SquareAgentTypeEnum } from '../enums/square';
|
||||
import type {
|
||||
AgentStatisticsInfo,
|
||||
CreatorInfo,
|
||||
} from './agent';
|
||||
|
||||
// 广场 - 已发布列表请求参数
|
||||
export interface SquarePublishedListParams {
|
||||
// 目标类型,Agent,Plugin,Workflow,可用值:Agent,Plugin,Workflow,Knowledge,Table
|
||||
targetType: AgentComponentTypeEnum;
|
||||
// 页码,从1开始
|
||||
page: number;
|
||||
// 每页数量
|
||||
pageSize: number;
|
||||
// 分类名称
|
||||
category: string;
|
||||
// 关键字搜索
|
||||
kw?: string;
|
||||
// 空间ID(可选)需要通过空间过滤时有用
|
||||
spaceId?: number;
|
||||
// 只返回空间的组件
|
||||
justReturnSpaceData?: boolean;
|
||||
// 空间ID列表(可选),查询用户有权限的空间,限制访问空间,比如工作流查询全部知识库,要限制用户有权限的空间下的知识库
|
||||
authSpaceIds?: number[];
|
||||
// 允许复制过滤(模板),1 允许
|
||||
allowCopy?: AllowCopyEnum;
|
||||
}
|
||||
|
||||
// 广场-已发布的组件单项信息
|
||||
export interface SquarePublishedItemInfo {
|
||||
// 发布ID
|
||||
id: number;
|
||||
tenantId: number;
|
||||
spaceId: number;
|
||||
// 目标对象(智能体、工作流、插件)ID,可用值:Agent,Plugin,Workflow,KNOWLEDGE
|
||||
targetType: SquareAgentTypeEnum;
|
||||
// 目标对象(智能体、工作流、插件)类型,可用值:ChatBot,PageApp
|
||||
agentType: 'ChatBot' | 'PageApp';
|
||||
// 目标对象(智能体、工作流、插件)ID
|
||||
targetId: number;
|
||||
// 发布名称
|
||||
name: string;
|
||||
// 描述
|
||||
description?: string | null;
|
||||
// 图标
|
||||
icon: string;
|
||||
remark: string;
|
||||
// 智能体发布修改时间
|
||||
modified: string;
|
||||
// 智能体发布创建时间
|
||||
created: string;
|
||||
// 统计信息(智能体、插件、工作流相关的统计都在该结构里,根据实际情况取值)
|
||||
statistics: AgentStatisticsInfo;
|
||||
// 发布者信息
|
||||
publishUser: CreatorInfo;
|
||||
// 分类名称
|
||||
category: string;
|
||||
// 是否允许复制, 1 允许
|
||||
allowCopy: AllowCopyEnum;
|
||||
// 可用值:HTTP,CODE
|
||||
pluginType: PluginTypeEnum;
|
||||
collect: boolean;
|
||||
paymentRequired?: boolean;
|
||||
subscribed?: boolean;
|
||||
}
|
||||
|
||||
// 广场智能体与插件分类信息
|
||||
export interface SquareCategoryInfo {
|
||||
// 类别名称
|
||||
key: string;
|
||||
// 类别描述
|
||||
label: string;
|
||||
type: SquareAgentTypeEnum;
|
||||
children?: SquareCategoryInfo[];
|
||||
}
|
||||
41
qiming-mobile/types/interfaces/tempChat.uts
Normal file
41
qiming-mobile/types/interfaces/tempChat.uts
Normal file
@@ -0,0 +1,41 @@
|
||||
// import React from 'react';
|
||||
import { AgentSelectedComponentInfo } from './agent';
|
||||
import { AttachmentFile } from './conversationInfo';
|
||||
/**
|
||||
* 查询临时会话详细输入参数
|
||||
*/
|
||||
export interface TempConversationQueryDto {
|
||||
// 链接Key
|
||||
chatKey: string;
|
||||
// 会话唯一标识
|
||||
conversationUid?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建临时会话输入参数
|
||||
*/
|
||||
export interface TempConversationCreateDto {
|
||||
// 链接Key
|
||||
chatKey: string;
|
||||
// 验证码参数
|
||||
captchaVerifyParam?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* TempChatMessage
|
||||
*/
|
||||
export interface TempChatCompletionsParams {
|
||||
// 附件列表
|
||||
attachments?: AttachmentFile[];
|
||||
// 链接Key
|
||||
chatKey: string;
|
||||
// 会话唯一标识
|
||||
conversationUid: number;
|
||||
// chat消息
|
||||
message?: string;
|
||||
selectedComponents?: AgentSelectedComponentInfo[];
|
||||
// 变量参数,前端需要根据agent配置组装参数
|
||||
variableParams?: {
|
||||
[key: string]: any;
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user