mirror of
https://github.com/langgenius/webapp-conversation.git
synced 2025-12-08 17:32:27 +08:00
support workflow events
This commit is contained in:
78
types/app.ts
78
types/app.ts
@ -85,6 +85,12 @@ export type IChatItem = {
|
||||
message_files?: VisionFile[]
|
||||
}
|
||||
|
||||
export type ChatItem = IChatItem & {
|
||||
isError?: boolean
|
||||
workflow_run_id?: string
|
||||
workflowProcess?: WorkflowProcess
|
||||
}
|
||||
|
||||
export type ResponseHolder = {}
|
||||
|
||||
export type ConversationItem = {
|
||||
@ -140,3 +146,75 @@ export type VisionFile = {
|
||||
upload_file_id: string
|
||||
belongs_to?: string
|
||||
}
|
||||
|
||||
export enum BlockEnum {
|
||||
Start = 'start',
|
||||
End = 'end',
|
||||
Answer = 'answer',
|
||||
LLM = 'llm',
|
||||
KnowledgeRetrieval = 'knowledge-retrieval',
|
||||
QuestionClassifier = 'question-classifier',
|
||||
IfElse = 'if-else',
|
||||
Code = 'code',
|
||||
TemplateTransform = 'template-transform',
|
||||
HttpRequest = 'http-request',
|
||||
VariableAssigner = 'variable-assigner',
|
||||
Tool = 'tool',
|
||||
}
|
||||
|
||||
export type NodeTracing = {
|
||||
id: string
|
||||
index: number
|
||||
predecessor_node_id: string
|
||||
node_id: string
|
||||
node_type: BlockEnum
|
||||
title: string
|
||||
inputs: any
|
||||
process_data: any
|
||||
outputs?: any
|
||||
status: string
|
||||
error?: string
|
||||
elapsed_time: number
|
||||
execution_metadata: {
|
||||
total_tokens: number
|
||||
total_price: number
|
||||
currency: string
|
||||
}
|
||||
created_at: number
|
||||
created_by: {
|
||||
id: string
|
||||
name: string
|
||||
email: string
|
||||
}
|
||||
finished_at: number
|
||||
extras?: any
|
||||
expand?: boolean // for UI
|
||||
}
|
||||
|
||||
export enum NodeRunningStatus {
|
||||
NotStart = 'not-start',
|
||||
Waiting = 'waiting',
|
||||
Running = 'running',
|
||||
Succeeded = 'succeeded',
|
||||
Failed = 'failed',
|
||||
}
|
||||
|
||||
export enum WorkflowRunningStatus {
|
||||
Waiting = 'waiting',
|
||||
Running = 'running',
|
||||
Succeeded = 'succeeded',
|
||||
Failed = 'failed',
|
||||
Stopped = 'stopped',
|
||||
}
|
||||
|
||||
export type WorkflowProcess = {
|
||||
status: WorkflowRunningStatus
|
||||
tracing: NodeTracing[]
|
||||
expand?: boolean // for UI
|
||||
}
|
||||
|
||||
export enum CodeLanguage {
|
||||
python3 = 'python3',
|
||||
javascript = 'javascript',
|
||||
json = 'json',
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user