mirror of
https://github.com/infiniflow/ragflow.git
synced 2026-07-23 00:46:42 +08:00
Align Go parser backends and PDF pipeline with Python (#16676)
Ports remaining Go parser wiring and PDF backends, adds tenant-aware VLM dispatch, aligns post-processing with Python, and adds end-to-end pipeline coverage with a generated six-page PDF.
This commit is contained in:
@@ -84,6 +84,7 @@ import (
|
||||
|
||||
"ragflow/internal/agent/runtime"
|
||||
"ragflow/internal/ingestion/component/schema"
|
||||
"ragflow/internal/utility"
|
||||
)
|
||||
|
||||
const ComponentNameParser = "Parser"
|
||||
@@ -291,8 +292,19 @@ func (c *ParserComponent) Invoke(ctx context.Context, inputs map[string]any) (ma
|
||||
}
|
||||
}
|
||||
|
||||
dispatched := dispatchParse(fileTypeExt, filename, binary, c.Param.Setups)
|
||||
dispatched = hydrateEmptyDispatchPayload(dispatched, binary)
|
||||
dispatched, handledVision, visionErr := maybeDispatchPDFVision(fileTypeExt, filename, binary, inputs, c.Param.Setups)
|
||||
if visionErr != nil {
|
||||
return nil, visionErr
|
||||
}
|
||||
if !handledVision {
|
||||
dispatched = dispatchParse(fileTypeExt, filename, binary, c.Param.Setups)
|
||||
dispatched = hydrateEmptyDispatchPayload(dispatched, binary)
|
||||
}
|
||||
// Known/supported families must fail loudly when dispatch or
|
||||
// parsing breaks. Only unknown families keep the raw-text fallback.
|
||||
if dispatched.Err != nil && fileTypeExt != utility.FileTypeOTHER {
|
||||
return nil, dispatched.Err
|
||||
}
|
||||
|
||||
// 3. Build the legacy `pages` slice. When the dispatch path
|
||||
// produced a JSON payload, we re-shape it into the page
|
||||
|
||||
Reference in New Issue
Block a user