mirror of
https://github.com/infiniflow/ragflow.git
synced 2026-08-03 22:30:31 +08:00
Port PR14140 and PR16881 to GO (#17102)
### Summary Port https://github.com/infiniflow/ragflow/pull/14140/ https://github.com/infiniflow/ragflow/pull/16881
This commit is contained in:
@@ -382,11 +382,14 @@ func pagesFromDispatch(pages []schema.Page) [][]byte {
|
||||
// at rag/flow/parser/parser.py:_invoke — the downstream chunker
|
||||
// / tokenizer / extractor components read the matching family
|
||||
// key, with "pages" as the universal fallback shape.
|
||||
func buildParserOutputs(parsed []schema.Page, dispatched parserDispatchResult, name string, fileType utility.FileType) map[string]any {
|
||||
func buildParserOutputs(parsed []schema.Page, dispatched parserDispatchResult, name string, fileType utility.FileType, lang string) map[string]any {
|
||||
out := map[string]any{
|
||||
"pages": toAnyPages(parsed),
|
||||
"name": name,
|
||||
}
|
||||
if lang != "" {
|
||||
out["lang"] = lang
|
||||
}
|
||||
if dispatched.Err == nil && dispatched.OutputFormat != "" {
|
||||
out["output_format"] = dispatched.OutputFormat
|
||||
switch dispatched.OutputFormat {
|
||||
|
||||
Reference in New Issue
Block a user