feat: add generation trace and partial-ready workflow status
This commit is contained in:
51
frontend/src/types/generation.ts
Normal file
51
frontend/src/types/generation.ts
Normal file
@@ -0,0 +1,51 @@
|
||||
export interface GenerationJobSummary {
|
||||
id: string
|
||||
story_id: number | null
|
||||
output_mode: string
|
||||
input_type: string
|
||||
status: string
|
||||
current_step: string
|
||||
progress_percent: number
|
||||
progress_label: string
|
||||
is_terminal: boolean
|
||||
result_snapshot: Record<string, unknown>
|
||||
error_message: string | null
|
||||
created_at: string
|
||||
updated_at: string
|
||||
}
|
||||
|
||||
export interface GenerationJobEvent {
|
||||
id: number
|
||||
job_id: string
|
||||
story_id: number | null
|
||||
event_type: string
|
||||
status: string
|
||||
message: string | null
|
||||
event_metadata: Record<string, unknown>
|
||||
created_at: string
|
||||
}
|
||||
|
||||
export interface GenerationJobDetail extends GenerationJobSummary {
|
||||
request_payload: Record<string, unknown>
|
||||
events: GenerationJobEvent[]
|
||||
}
|
||||
|
||||
export interface GenerationProviderStat {
|
||||
capability: string
|
||||
adapter: string
|
||||
call_count: number
|
||||
success_count: number
|
||||
failure_count: number
|
||||
avg_latency_ms: number | null
|
||||
estimated_cost_usd: number
|
||||
}
|
||||
|
||||
export interface GenerationProviderStats {
|
||||
story_id: number
|
||||
total_calls: number
|
||||
successful_calls: number
|
||||
failed_calls: number
|
||||
avg_latency_ms: number | null
|
||||
estimated_cost_usd: number
|
||||
by_provider: GenerationProviderStat[]
|
||||
}
|
||||
Reference in New Issue
Block a user