Skip to content

RAGFlow is an agent-native database: a Retrieval-Augmented Generation (RAG) engine that grew into context infrastructure.

2.4 KB
Raw Blame
//
//  Copyright 2026 The InfiniFlow Authors. All Rights Reserved.
//
//  Licensed under the Apache License, Version 2.0 (the "License");
//  you may not use this file except in compliance with the License.
//  You may obtain a copy of the License at
//
//      http://www.apache.org/licenses/LICENSE-2.0
//
//  Unless required by applicable law or agreed to in writing, software
//  distributed under the License is distributed on an "AS IS" BASIS,
//  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
//  See the License for the specific language governing permissions and
//  limitations under the License.

package common

import (
	"time"
)

// IngestionLog is the structured record for ingestion (document-parse) lifecycle
// events. It is a shared type used by both the OSS and EE builds; the sink
// implementation (LogIngest and friends) is provided per edition (the OSS build
// keeps a no-op seam in stub.go, the EE build provides the real sink).
type IngestionLog struct {
	EventTime      time.Time      `json:"event_time"`
	TenantID       string         `json:"tenant_id"`
	DatasetID      string         `json:"dataset_id"`
	DocID          string         `json:"doc_id"`
	UserID         string         `json:"user_id"`
	UserName       string         `json:"user_name,omitempty"`
	TenantName     string         `json:"tenant_name,omitempty"`
	Worker         string         `json:"worker"`
	TaskID         string         `json:"task_id"`
	EventType      string         `json:"event_type"`
	Status         string         `json:"status"`
	ErrorInfo      string         `json:"error_info,omitempty"`
	Filename       string         `json:"filename"`
	FileType       string         `json:"file_type"`
	FileSize       int64          `json:"file_size"`
	ParserID       string         `json:"parser_id"`
	UploadTime     time.Time      `json:"upload_time"`
	EnqueueTime    time.Time      `json:"enqueue_time"`
	BeginTime      time.Time      `json:"begin_time"`
	EndTime        time.Time      `json:"end_time"`
	DurationMS     int64          `json:"duration_ms"`
	WaitDurationS  float64        `json:"wait_duration_s"`
	ParseDurationS float64        `json:"parse_duration_s"`
	Progress       float64        `json:"progress"`
	RunCount       int            `json:"run_count"`
	Code           int            `json:"code"`
	Operation      map[string]any `json:"operation,omitempty"`
}