mirror of
https://github.com/infiniflow/ragflow.git
synced 2025-12-08 20:42:30 +08:00
### What problem does this PR solve? ### Type of change - [x] New Feature (non-breaking change which adds functionality)
This commit is contained in:
@ -163,9 +163,16 @@ class Retrieval(ToolBase, ABC):
|
|||||||
self.set_output("formalized_content", self._param.empty_response)
|
self.set_output("formalized_content", self._param.empty_response)
|
||||||
return
|
return
|
||||||
|
|
||||||
|
# Format the chunks for JSON output (similar to how other tools do it)
|
||||||
|
json_output = kbinfos["chunks"].copy()
|
||||||
|
|
||||||
self._canvas.add_reference(kbinfos["chunks"], kbinfos["doc_aggs"])
|
self._canvas.add_reference(kbinfos["chunks"], kbinfos["doc_aggs"])
|
||||||
form_cnt = "\n".join(kb_prompt(kbinfos, 200000, True))
|
form_cnt = "\n".join(kb_prompt(kbinfos, 200000, True))
|
||||||
|
|
||||||
|
# Set both formalized content and JSON output
|
||||||
self.set_output("formalized_content", form_cnt)
|
self.set_output("formalized_content", form_cnt)
|
||||||
|
self.set_output("json", json_output)
|
||||||
|
|
||||||
return form_cnt
|
return form_cnt
|
||||||
|
|
||||||
def thoughts(self) -> str:
|
def thoughts(self) -> str:
|
||||||
|
|||||||
@ -263,6 +263,10 @@ export const initialRetrievalValues = {
|
|||||||
type: 'string',
|
type: 'string',
|
||||||
value: '',
|
value: '',
|
||||||
},
|
},
|
||||||
|
json: {
|
||||||
|
type: 'Array<Object>',
|
||||||
|
value: [],
|
||||||
|
},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@ -83,6 +83,10 @@ function RetrievalForm({ node }: INextOperatorForm) {
|
|||||||
title: 'formalized_content',
|
title: 'formalized_content',
|
||||||
type: initialRetrievalValues.outputs.formalized_content.type,
|
type: initialRetrievalValues.outputs.formalized_content.type,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
title: 'json',
|
||||||
|
type: initialRetrievalValues.outputs.json.type,
|
||||||
|
},
|
||||||
];
|
];
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
|
|||||||
@ -133,6 +133,10 @@ export const initialRetrievalValues = {
|
|||||||
type: 'string',
|
type: 'string',
|
||||||
value: '',
|
value: '',
|
||||||
},
|
},
|
||||||
|
json: {
|
||||||
|
type: 'Array<Object>',
|
||||||
|
value: [],
|
||||||
|
},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@ -83,6 +83,10 @@ function RetrievalForm({ node }: INextOperatorForm) {
|
|||||||
title: 'formalized_content',
|
title: 'formalized_content',
|
||||||
type: initialRetrievalValues.outputs.formalized_content.type,
|
type: initialRetrievalValues.outputs.formalized_content.type,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
title: 'json',
|
||||||
|
type: initialRetrievalValues.outputs.json.type,
|
||||||
|
},
|
||||||
];
|
];
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user