Feat: Call the interface to stop the output of the large model #10997 (#11164)

### 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:
balibabu
2025-11-11 15:21:08 +08:00
committed by GitHub
parent 7dd9758056
commit 377c0fb4fa
8 changed files with 84 additions and 5 deletions

View File

@ -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 };
}