169 lines
3.1 KiB
TypeScript
169 lines
3.1 KiB
TypeScript
|
|
export interface Assistant {
|
|
id: string;
|
|
name: string;
|
|
callCount: number;
|
|
opener: string;
|
|
prompt: string;
|
|
knowledgeBaseId: string;
|
|
language: 'zh' | 'en';
|
|
voice: string; // This will now store the ID of the voice from Voice Library
|
|
speed: number;
|
|
hotwords: string[];
|
|
tools?: string[]; // IDs of enabled tools
|
|
interruptionSensitivity?: number; // In ms
|
|
configMode?: 'platform' | 'dify' | 'fastgpt' | 'none';
|
|
apiUrl?: string;
|
|
apiKey?: string;
|
|
}
|
|
|
|
export interface Voice {
|
|
id: string;
|
|
name: string;
|
|
vendor: string;
|
|
gender: string;
|
|
language: string;
|
|
description: string;
|
|
}
|
|
|
|
export interface KnowledgeBase {
|
|
id: string;
|
|
name: string;
|
|
creator: string;
|
|
createdAt: string;
|
|
documents: KnowledgeDocument[];
|
|
}
|
|
|
|
export interface KnowledgeDocument {
|
|
id: string;
|
|
name: string;
|
|
size: string;
|
|
uploadDate: string;
|
|
}
|
|
|
|
export type InteractionType = 'text' | 'audio' | 'video';
|
|
|
|
export interface InteractionDetail {
|
|
role: 'user' | 'assistant';
|
|
content: string; // Text content or transcript
|
|
audioUrl?: string; // Placeholder for audio url
|
|
imageUrls?: string[]; // For video frames
|
|
timestamp: string;
|
|
}
|
|
|
|
export interface CallLog {
|
|
id: string;
|
|
source: 'debug' | 'external';
|
|
status: 'connected' | 'missed';
|
|
startTime: string;
|
|
duration: string;
|
|
agentName: string;
|
|
type: InteractionType;
|
|
details?: InteractionDetail[];
|
|
}
|
|
|
|
export interface Workflow {
|
|
id: string;
|
|
name: string;
|
|
nodeCount: number;
|
|
createdAt: string;
|
|
updatedAt: string;
|
|
nodes: WorkflowNode[];
|
|
edges: WorkflowEdge[];
|
|
globalPrompt?: string;
|
|
}
|
|
|
|
export interface WorkflowNode {
|
|
name: string;
|
|
type: 'conversation' | 'tool' | 'human' | 'end';
|
|
isStart?: boolean;
|
|
metadata: {
|
|
position: { x: number; y: number };
|
|
};
|
|
prompt?: string;
|
|
messagePlan?: {
|
|
firstMessage?: string;
|
|
};
|
|
variableExtractionPlan?: {
|
|
output: Array<{
|
|
type: string;
|
|
title: string;
|
|
description: string;
|
|
}>;
|
|
};
|
|
tool?: {
|
|
type: string;
|
|
function: {
|
|
name: string;
|
|
parameters: any;
|
|
};
|
|
destinations?: any[];
|
|
messages?: any[];
|
|
};
|
|
globalNodePlan?: {
|
|
enabled: boolean;
|
|
enterCondition: string;
|
|
};
|
|
}
|
|
|
|
export interface WorkflowEdge {
|
|
from: string;
|
|
to: string;
|
|
label?: string;
|
|
}
|
|
|
|
export enum TabValue {
|
|
GLOBAL = 'global',
|
|
VOICE = 'voice',
|
|
TOOLS = 'tools',
|
|
LINK = 'link'
|
|
}
|
|
|
|
export enum TestType {
|
|
FIXED = 'fixed',
|
|
INTELLIGENT = 'intelligent'
|
|
}
|
|
|
|
export enum TestMethod {
|
|
TEXT = 'text',
|
|
AUDIO = 'audio'
|
|
}
|
|
|
|
export interface AutoTestAssistant {
|
|
id: string;
|
|
name: string;
|
|
type: TestType;
|
|
method: TestMethod;
|
|
targetAssistantId: string;
|
|
fixedWorkflowSteps: string[];
|
|
intelligentPrompt: string;
|
|
createdAt: string;
|
|
}
|
|
|
|
export interface Tool {
|
|
id: string;
|
|
name: string;
|
|
description: string;
|
|
category: 'system' | 'query';
|
|
icon: string;
|
|
isCustom?: boolean;
|
|
}
|
|
|
|
export interface LLMModel {
|
|
id: string;
|
|
name: string;
|
|
vendor: string;
|
|
type: 'text' | 'embedding' | 'rerank';
|
|
baseUrl: string;
|
|
apiKey: string;
|
|
temperature?: number;
|
|
}
|
|
|
|
export interface ASRModel {
|
|
id: string;
|
|
name: string;
|
|
vendor: 'OpenAI Compatible';
|
|
language: string;
|
|
baseUrl: string;
|
|
apiKey: string;
|
|
} |