mirror of
https://github.com/infiniflow/ragflow.git
synced 2025-12-24 23:46:52 +08:00
### What problem does this PR solve? Feat: Call the interface to stop the output of the large model #10997 ### Type of change - [x] New Feature (non-breaking change which adds functionality)
This commit is contained in:
@ -54,6 +54,7 @@ export const enum AgentApiAction {
|
||||
SetAgentSetting = 'setAgentSetting',
|
||||
FetchPrompt = 'fetchPrompt',
|
||||
CancelDataflow = 'cancelDataflow',
|
||||
CancelCanvas = 'cancelCanvas',
|
||||
}
|
||||
|
||||
export const EmptyDsl = {
|
||||
@ -734,3 +735,20 @@ export const useCancelDataflow = () => {
|
||||
|
||||
// return { list: data, loading };
|
||||
// };
|
||||
|
||||
export function useCancelConversation() {
|
||||
const {
|
||||
data,
|
||||
isPending: loading,
|
||||
mutateAsync,
|
||||
} = useMutation({
|
||||
mutationKey: [AgentApiAction.CancelCanvas],
|
||||
mutationFn: async (taskId: string) => {
|
||||
const ret = await agentService.cancelCanvas(taskId);
|
||||
|
||||
return ret?.data?.code;
|
||||
},
|
||||
});
|
||||
|
||||
return { data, loading, cancelConversation: mutateAsync };
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user