ragflow
ragflow copied to clipboard
[Question]: `available_int` missing.
Self Checks
- [x] I have searched for existing issues search for existing issues, including closed ones.
- [x] I confirm that I am using English to submit this report (Language Policy).
- [x] Non-english title submitions will be closed directly ( 非英文标题的提交将会被直接关闭 ) (Language Policy).
- [x] Please do not modify this template :) and fill in all the required fields.
Describe your problem
有没有方法可以获取到解析之后数据块的启用状态; http api的 /api/v1/datasets/{dataset_id}/documents/{document_id}/chunks接口并没有返回available_int 版本是v0.16.0
要获取解析之后数据块的启用状态,可以查看 ChunkCard 组件中的 Switch 组件。该组件使用 enabled 状态来表示启用状态,并通过 available 字段来判断数据块是否启用:
const [enabled, setEnabled] = useState(false);
useEffect(() => {
setEnabled(available === 1);
}, [available]);
const onChange = (checked: boolean) => {
setEnabled(checked);
switchChunk(available === 0 ? 1 : 0, [item.chunk_id]);
};
<Switch checked={enabled} onChange={onChange} />
这里,available 为 1 时表示启用状态。Switch 组件的 checked 属性绑定到 enabled 状态,onChange 事件用于切换启用状态[1].
To continue talking to Dosu, mention @dosu.
Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Bug Report | Other
There's available field in every chunk.