FEAT: NEW WORKFLOW ENGINE (#3160)
Co-authored-by: Joel <iamjoel007@gmail.com> Co-authored-by: Yeuoly <admin@srmxy.cn> Co-authored-by: JzoNg <jzongcode@gmail.com> Co-authored-by: StyleZhang <jasonapring2015@outlook.com> Co-authored-by: jyong <jyong@dify.ai> Co-authored-by: nite-knite <nkCoding@gmail.com> Co-authored-by: jyong <718720800@qq.com>
This commit is contained in:
@@ -1,7 +1,5 @@
|
||||
import type { App, AppTemplate, SiteConfig } from '@/types/app'
|
||||
|
||||
export type AppMode = 'chat' | 'completion'
|
||||
|
||||
/* export type App = {
|
||||
id: string
|
||||
name: string
|
||||
@@ -81,6 +79,10 @@ export type AppDailyConversationsResponse = {
|
||||
data: Array<{ date: string; conversation_count: number }>
|
||||
}
|
||||
|
||||
export type WorkflowDailyConversationsResponse = {
|
||||
data: Array<{ date: string; runs: number }>
|
||||
}
|
||||
|
||||
export type AppStatisticsResponse = {
|
||||
data: Array<{ date: string }>
|
||||
}
|
||||
|
@@ -1,6 +1,5 @@
|
||||
import type { AppMode } from './app'
|
||||
import type { DataSourceNotionPage } from './common'
|
||||
import type { RetrievalConfig } from '@/types/app'
|
||||
import type { AppMode, RetrievalConfig } from '@/types/app'
|
||||
|
||||
export enum DataSourceType {
|
||||
FILE = 'upload_file',
|
||||
|
@@ -143,7 +143,7 @@ export type DatasetConfigs = {
|
||||
}
|
||||
top_k: number
|
||||
score_threshold_enabled: boolean
|
||||
score_threshold: number
|
||||
score_threshold?: number | null
|
||||
datasets: {
|
||||
datasets: {
|
||||
enabled: boolean
|
||||
|
@@ -1,12 +1,11 @@
|
||||
import type { AppMode } from './app'
|
||||
|
||||
import type { AppMode } from '@/types/app'
|
||||
export type AppBasicInfo = {
|
||||
id: string
|
||||
name: string
|
||||
mode: AppMode
|
||||
icon: string
|
||||
icon_background: string
|
||||
is_agent: boolean
|
||||
name: string
|
||||
description: string
|
||||
}
|
||||
|
||||
export type AppCategory = 'Writing' | 'Translate' | 'HR' | 'Programming' | 'Assistant'
|
||||
|
@@ -1,5 +1,9 @@
|
||||
import type { Viewport } from 'reactflow'
|
||||
import type { VisionFile } from '@/types/app'
|
||||
|
||||
import type {
|
||||
Edge,
|
||||
Node,
|
||||
} from '@/app/components/workflow/types'
|
||||
// Log type contains key:string conversation_id:string created_at:string quesiton:string answer:string
|
||||
export type Conversation = {
|
||||
id: string
|
||||
@@ -73,8 +77,7 @@ export type MessageContent = {
|
||||
conversation_id: string
|
||||
query: string
|
||||
inputs: Record<string, any>
|
||||
// message: Record<string, any>
|
||||
message: string
|
||||
message: { role: string; text: string; files?: VisionFile[] }[]
|
||||
message_tokens: number
|
||||
answer_tokens: number
|
||||
answer: string
|
||||
@@ -97,6 +100,8 @@ export type MessageContent = {
|
||||
from_end_user_id?: string
|
||||
}>
|
||||
message_files: VisionFile[]
|
||||
agent_thoughts: any[] // TODO
|
||||
workflow_run_id: string
|
||||
}
|
||||
|
||||
export type CompletionConversationGeneralDetail = {
|
||||
@@ -217,3 +222,73 @@ export type LogMessageAnnotationsResponse = LogMessageFeedbacksResponse
|
||||
export type AnnotationsCountResponse = {
|
||||
count: number
|
||||
}
|
||||
|
||||
export type WorkflowRunDetail = {
|
||||
id: string
|
||||
version: string
|
||||
status: 'running' | 'succeeded' | 'failed' | 'stopped'
|
||||
error?: string
|
||||
elapsed_time: number
|
||||
total_tokens: number
|
||||
total_price: number
|
||||
currency: string
|
||||
total_steps: number
|
||||
finished_at: number
|
||||
}
|
||||
export type AccountInfo = {
|
||||
id: string
|
||||
name: string
|
||||
email: string
|
||||
}
|
||||
export type EndUserInfo = {
|
||||
id: string
|
||||
type: 'browser' | 'service_api'
|
||||
is_anonymous: boolean
|
||||
session_id: string
|
||||
}
|
||||
export type WorkflowAppLogDetail = {
|
||||
id: string
|
||||
workflow_run: WorkflowRunDetail
|
||||
created_from: 'service-api' | 'web-app' | 'explore'
|
||||
created_by_role: 'account' | 'end_user'
|
||||
created_by_account?: AccountInfo
|
||||
created_by_end_user?: EndUserInfo
|
||||
created_at: number
|
||||
read_at?: number
|
||||
}
|
||||
export type WorkflowLogsResponse = {
|
||||
data: Array<WorkflowAppLogDetail>
|
||||
has_more: boolean
|
||||
limit: number
|
||||
total: number
|
||||
page: number
|
||||
}
|
||||
export type WorkflowLogsRequest = {
|
||||
keyword: string
|
||||
status: string
|
||||
page: number
|
||||
limit: number // The default value is 20 and the range is 1-100
|
||||
}
|
||||
|
||||
export type WorkflowRunDetailResponse = {
|
||||
id: string
|
||||
sequence_number: number
|
||||
version: string
|
||||
graph: {
|
||||
nodes: Node[]
|
||||
edges: Edge[]
|
||||
viewport?: Viewport
|
||||
}
|
||||
inputs: string
|
||||
status: 'running' | 'succeeded' | 'failed' | 'stopped'
|
||||
outputs?: string
|
||||
error?: string
|
||||
elapsed_time?: number
|
||||
total_tokens?: number
|
||||
total_steps: number
|
||||
created_by_role: 'account' | 'end_user'
|
||||
created_by_account?: AccountInfo
|
||||
created_by_end_user?: EndUserInfo
|
||||
created_at: number
|
||||
finished_at: number
|
||||
}
|
||||
|
Reference in New Issue
Block a user