Feat: Add agent log-sheet in cavas and log-sheet in share's page (#9072)

### What problem does this PR solve?

Feat: Add agent log-sheet in cavas and log-sheet in share's page #3221 

### Type of change

- [x] New Feature (non-breaking change which adds functionality)
This commit is contained in:
chanx
2025-07-28 16:48:46 +08:00
committed by GitHub
parent cc0227cf6e
commit 381f9df941
12 changed files with 520 additions and 256 deletions

View File

@ -1,4 +1,5 @@
import { SharedFrom } from '@/constants/chat';
import { IEventList } from '@/hooks/use-send-message';
import { useSendAgentMessage } from '@/pages/agent/chat/use-send-agent-message';
import trim from 'lodash/trim';
import { useSearchParams } from 'umi';
@ -27,14 +28,16 @@ export const useGetSharedChatSearchParams = () => {
};
};
export function useSendNextSharedMessage() {
export const useSendNextSharedMessage = (
addEventList: (data: IEventList, messageId: string) => void,
) => {
const { from, sharedId: conversationId } = useGetSharedChatSearchParams();
const url = `/api/v1/${from === SharedFrom.Agent ? 'agentbots' : 'chatbots'}/${conversationId}/completions`;
const ret = useSendAgentMessage(url);
const ret = useSendAgentMessage(url, addEventList);
return {
...ret,
hasError: false,
};
}
};