Skip to content

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

fix: add json output alias on Retrieval node (#20300)

ciel60dcb9a1186f
diff --git a/internal/agent/component/universe_a_wrappers.go b/internal/agent/component/universe_a_wrappers.go
index 341497f347..9e481d2d34 100644
--- a/internal/agent/component/universe_a_wrappers.go
+++ b/internal/agent/component/universe_a_wrappers.go
@@ -233,7 +233,13 @@ func (c *retrievalComponent) Invoke(ctx context.Context, db *gorm.DB, inputs map
common.Debug("agent retrieval component: output",
zap.String("tool_output", out),
)
- return parseToolEnvelope(out), nil
+ decoded := parseToolEnvelope(out)
+ if chunks, ok := decoded["chunks"]; ok {
+ if _, has := decoded["json"]; !has {
+ decoded["json"] = chunks
+ }
+ }
+ return decoded, nil
}
func (c *retrievalComponent) Stream(_ context.Context, _ *gorm.DB, _ map[string]any) (<-chan map[string]any, error) {
@@ -488,7 +494,7 @@ func (c *codeExecComponent) Inputs() map[string]string {
func (c *codeExecComponent) GetInputForm() map[string]any {
res := make(map[string]any, len(c.params))
- for k, _ := range c.params {
+ for k := range c.params {
res[k] = map[string]any{
"type": "line",
"name": k,