Add analysis feature

This commit is contained in:
Xin Wang
2026-08-07 10:59:47 +08:00
parent 485ad623d4
commit 56a32e81ca
23 changed files with 768 additions and 223 deletions
+32
View File
@@ -246,6 +246,27 @@ export type SystemToolKind =
| "skip_turn"
| "request_human_handoff";
export type AnalysisFieldType =
| "string"
| "boolean"
| "integer"
| "number"
| "enum";
export type AnalysisField = {
id: string;
name: string;
type: AnalysisFieldType;
description: string;
enumValues: string[];
};
export type AnalysisConfig = {
enabled: boolean;
modelResourceId: string;
fields: AnalysisField[];
};
/** 后端 AssistantOut(宽表 STI:瘦字段平铺,workflow 用 graph)。apiKey 读时打码 */
export type Assistant = {
id: string;
@@ -264,6 +285,7 @@ export type Assistant = {
toolIds: string[];
prompt: string;
dynamicVariableDefinitions: Record<string, DynamicVariableDefinition>;
analysisConfig: AnalysisConfig;
apiUrl: string;
apiKey: string;
appId: string;
@@ -354,6 +376,16 @@ export type ConversationDetail = Conversation & {
};
workflowTrace?: Array<Record<string, unknown>>;
};
analysis: {
status: "none" | "pending" | "processing" | "completed" | "failed";
fields: Array<{
name: string;
type: AnalysisFieldType;
value: unknown;
}>;
error: string;
completedAt: string | null;
};
messages: ConversationMessage[];
};