mirror of
https://github.com/infiniflow/ragflow.git
synced 2025-12-08 20:42:30 +08:00
Feat: Make the agent dialog window exposed to the outside world fill in the begin form #3221 (#9124)
### What problem does this PR solve? Feat: Make the agent dialog window exposed to the outside world fill in the begin form #3221 ### Type of change - [x] New Feature (non-breaking change which adds functionality)
This commit is contained in:
@ -20,7 +20,7 @@ const LLMLabel = ({ value }: IProps) => {
|
|||||||
height={20}
|
height={20}
|
||||||
size={'small'}
|
size={'small'}
|
||||||
/>
|
/>
|
||||||
{llmName}
|
<span className="flex-1 truncate"> {llmName}</span>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|||||||
@ -143,6 +143,7 @@ export function NextMessageInput({
|
|||||||
size="icon"
|
size="icon"
|
||||||
variant="ghost"
|
variant="ghost"
|
||||||
className="size-7 rounded-sm"
|
className="size-7 rounded-sm"
|
||||||
|
disabled={isUploading || sendLoading}
|
||||||
>
|
>
|
||||||
<Paperclip className="size-3.5" />
|
<Paperclip className="size-3.5" />
|
||||||
<span className="sr-only">Attach file</span>
|
<span className="sr-only">Attach file</span>
|
||||||
|
|||||||
@ -10,6 +10,7 @@ import { DSL, IFlow, IFlowTemplate } from '@/interfaces/database/flow';
|
|||||||
import { IDebugSingleRequestBody } from '@/interfaces/request/agent';
|
import { IDebugSingleRequestBody } from '@/interfaces/request/agent';
|
||||||
import i18n from '@/locales/config';
|
import i18n from '@/locales/config';
|
||||||
import { BeginId } from '@/pages/agent/constant';
|
import { BeginId } from '@/pages/agent/constant';
|
||||||
|
import { BeginQuery } from '@/pages/agent/interface';
|
||||||
import { useGetSharedChatSearchParams } from '@/pages/chat/shared-hooks';
|
import { useGetSharedChatSearchParams } from '@/pages/chat/shared-hooks';
|
||||||
import agentService, {
|
import agentService, {
|
||||||
fetchAgentLogsByCanvasId,
|
fetchAgentLogsByCanvasId,
|
||||||
@ -46,6 +47,7 @@ export const enum AgentApiAction {
|
|||||||
FetchVersionList = 'fetchVersionList',
|
FetchVersionList = 'fetchVersionList',
|
||||||
FetchVersion = 'fetchVersion',
|
FetchVersion = 'fetchVersion',
|
||||||
FetchAgentAvatar = 'fetchAgentAvatar',
|
FetchAgentAvatar = 'fetchAgentAvatar',
|
||||||
|
FetchExternalAgentInputs = 'fetchExternalAgentInputs',
|
||||||
}
|
}
|
||||||
|
|
||||||
export const EmptyDsl = {
|
export const EmptyDsl = {
|
||||||
@ -584,3 +586,28 @@ export const useFetchAgentLog = (searchParams: IAgentLogsRequest) => {
|
|||||||
|
|
||||||
return { data, loading };
|
return { data, loading };
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export const useFetchExternalAgentInputs = () => {
|
||||||
|
const { sharedId } = useGetSharedChatSearchParams();
|
||||||
|
|
||||||
|
const {
|
||||||
|
data,
|
||||||
|
isFetching: loading,
|
||||||
|
refetch,
|
||||||
|
} = useQuery<Record<string, BeginQuery>>({
|
||||||
|
queryKey: [AgentApiAction.FetchExternalAgentInputs],
|
||||||
|
initialData: {} as Record<string, BeginQuery>,
|
||||||
|
refetchOnReconnect: false,
|
||||||
|
refetchOnMount: false,
|
||||||
|
refetchOnWindowFocus: false,
|
||||||
|
gcTime: 0,
|
||||||
|
enabled: !!sharedId,
|
||||||
|
queryFn: async () => {
|
||||||
|
const { data } = await agentService.fetchExternalAgentInputs(sharedId!);
|
||||||
|
|
||||||
|
return data?.data ?? {};
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
return { data, loading, refetch };
|
||||||
|
};
|
||||||
|
|||||||
@ -176,6 +176,7 @@ export function useSetUploadResponseData() {
|
|||||||
export const useSendAgentMessage = (
|
export const useSendAgentMessage = (
|
||||||
url?: string,
|
url?: string,
|
||||||
addEventList?: (data: IEventList, messageId: string) => void,
|
addEventList?: (data: IEventList, messageId: string) => void,
|
||||||
|
beginParams?: any[],
|
||||||
) => {
|
) => {
|
||||||
const { id: agentId } = useParams();
|
const { id: agentId } = useParams();
|
||||||
const { handleInputChange, value, setValue } = useHandleMessageInputChange();
|
const { handleInputChange, value, setValue } = useHandleMessageInputChange();
|
||||||
@ -226,7 +227,9 @@ export const useSendAgentMessage = (
|
|||||||
|
|
||||||
params.query = message.content;
|
params.query = message.content;
|
||||||
// params.message_id = message.id;
|
// params.message_id = message.id;
|
||||||
params.inputs = transferInputsArrayToObject(query); // begin operator inputs
|
params.inputs = transferInputsArrayToObject(
|
||||||
|
beginParams ? beginParams : query,
|
||||||
|
); // begin operator inputs
|
||||||
|
|
||||||
params.files = uploadResponseList;
|
params.files = uploadResponseList;
|
||||||
|
|
||||||
@ -248,13 +251,14 @@ export const useSendAgentMessage = (
|
|||||||
},
|
},
|
||||||
[
|
[
|
||||||
agentId,
|
agentId,
|
||||||
sessionId,
|
|
||||||
send,
|
send,
|
||||||
|
clearUploadResponseList,
|
||||||
inputs,
|
inputs,
|
||||||
|
beginParams,
|
||||||
uploadResponseList,
|
uploadResponseList,
|
||||||
|
sessionId,
|
||||||
setValue,
|
setValue,
|
||||||
removeLatestMessage,
|
removeLatestMessage,
|
||||||
clearUploadResponseList,
|
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
@ -487,6 +487,16 @@ export const initialExeSqlValues = {
|
|||||||
port: 3306,
|
port: 3306,
|
||||||
password: '',
|
password: '',
|
||||||
max_records: 1024,
|
max_records: 1024,
|
||||||
|
outputs: {
|
||||||
|
formalized_content: {
|
||||||
|
value: '',
|
||||||
|
type: 'string',
|
||||||
|
},
|
||||||
|
json: {
|
||||||
|
value: [],
|
||||||
|
type: 'Array<Object>',
|
||||||
|
},
|
||||||
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
export const initialSwitchValues = {
|
export const initialSwitchValues = {
|
||||||
|
|||||||
@ -20,10 +20,14 @@ import { useFormValues } from '../../hooks/use-form-values';
|
|||||||
import { useWatchFormChange } from '../../hooks/use-watch-form-change';
|
import { useWatchFormChange } from '../../hooks/use-watch-form-change';
|
||||||
import { INextOperatorForm } from '../../interface';
|
import { INextOperatorForm } from '../../interface';
|
||||||
import { ExeSQLOptions } from '../../options';
|
import { ExeSQLOptions } from '../../options';
|
||||||
|
import { buildOutputList } from '../../utils/build-output-list';
|
||||||
import { FormWrapper } from '../components/form-wrapper';
|
import { FormWrapper } from '../components/form-wrapper';
|
||||||
|
import { Output } from '../components/output';
|
||||||
import { QueryVariable } from '../components/query-variable';
|
import { QueryVariable } from '../components/query-variable';
|
||||||
import { FormSchema, useSubmitForm } from './use-submit-form';
|
import { FormSchema, useSubmitForm } from './use-submit-form';
|
||||||
|
|
||||||
|
const outputList = buildOutputList(initialExeSqlValues.outputs);
|
||||||
|
|
||||||
export function ExeSQLFormWidgets({ loading }: { loading: boolean }) {
|
export function ExeSQLFormWidgets({ loading }: { loading: boolean }) {
|
||||||
const form = useFormContext();
|
const form = useFormContext();
|
||||||
const { t } = useTranslate('flow');
|
const { t } = useTranslate('flow');
|
||||||
@ -153,6 +157,9 @@ function ExeSQLForm({ node }: INextOperatorForm) {
|
|||||||
<QueryVariable name="sql"></QueryVariable>
|
<QueryVariable name="sql"></QueryVariable>
|
||||||
<ExeSQLFormWidgets loading={loading}></ExeSQLFormWidgets>
|
<ExeSQLFormWidgets loading={loading}></ExeSQLFormWidgets>
|
||||||
</FormWrapper>
|
</FormWrapper>
|
||||||
|
<div className="p-5">
|
||||||
|
<Output list={outputList}></Output>
|
||||||
|
</div>
|
||||||
</Form>
|
</Form>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -18,7 +18,6 @@ import {
|
|||||||
import { SharedFrom } from '@/constants/chat';
|
import { SharedFrom } from '@/constants/chat';
|
||||||
import { useSetModalState } from '@/hooks/common-hooks';
|
import { useSetModalState } from '@/hooks/common-hooks';
|
||||||
import { useNavigatePage } from '@/hooks/logic-hooks/navigate-hooks';
|
import { useNavigatePage } from '@/hooks/logic-hooks/navigate-hooks';
|
||||||
import { useFetchUserInfo } from '@/hooks/user-setting-hooks';
|
|
||||||
import { ReactFlowProvider } from '@xyflow/react';
|
import { ReactFlowProvider } from '@xyflow/react';
|
||||||
import {
|
import {
|
||||||
ChevronDown,
|
ChevronDown,
|
||||||
@ -37,10 +36,7 @@ import AgentCanvas from './canvas';
|
|||||||
import EmbedDialog from './embed-dialog';
|
import EmbedDialog from './embed-dialog';
|
||||||
import { useHandleExportOrImportJsonFile } from './hooks/use-export-json';
|
import { useHandleExportOrImportJsonFile } from './hooks/use-export-json';
|
||||||
import { useFetchDataOnMount } from './hooks/use-fetch-data';
|
import { useFetchDataOnMount } from './hooks/use-fetch-data';
|
||||||
import {
|
import { useGetBeginNodeDataInputs } from './hooks/use-get-begin-query';
|
||||||
useGetBeginNodeDataInputs,
|
|
||||||
useGetBeginNodeDataQueryIsSafe,
|
|
||||||
} from './hooks/use-get-begin-query';
|
|
||||||
import {
|
import {
|
||||||
useSaveGraph,
|
useSaveGraph,
|
||||||
useSaveGraphBeforeOpeningDebugDrawer,
|
useSaveGraphBeforeOpeningDebugDrawer,
|
||||||
@ -69,7 +65,6 @@ export default function Agent() {
|
|||||||
showModal: showChatDrawer,
|
showModal: showChatDrawer,
|
||||||
} = useSetModalState();
|
} = useSetModalState();
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
const { data: userInfo } = useFetchUserInfo();
|
|
||||||
|
|
||||||
// const openDocument = useOpenDocument();
|
// const openDocument = useOpenDocument();
|
||||||
const {
|
const {
|
||||||
@ -99,7 +94,6 @@ export default function Agent() {
|
|||||||
const { showEmbedModal, hideEmbedModal, embedVisible, beta } =
|
const { showEmbedModal, hideEmbedModal, embedVisible, beta } =
|
||||||
useShowEmbedModal();
|
useShowEmbedModal();
|
||||||
const { navigateToAgentLogs } = useNavigatePage();
|
const { navigateToAgentLogs } = useNavigatePage();
|
||||||
const isBeginNodeDataQuerySafe = useGetBeginNodeDataQueryIsSafe();
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<section className="h-full">
|
<section className="h-full">
|
||||||
@ -165,13 +159,7 @@ export default function Agent() {
|
|||||||
{location.hostname !== 'demo.ragflow.io' && (
|
{location.hostname !== 'demo.ragflow.io' && (
|
||||||
<>
|
<>
|
||||||
<DropdownMenuSeparator />
|
<DropdownMenuSeparator />
|
||||||
<AgentDropdownMenuItem
|
<AgentDropdownMenuItem onClick={showEmbedModal}>
|
||||||
onClick={showEmbedModal}
|
|
||||||
disabled={
|
|
||||||
!isBeginNodeDataQuerySafe ||
|
|
||||||
userInfo.nickname !== agentDetail.nickname
|
|
||||||
}
|
|
||||||
>
|
|
||||||
<ScreenShare />
|
<ScreenShare />
|
||||||
{t('common.embedIntoSite')}
|
{t('common.embedIntoSite')}
|
||||||
</AgentDropdownMenuItem>
|
</AgentDropdownMenuItem>
|
||||||
|
|||||||
@ -1,7 +1,9 @@
|
|||||||
import { SharedFrom } from '@/constants/chat';
|
import { SharedFrom } from '@/constants/chat';
|
||||||
|
import { useSetModalState } from '@/hooks/common-hooks';
|
||||||
import { IEventList } from '@/hooks/use-send-message';
|
import { IEventList } from '@/hooks/use-send-message';
|
||||||
import { useSendAgentMessage } from '@/pages/agent/chat/use-send-agent-message';
|
import { useSendAgentMessage } from '@/pages/agent/chat/use-send-agent-message';
|
||||||
import trim from 'lodash/trim';
|
import trim from 'lodash/trim';
|
||||||
|
import { useCallback, useState } from 'react';
|
||||||
import { useSearchParams } from 'umi';
|
import { useSearchParams } from 'umi';
|
||||||
|
|
||||||
export const useSendButtonDisabled = (value: string) => {
|
export const useSendButtonDisabled = (value: string) => {
|
||||||
@ -34,10 +36,30 @@ export const useSendNextSharedMessage = (
|
|||||||
const { from, sharedId: conversationId } = useGetSharedChatSearchParams();
|
const { from, sharedId: conversationId } = useGetSharedChatSearchParams();
|
||||||
const url = `/api/v1/${from === SharedFrom.Agent ? 'agentbots' : 'chatbots'}/${conversationId}/completions`;
|
const url = `/api/v1/${from === SharedFrom.Agent ? 'agentbots' : 'chatbots'}/${conversationId}/completions`;
|
||||||
|
|
||||||
const ret = useSendAgentMessage(url, addEventList);
|
const [params, setParams] = useState<any[]>([]);
|
||||||
|
|
||||||
|
const {
|
||||||
|
visible: parameterDialogVisible,
|
||||||
|
hideModal: hideParameterDialog,
|
||||||
|
showModal: showParameterDialog,
|
||||||
|
} = useSetModalState();
|
||||||
|
|
||||||
|
const ret = useSendAgentMessage(url, addEventList, params);
|
||||||
|
|
||||||
|
const ok = useCallback(
|
||||||
|
(params: any[]) => {
|
||||||
|
setParams(params);
|
||||||
|
hideParameterDialog();
|
||||||
|
},
|
||||||
|
[hideParameterDialog],
|
||||||
|
);
|
||||||
|
|
||||||
return {
|
return {
|
||||||
...ret,
|
...ret,
|
||||||
hasError: false,
|
hasError: false,
|
||||||
|
parameterDialogVisible,
|
||||||
|
hideParameterDialog,
|
||||||
|
showParameterDialog,
|
||||||
|
ok,
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|||||||
@ -3,10 +3,9 @@ import { NextMessageInput } from '@/components/message-input/next';
|
|||||||
import MessageItem from '@/components/next-message-item';
|
import MessageItem from '@/components/next-message-item';
|
||||||
import PdfDrawer from '@/components/pdf-drawer';
|
import PdfDrawer from '@/components/pdf-drawer';
|
||||||
import { useClickDrawer } from '@/components/pdf-drawer/hooks';
|
import { useClickDrawer } from '@/components/pdf-drawer/hooks';
|
||||||
import { MessageType, SharedFrom } from '@/constants/chat';
|
import { MessageType } from '@/constants/chat';
|
||||||
import { useFetchNextConversationSSE } from '@/hooks/chat-hooks';
|
|
||||||
import {
|
import {
|
||||||
useFetchAgentAvatar,
|
useFetchExternalAgentInputs,
|
||||||
useUploadCanvasFileWithProgress,
|
useUploadCanvasFileWithProgress,
|
||||||
} from '@/hooks/use-agent-request';
|
} from '@/hooks/use-agent-request';
|
||||||
import { cn } from '@/lib/utils';
|
import { cn } from '@/lib/utils';
|
||||||
@ -14,11 +13,13 @@ import i18n from '@/locales/config';
|
|||||||
import { useCacheChatLog } from '@/pages/agent/hooks/use-cache-chat-log';
|
import { useCacheChatLog } from '@/pages/agent/hooks/use-cache-chat-log';
|
||||||
import { useSendButtonDisabled } from '@/pages/chat/hooks';
|
import { useSendButtonDisabled } from '@/pages/chat/hooks';
|
||||||
import { buildMessageUuidWithRole } from '@/utils/chat';
|
import { buildMessageUuidWithRole } from '@/utils/chat';
|
||||||
import React, { forwardRef, useCallback, useMemo } from 'react';
|
import { isEmpty } from 'lodash';
|
||||||
|
import React, { forwardRef, useCallback } from 'react';
|
||||||
import {
|
import {
|
||||||
useGetSharedChatSearchParams,
|
useGetSharedChatSearchParams,
|
||||||
useSendNextSharedMessage,
|
useSendNextSharedMessage,
|
||||||
} from '../hooks/use-send-shared-message';
|
} from '../hooks/use-send-shared-message';
|
||||||
|
import { ParameterDialog } from './parameter-dialog';
|
||||||
|
|
||||||
const ChatContainer = () => {
|
const ChatContainer = () => {
|
||||||
const {
|
const {
|
||||||
@ -48,8 +49,13 @@ const ChatContainer = () => {
|
|||||||
stopOutputMessage,
|
stopOutputMessage,
|
||||||
findReferenceByMessageId,
|
findReferenceByMessageId,
|
||||||
appendUploadResponseList,
|
appendUploadResponseList,
|
||||||
|
parameterDialogVisible,
|
||||||
|
hideParameterDialog,
|
||||||
|
showParameterDialog,
|
||||||
|
ok,
|
||||||
} = useSendNextSharedMessage(addEventList);
|
} = useSendNextSharedMessage(addEventList);
|
||||||
|
|
||||||
|
const { data } = useFetchExternalAgentInputs();
|
||||||
const sendDisabled = useSendButtonDisabled(value);
|
const sendDisabled = useSendButtonDisabled(value);
|
||||||
|
|
||||||
// useEffect(() => {
|
// useEffect(() => {
|
||||||
@ -64,12 +70,6 @@ const ChatContainer = () => {
|
|||||||
// }
|
// }
|
||||||
// }, [derivedMessages, setCurrentMessageId]);
|
// }, [derivedMessages, setCurrentMessageId]);
|
||||||
|
|
||||||
const useFetchAvatar = useMemo(() => {
|
|
||||||
return from === SharedFrom.Agent
|
|
||||||
? useFetchAgentAvatar
|
|
||||||
: useFetchNextConversationSSE;
|
|
||||||
}, [from]);
|
|
||||||
|
|
||||||
const handleUploadFile: NonNullable<FileUploadProps['onUpload']> =
|
const handleUploadFile: NonNullable<FileUploadProps['onUpload']> =
|
||||||
useCallback(
|
useCallback(
|
||||||
async (files, options) => {
|
async (files, options) => {
|
||||||
@ -84,12 +84,16 @@ const ChatContainer = () => {
|
|||||||
i18n.changeLanguage(locale);
|
i18n.changeLanguage(locale);
|
||||||
}
|
}
|
||||||
}, [locale, visibleAvatar]);
|
}, [locale, visibleAvatar]);
|
||||||
const { data: avatarData } = useFetchAvatar();
|
|
||||||
|
React.useEffect(() => {
|
||||||
|
if (!isEmpty(data)) {
|
||||||
|
showParameterDialog();
|
||||||
|
}
|
||||||
|
}, [data, showParameterDialog]);
|
||||||
|
|
||||||
if (!conversationId) {
|
if (!conversationId) {
|
||||||
return <div>empty</div>;
|
return <div>empty</div>;
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<section className="h-[100vh] flex justify-center items-center">
|
<section className="h-[100vh] flex justify-center items-center">
|
||||||
<div className=" w-[80vw]">
|
<div className=" w-[80vw]">
|
||||||
@ -108,7 +112,6 @@ const ChatContainer = () => {
|
|||||||
}
|
}
|
||||||
setCurrentMessageId={setCurrentMessageId}
|
setCurrentMessageId={setCurrentMessageId}
|
||||||
key={buildMessageUuidWithRole(message)}
|
key={buildMessageUuidWithRole(message)}
|
||||||
avatarDialog={avatarData.avatar}
|
|
||||||
item={message}
|
item={message}
|
||||||
nickname="You"
|
nickname="You"
|
||||||
reference={findReferenceByMessageId(message.id)}
|
reference={findReferenceByMessageId(message.id)}
|
||||||
@ -156,6 +159,12 @@ const ChatContainer = () => {
|
|||||||
chunk={selectedChunk}
|
chunk={selectedChunk}
|
||||||
></PdfDrawer>
|
></PdfDrawer>
|
||||||
)}
|
)}
|
||||||
|
{parameterDialogVisible && (
|
||||||
|
<ParameterDialog
|
||||||
|
hideModal={hideParameterDialog}
|
||||||
|
ok={ok}
|
||||||
|
></ParameterDialog>
|
||||||
|
)}
|
||||||
</section>
|
</section>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|||||||
33
web/src/pages/next-chats/share/parameter-dialog.tsx
Normal file
33
web/src/pages/next-chats/share/parameter-dialog.tsx
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
import {
|
||||||
|
Dialog,
|
||||||
|
DialogContent,
|
||||||
|
DialogHeader,
|
||||||
|
DialogTitle,
|
||||||
|
} from '@/components/ui/dialog';
|
||||||
|
import { useFetchExternalAgentInputs } from '@/hooks/use-agent-request';
|
||||||
|
import { IModalProps } from '@/interfaces/common';
|
||||||
|
import DebugContent from '@/pages/agent/debug-content';
|
||||||
|
import { buildBeginInputListFromObject } from '@/pages/agent/form/begin-form/utils';
|
||||||
|
|
||||||
|
interface IProps extends IModalProps<any> {
|
||||||
|
ok(parameters: any[]): void;
|
||||||
|
}
|
||||||
|
export function ParameterDialog({ hideModal, ok }: IProps) {
|
||||||
|
const { data } = useFetchExternalAgentInputs();
|
||||||
|
|
||||||
|
return (
|
||||||
|
<Dialog open onOpenChange={hideModal}>
|
||||||
|
<DialogContent>
|
||||||
|
<DialogHeader>
|
||||||
|
<DialogTitle>Parameter</DialogTitle>
|
||||||
|
</DialogHeader>
|
||||||
|
<DebugContent
|
||||||
|
parameters={buildBeginInputListFromObject(data)}
|
||||||
|
ok={ok}
|
||||||
|
isNext={false}
|
||||||
|
btnText={'Submit'}
|
||||||
|
></DebugContent>
|
||||||
|
</DialogContent>
|
||||||
|
</Dialog>
|
||||||
|
);
|
||||||
|
}
|
||||||
@ -24,6 +24,7 @@ const {
|
|||||||
fetchCanvas,
|
fetchCanvas,
|
||||||
fetchAgentAvatar,
|
fetchAgentAvatar,
|
||||||
fetchAgentLogs,
|
fetchAgentLogs,
|
||||||
|
fetchExternalAgentInputs,
|
||||||
} = api;
|
} = api;
|
||||||
|
|
||||||
const methods = {
|
const methods = {
|
||||||
@ -107,6 +108,10 @@ const methods = {
|
|||||||
url: fetchAgentLogs,
|
url: fetchAgentLogs,
|
||||||
method: 'get',
|
method: 'get',
|
||||||
},
|
},
|
||||||
|
fetchExternalAgentInputs: {
|
||||||
|
url: fetchExternalAgentInputs,
|
||||||
|
method: 'get',
|
||||||
|
},
|
||||||
} as const;
|
} as const;
|
||||||
|
|
||||||
const agentService = registerNextServer<keyof typeof methods>(methods);
|
const agentService = registerNextServer<keyof typeof methods>(methods);
|
||||||
|
|||||||
@ -1,4 +1,5 @@
|
|||||||
let api_host = `/v1`;
|
let api_host = `/v1`;
|
||||||
|
const ExternalApi = `/api`;
|
||||||
|
|
||||||
export { api_host };
|
export { api_host };
|
||||||
|
|
||||||
@ -155,6 +156,8 @@ export default {
|
|||||||
uploadAgentFile: (id?: string) => `${api_host}/canvas/upload/${id}`,
|
uploadAgentFile: (id?: string) => `${api_host}/canvas/upload/${id}`,
|
||||||
fetchAgentLogs: (canvasId: string) =>
|
fetchAgentLogs: (canvasId: string) =>
|
||||||
`${api_host}/canvas/${canvasId}/sessions`,
|
`${api_host}/canvas/${canvasId}/sessions`,
|
||||||
|
fetchExternalAgentInputs: (canvasId: string) =>
|
||||||
|
`${ExternalApi}${api_host}/agentbots/${canvasId}/inputs`,
|
||||||
|
|
||||||
// mcp server
|
// mcp server
|
||||||
listMcpServer: `${api_host}/mcp_server/list`,
|
listMcpServer: `${api_host}/mcp_server/list`,
|
||||||
|
|||||||
Reference in New Issue
Block a user