Files
ai-agent/web/lib/generated/enums.ts
T
mlogclub c3387ec4a9 feat: add LanceDB vector database provider
- Implemented LanceDBProvider for managing vector collections, including methods for creating, deleting, and searching collections.
- Added support for LanceDB configuration in VectorDBConfig.
- Introduced stub for LanceDB provider when not built with the appropriate tag.
- Updated provider initialization to include LanceDB as a supported type.
- Created types and interfaces for vector operations, including Vector, SearchRequest, and SearchResult.
- Added tests for VectorDBConfig unmarshalling and for ensuring proper error handling when LanceDB is not built.
- Updated enums to include LanceDB type and labels.
- Modified frontend enums to reflect the addition of LanceDB.
2026-06-07 17:32:29 +08:00

377 lines
10 KiB
TypeScript

// Code generated by cmd/enums/generator.go. DO NOT EDIT.
export enum AIAgentFallbackMode {
NoAnswer = 1,
SuggestRetry = 2,
}
export const AIAgentFallbackModeLabels: Record<AIAgentFallbackMode, string> = {
[AIAgentFallbackMode.NoAnswer]: "直接声明无答案",
[AIAgentFallbackMode.SuggestRetry]: "建议补充信息",
}
export enum AIAgentHandoffMode {
WaitPool = 1,
DefaultTeamPool = 2,
AIHoldAndNotify = 3,
}
export const AIAgentHandoffModeLabels: Record<AIAgentHandoffMode, string> = {
[AIAgentHandoffMode.WaitPool]: "进入待接入池",
[AIAgentHandoffMode.DefaultTeamPool]: "进入默认客服组待接入池",
[AIAgentHandoffMode.AIHoldAndNotify]: "AI托底并提醒人工",
}
export enum AIModelType {
LLM = "llm",
Embedding = "embedding",
Rerank = "rerank",
}
export const AIModelTypeLabels: Record<AIModelType, string> = {
[AIModelType.LLM]: "大语言模型",
[AIModelType.Embedding]: "向量模型",
[AIModelType.Rerank]: "重排序模型",
}
export enum AIProvider {
OpenAI = "openai",
}
export const AIProviderLabels: Record<AIProvider, string> = {
[AIProvider.OpenAI]: "OpenAI",
}
export enum AssetProvider {
Local = "local",
OSS = "oss",
}
export const AssetProviderLabels: Record<AssetProvider, string> = {
[AssetProvider.Local]: "本地存储",
[AssetProvider.OSS]: "对象存储",
}
export enum AssetStatus {
Pending = 1,
Success = 2,
Failed = 3,
Deleted = 4,
}
export const AssetStatusLabels: Record<AssetStatus, string> = {
[AssetStatus.Pending]: "处理中",
[AssetStatus.Success]: "成功",
[AssetStatus.Failed]: "失败",
[AssetStatus.Deleted]: "已删除",
}
export enum ContactType {
Mobile = "mobile",
Email = "email",
Other = "other",
}
export const ContactTypeLabels: Record<ContactType, string> = {
[ContactType.Mobile]: "手机号",
[ContactType.Email]: "邮箱",
[ContactType.Other]: "其他",
}
export enum ExternalSource {
Guest = "guest",
WxWorkKF = "wxwork_kf",
User = "user",
}
export const ExternalSourceLabels: Record<ExternalSource, string> = {
[ExternalSource.Guest]: "访客",
[ExternalSource.WxWorkKF]: "企业微信客服",
[ExternalSource.User]: "用户",
}
export enum Gender {
Unknown = 0,
Male = 1,
Female = 2,
}
export const GenderLabels: Record<Gender, string> = {
[Gender.Unknown]: "未知",
[Gender.Male]: "男",
[Gender.Female]: "女",
}
export enum IMAssignmentStatus {
Active = 0,
Inactive = 1,
}
export const IMAssignmentStatusLabels: Record<IMAssignmentStatus, string> = {
[IMAssignmentStatus.Active]: "进行中",
[IMAssignmentStatus.Inactive]: "已结束",
}
export enum IMAssignmentType {
Assign = "assign",
Transfer = "transfer",
}
export const IMAssignmentTypeLabels: Record<IMAssignmentType, string> = {
[IMAssignmentType.Assign]: "分配",
[IMAssignmentType.Transfer]: "转接",
}
export enum IMConversationServiceMode {
AIOnly = 1,
HumanOnly = 2,
AIFirst = 3,
}
export const IMConversationServiceModeLabels: Record<IMConversationServiceMode, string> = {
[IMConversationServiceMode.AIOnly]: "仅AI",
[IMConversationServiceMode.HumanOnly]: "仅人工",
[IMConversationServiceMode.AIFirst]: "AI优先",
}
export enum IMConversationStatus {
AIServing = 1,
Pending = 2,
Active = 3,
Closed = 4,
}
export const IMConversationStatusLabels: Record<IMConversationStatus, string> = {
[IMConversationStatus.AIServing]: "AI接待中",
[IMConversationStatus.Pending]: "待接入",
[IMConversationStatus.Active]: "处理中",
[IMConversationStatus.Closed]: "已关闭",
}
export enum IMEventType {
Create = "create",
Assign = "assign",
Transfer = "transfer",
Close = "close",
MessageSend = "message_send",
MessageRecall = "message_recall",
}
export const IMEventTypeLabels: Record<IMEventType, string> = {
[IMEventType.Create]: "创建会话",
[IMEventType.Assign]: "分配会话",
[IMEventType.Transfer]: "转接会话",
[IMEventType.Close]: "关闭会话",
[IMEventType.MessageSend]: "发送消息",
[IMEventType.MessageRecall]: "撤回消息",
}
export enum IMMessageStatus {
Sending = 1,
Sent = 2,
Delivered = 3,
Read = 4,
Failed = 5,
Recalled = 6,
}
export const IMMessageStatusLabels: Record<IMMessageStatus, string> = {
[IMMessageStatus.Sending]: "发送中",
[IMMessageStatus.Sent]: "已发送",
[IMMessageStatus.Delivered]: "已送达",
[IMMessageStatus.Read]: "已读",
[IMMessageStatus.Failed]: "发送失败",
[IMMessageStatus.Recalled]: "已撤回",
}
export enum IMMessageType {
Text = "text",
Image = "image",
Attachment = "attachment",
HTML = "html",
}
export const IMMessageTypeLabels: Record<IMMessageType, string> = {
[IMMessageType.Text]: "文本",
[IMMessageType.Image]: "图片",
[IMMessageType.Attachment]: "附件",
[IMMessageType.HTML]: "富文本",
}
export enum IMParticipantType {
Customer = "customer",
Agent = "agent",
AI = "ai",
System = "system",
}
export const IMParticipantTypeLabels: Record<IMParticipantType, string> = {
[IMParticipantType.Customer]: "客户",
[IMParticipantType.Agent]: "客服",
[IMParticipantType.AI]: "AI",
[IMParticipantType.System]: "系统",
}
export enum IMSenderType {
Agent = "agent",
Customer = "customer",
AI = "ai",
System = "system",
}
export const IMSenderTypeLabels: Record<IMSenderType, string> = {
[IMSenderType.Agent]: "客服",
[IMSenderType.Customer]: "客户",
[IMSenderType.AI]: "AI",
[IMSenderType.System]: "系统",
}
export enum KnowledgeAnswerMode {
Strict = 1,
Assist = 2,
}
export const KnowledgeAnswerModeLabels: Record<KnowledgeAnswerMode, string> = {
[KnowledgeAnswerMode.Strict]: "严格模式",
[KnowledgeAnswerMode.Assist]: "辅助模式",
}
export enum KnowledgeAnswerStatus {
Normal = 1,
NoAnswer = 2,
Fallback = 3,
Blocked = 4,
}
export const KnowledgeAnswerStatusLabels: Record<KnowledgeAnswerStatus, string> = {
[KnowledgeAnswerStatus.Normal]: "正常",
[KnowledgeAnswerStatus.NoAnswer]: "无答案",
[KnowledgeAnswerStatus.Fallback]: "兜底回复",
[KnowledgeAnswerStatus.Blocked]: "已屏蔽",
}
export enum KnowledgeBaseType {
Document = "document",
FAQ = "faq",
}
export const KnowledgeBaseTypeLabels: Record<KnowledgeBaseType, string> = {
[KnowledgeBaseType.Document]: "文档知识库",
[KnowledgeBaseType.FAQ]: "FAQ知识库",
}
export enum KnowledgeChunkProvider {
Fixed = "fixed",
Structured = "structured",
FAQ = "faq",
Semantic = "semantic",
}
export const KnowledgeChunkProviderLabels: Record<KnowledgeChunkProvider, string> = {
[KnowledgeChunkProvider.Fixed]: "固定长度",
[KnowledgeChunkProvider.Structured]: "结构化分块",
[KnowledgeChunkProvider.FAQ]: "问答式分块",
[KnowledgeChunkProvider.Semantic]: "语义分块",
}
export enum KnowledgeChunkType {
Text = "text",
FAQ = "faq",
Table = "table",
Code = "code",
}
export const KnowledgeChunkTypeLabels: Record<KnowledgeChunkType, string> = {
[KnowledgeChunkType.Text]: "文本",
[KnowledgeChunkType.FAQ]: "问答",
[KnowledgeChunkType.Table]: "表格",
[KnowledgeChunkType.Code]: "代码",
}
export enum KnowledgeDocumentContentType {
HTML = "html",
Markdown = "markdown",
}
export const KnowledgeDocumentContentTypeLabels: Record<KnowledgeDocumentContentType, string> = {
[KnowledgeDocumentContentType.HTML]: "HTML",
[KnowledgeDocumentContentType.Markdown]: "Markdown",
}
export enum KnowledgeDocumentIndexStatus {
Pending = "pending",
Indexed = "indexed",
Failed = "failed",
}
export const KnowledgeDocumentIndexStatusLabels: Record<KnowledgeDocumentIndexStatus, string> = {
[KnowledgeDocumentIndexStatus.Pending]: "待索引",
[KnowledgeDocumentIndexStatus.Indexed]: "已索引",
[KnowledgeDocumentIndexStatus.Failed]: "索引失败",
}
export enum KnowledgeFeedbackType {
Like = 1,
Dislike = 2,
NotHelpful = 3,
WrongCitation = 4,
Other = 5,
}
export const KnowledgeFeedbackTypeLabels: Record<KnowledgeFeedbackType, string> = {
[KnowledgeFeedbackType.Like]: "点赞",
[KnowledgeFeedbackType.Dislike]: "点踩",
[KnowledgeFeedbackType.NotHelpful]: "无帮助",
[KnowledgeFeedbackType.WrongCitation]: "引用错误",
[KnowledgeFeedbackType.Other]: "其他",
}
export enum KnowledgeRetrieveChannel {
IM = "im",
AgentAssist = "agent_assist",
API = "api",
Debug = "debug",
}
export const KnowledgeRetrieveChannelLabels: Record<KnowledgeRetrieveChannel, string> = {
[KnowledgeRetrieveChannel.IM]: "客服会话",
[KnowledgeRetrieveChannel.AgentAssist]: "客服助手",
[KnowledgeRetrieveChannel.API]: "API接口",
[KnowledgeRetrieveChannel.Debug]: "调试",
}
export enum KnowledgeRetrieveScene {
FirstResponse = "first_response",
Assist = "assist",
QA = "qa",
}
export const KnowledgeRetrieveSceneLabels: Record<KnowledgeRetrieveScene, string> = {
[KnowledgeRetrieveScene.FirstResponse]: "首次回复",
[KnowledgeRetrieveScene.Assist]: "辅助回复",
[KnowledgeRetrieveScene.QA]: "问答",
}
export enum ServiceStatus {
Idle = 0,
Busy = 1,
}
export const ServiceStatusLabels: Record<ServiceStatus, string> = {
[ServiceStatus.Idle]: "空闲",
[ServiceStatus.Busy]: "忙碌",
}
export enum Status {
Ok = 0,
Disabled = 1,
Deleted = 2,
}
export const StatusLabels: Record<Status, string> = {
[Status.Ok]: "启用",
[Status.Disabled]: "禁用",
[Status.Deleted]: "已删除",
}
export enum ThirdProvider {
WxWork = "wxwork",
Dingtalk = "dingtalk",
OIDC = "oidc",
}
export const ThirdProviderLabels: Record<ThirdProvider, string> = {
[ThirdProvider.WxWork]: "企业微信",
[ThirdProvider.Dingtalk]: "钉钉",
[ThirdProvider.OIDC]: "OIDC",
}
export enum TicketStatus {
Pending = "pending",
InProgress = "in_progress",
Done = "done",
}
export const TicketStatusLabels: Record<TicketStatus, string> = {
[TicketStatus.Pending]: "待处理",
[TicketStatus.InProgress]: "处理中",
[TicketStatus.Done]: "已处理",
}
export enum VectorDBType {
Qdrant = "qdrant",
LanceDB = "lancedb",
}
export const VectorDBTypeLabels: Record<VectorDBType, string> = {
[VectorDBType.Qdrant]: "Qdrant",
[VectorDBType.LanceDB]: "LanceDB",
}