({
- queryKey: ['fetchSystemTokenList', params],
+ queryKey: ['fetchSystemTokenList'],
initialData: [],
gcTime: 0,
queryFn: async () => {
- const { data } = await userService.listToken(params);
+ const { data } = await userService.listToken();
return data?.data ?? [];
},
@@ -213,6 +230,7 @@ export const useRemoveSystemToken = () => {
export const useCreateSystemToken = () => {
const queryClient = useQueryClient();
+
const {
data,
isPending: loading,
diff --git a/web/src/interfaces/database/chat.ts b/web/src/interfaces/database/chat.ts
index e00d4ed7..7b21510c 100644
--- a/web/src/interfaces/database/chat.ts
+++ b/web/src/interfaces/database/chat.ts
@@ -1,5 +1,4 @@
import { MessageType } from '@/constants/chat';
-import { IChunk } from './knowledge';
export interface PromptConfig {
empty_response: string;
@@ -35,7 +34,7 @@ export interface IDialog {
description: string;
icon: string;
id: string;
- dialog_id?: string;
+ dialog_id: string;
kb_ids: string[];
kb_names: string[];
language: string;
@@ -75,8 +74,21 @@ export interface Message {
audio_binary?: string;
}
+export interface IReferenceChunk {
+ id: string;
+ content: null;
+ document_id: string;
+ document_name: string;
+ dataset_id: string;
+ image_id: string;
+ similarity: number;
+ vector_similarity: number;
+ term_similarity: number;
+ positions: number[];
+}
+
export interface IReference {
- chunks: IChunk[];
+ chunks: IReferenceChunk[];
doc_aggs: Docagg[];
total: number;
}
@@ -117,6 +129,7 @@ export interface IToken {
token: string;
update_date?: any;
update_time?: any;
+ beta: string;
}
export interface IStats {
diff --git a/web/src/locales/config.ts b/web/src/locales/config.ts
index 0da80e59..83f6ca42 100644
--- a/web/src/locales/config.ts
+++ b/web/src/locales/config.ts
@@ -2,11 +2,11 @@ import i18n from 'i18next';
import LanguageDetector from 'i18next-browser-languagedetector';
import { initReactI18next } from 'react-i18next';
-import { createTranslationTable, flattenObject } from './until';
import translation_en from './en';
import translation_es from './es';
import translation_id from './id';
import translation_ja from './ja';
+import { createTranslationTable, flattenObject } from './until';
import translation_vi from './vi';
import translation_zh from './zh';
import translation_zh_traditional from './zh-traditional';
diff --git a/web/src/locales/en.ts b/web/src/locales/en.ts
index 06ec1c56..cc9fb5bc 100644
--- a/web/src/locales/en.ts
+++ b/web/src/locales/en.ts
@@ -432,6 +432,7 @@ The above is the content you need to summarize.`,
partialTitle: 'Partial Embed',
extensionTitle: 'Chrome Extension',
tokenError: 'Please create API Token first!',
+ betaError: 'The beta field of the API Token cannot be empty!',
searching: 'searching...',
parsing: 'Parsing',
uploading: 'Uploading',
diff --git a/web/src/locales/ja.ts b/web/src/locales/ja.ts
index 9f55d1d8..0a0f63e6 100644
--- a/web/src/locales/ja.ts
+++ b/web/src/locales/ja.ts
@@ -33,6 +33,7 @@ export default {
pleaseSelect: '選択してください',
pleaseInput: '入力してください',
submit: '送信',
+ japanese: '日本語',
},
login: {
login: 'ログイン',
@@ -85,8 +86,7 @@ export default {
name: '名前',
namePlaceholder: '名前を入力してください',
doc: 'ドキュメント',
- datasetDescription:
- '😉 パースが成功すると、質問と回答が可能になります。',
+ datasetDescription: '😉 パースが成功すると、質問と回答が可能になります。',
addFile: 'ファイルを追加',
searchFiles: 'ファイルを検索',
localFiles: 'ローカルファイル',
@@ -157,8 +157,7 @@ export default {
topK: 'トップK',
topKTip: `Kチャンクがリランキングモデルに供給されます。`,
delimiter: `区切り文字`,
- delimiterTip:
- '複数文字の区切り文字をサポートしています。',
+ delimiterTip: '複数文字の区切り文字をサポートしています。',
html4excel: 'ExcelをHTMLに変換',
html4excelTip: `有効にすると、スプレッドシートはHTMLテーブルとして解析されます。それ以外の場合、キーと値のペアとして解析されます。`,
autoKeywords: '自動キーワード',
@@ -182,7 +181,7 @@ export default {
embeddingModelTip:
'チャンクを埋め込みに変換するモデルです。一度チャンクが作成されると変更できません。',
permissionsTip:
- "「チーム」に設定すると、全てのチームメンバーがナレッジベースを管理できます。",
+ '「チーム」に設定すると、全てのチームメンバーがナレッジベースを管理できます。',
chunkTokenNumberTip:
'チャンクのトークンしきい値を設定します。このしきい値を下回る段落は、次の段落と結合され、しきい値を超えた時点でチャンクが作成されます。',
chunkMethod: 'チャンク方法',
@@ -201,8 +200,7 @@ export default {
methodExamplesDescription:
'以下のスクリーンショットは明確な説明のために提供されています。',
dialogueExamplesTitle: '会話の例',
- methodEmpty:
- 'ナレッジベースカテゴリの視覚的説明がここに表示されます',
+ methodEmpty: 'ナレッジベースカテゴリの視覚的説明がここに表示されます',
book: `対応ファイル形式はDOCX, PDF, TXTです。
PDF形式の書籍では、解析時間を短縮するため、ページ範囲を設定してください。
`,
laws: `対応ファイル形式はDOCX, PDF, TXTです。
@@ -305,7 +303,7 @@ export default {
entityTypes: 'エンティティタイプ',
pageRank: 'ページランク',
pageRankTip: `これは関連性スコアを高めるために使用されます。すべての取得されたチャンクの関連性スコアにこの数値が加算されます。
-特定のナレッジベースを最初に検索したい場合は、他のものよりも高いページランクスコアを設定してください。`
+特定のナレッジベースを最初に検索したい場合は、他のものよりも高いページランクスコアを設定してください。`,
},
chunk: {
chunk: 'チャンク',
@@ -360,8 +358,7 @@ export default {
{knowledge}
上記がナレッジベースです。`,
systemMessage: '入力してください!',
- systemTip:
- 'LLMが質問に答える際に従う指示を設定します。',
+ systemTip: 'LLMが質問に答える際に従う指示を設定します。',
topN: 'トップN',
topNTip: `類似度スコアがしきい値を超えるチャンクのうち、上位N件のみがLLMに供給されます。`,
variable: '変数',
@@ -406,7 +403,8 @@ export default {
quote: '引用を表示',
quoteTip: '元のテキストの出典を表示しますか?',
selfRag: 'Self-RAG',
- selfRagTip: '詳細は次を参照してください:https://huggingface.co/papers/2310.11511',
+ selfRagTip:
+ '詳細は次を参照してください:https://huggingface.co/papers/2310.11511',
overview: 'チャットID',
pv: 'メッセージ数',
uv: 'アクティブユーザー数',
@@ -486,7 +484,7 @@ export default {
newPassword: '新しいパスワード',
newPasswordMessage: 'パスワードを入力してください!',
newPasswordDescription:
- '新しいパスワードは8文字以上でなければなりません。',
+ '新しいパスワードは8文字以上でなければなりません。',
confirmPassword: '新しいパスワードの確認',
confirmPasswordMessage: 'パスワードを確認してください!',
confirmPasswordNonMatchMessage:
@@ -568,7 +566,7 @@ export default {
SparkModelNameMessage: 'Sparkモデルを選択してください',
addSparkAPIPassword: 'Spark APIパスワード',
SparkAPIPasswordMessage: 'APIパスワードを入力してください',
- addSparkAPPID: 'Spark APPID',
+ addSparkAPPID: 'Spark APPID',
SparkAPPIDMessage: 'APPIDを入力してください',
addSparkAPISecret: 'Spark APIシークレット',
SparkAPISecretMessage: 'APIシークレットを入力してください',
@@ -579,8 +577,7 @@ export default {
yiyanAKMessage: 'APIキーを入力してください',
addyiyanSK: 'yiyanシークレットキー',
yiyanSKMessage: 'シークレットキーを入力してください',
- FishAudioModelNameMessage:
- '音声合成モデルに名前を付けてください',
+ FishAudioModelNameMessage: '音声合成モデルに名前を付けてください',
addFishAudioAK: 'Fish Audio APIキー',
addFishAudioAKMessage: 'APIキーを入力してください',
addFishAudioRefID: 'FishAudio参照ID',
@@ -700,7 +697,7 @@ export default {
relevantDescription: `LLMを使用して、上流の出力がユーザーの最新のクエリに関連しているかどうかを評価するコンポーネント。各判定結果に対して次のコンポーネントを指定してください。`,
rewriteQuestionDescription: `ナレッジベースから関連情報を取得できなかった場合にユーザーのクエリを修正するコンポーネント。定義されたループの上限に達するまでこのプロセスを繰り返します。上流が「Relevant」、下流が「Retrieval」であることを確認してください。`,
messageDescription:
- "静的メッセージを送信するコンポーネント。複数のメッセージが提供されている場合は、その中からランダムに1つを選択して送信します。下流がインターフェースコンポーネント「Answer」であることを確認してください。",
+ '静的メッセージを送信するコンポーネント。複数のメッセージが提供されている場合は、その中からランダムに1つを選択して送信します。下流がインターフェースコンポーネント「Answer」であることを確認してください。',
keywordDescription: `ユーザーの入力からトップNの検索結果を取得するコンポーネント。使用前にTopNの値が適切に設定されていることを確認してください。`,
switchDescription: `前のコンポーネントの出力に基づいて条件を評価し、それに応じて実行の流れを指示するコンポーネント。ケースを定義し、各ケースのアクションまたは条件が満たされない場合のデフォルトアクションを指定することで、複雑な分岐ロジックを可能にします。`,
wikipediaDescription: `wikipedia.orgから検索を行うコンポーネントで、TopNを使用して検索結果の数を指定します。既存のナレッジベースを補完します。`,
@@ -800,7 +797,7 @@ export default {
news: 'ニュースと情報',
law: '法律と規制',
contract: '契約',
- },
+ },
baiduSourceLangOptions: {
auto: '自動検出',
zh: '中国語',
@@ -1089,4 +1086,4 @@ export default {
chat: 'チャット',
},
},
-};
\ No newline at end of file
+};
diff --git a/web/src/locales/zh-traditional.ts b/web/src/locales/zh-traditional.ts
index 8c1bcf90..807ec96b 100644
--- a/web/src/locales/zh-traditional.ts
+++ b/web/src/locales/zh-traditional.ts
@@ -414,6 +414,7 @@ export default {
partialTitle: '部分嵌入',
extensionTitle: 'Chrome 插件',
tokenError: '請先創建 API Token!',
+ betaError: 'API Token的beta欄位不可以為空!',
searching: '搜索中',
parsing: '解析中',
uploading: '上傳中',
diff --git a/web/src/locales/zh.ts b/web/src/locales/zh.ts
index 7c05488b..fb8ed55a 100644
--- a/web/src/locales/zh.ts
+++ b/web/src/locales/zh.ts
@@ -431,6 +431,7 @@ export default {
partialTitle: '部分嵌入',
extensionTitle: 'Chrome 插件',
tokenError: '请先创建 API Token!',
+ betaError: 'API Token的beta字段不可以为空!',
searching: '搜索中',
parsing: '解析中',
uploading: '上传中',
diff --git a/web/src/pages/chat/index.tsx b/web/src/pages/chat/index.tsx
index 03b132ae..ffc1461f 100644
--- a/web/src/pages/chat/index.tsx
+++ b/web/src/pages/chat/index.tsx
@@ -29,18 +29,20 @@ import {
useSelectDerivedConversationList,
} from './hooks';
+import EmbedModal from '@/components/api-service/embed-modal';
+import { useShowEmbedModal } from '@/components/api-service/hooks';
import SvgIcon from '@/components/svg-icon';
import { useTheme } from '@/components/theme-provider';
+import { SharedFrom } from '@/constants/chat';
import {
useClickConversationCard,
useClickDialogCard,
useFetchNextDialogList,
useGetChatSearchParams,
} from '@/hooks/chat-hooks';
-import { useSetModalState, useTranslate } from '@/hooks/common-hooks';
+import { useTranslate } from '@/hooks/common-hooks';
import { useSetSelectedRecord } from '@/hooks/logic-hooks';
import { IDialog } from '@/interfaces/database/chat';
-import ChatIdModal from './chat-id-modal';
import styles from './index.less';
const { Text } = Typography;
@@ -82,13 +84,10 @@ const Chat = () => {
showDialogEditModal,
} = useEditDialog();
const { t } = useTranslate('chat');
- const {
- visible: overviewVisible,
- hideModal: hideOverviewModal,
- showModal: showOverviewModal,
- } = useSetModalState();
const { currentRecord, setRecord } = useSetSelectedRecord();
const [controller, setController] = useState(new AbortController());
+ const { showEmbedModal, hideEmbedModal, embedVisible, beta } =
+ useShowEmbedModal();
const handleAppCardEnter = (id: string) => () => {
handleItemEnter(id);
@@ -120,7 +119,7 @@ const Chat = () => {
info?.domEvent?.preventDefault();
info?.domEvent?.stopPropagation();
setRecord(dialog);
- showOverviewModal();
+ showEmbedModal();
};
const handleRemoveConversation =
@@ -193,7 +192,7 @@ const Chat = () => {
label: (
- {t('overview')}
+ {t('publish', { keyPrefix: 'flow' })}
),
},
@@ -374,14 +373,16 @@ const Chat = () => {
initialName={initialConversationName}
loading={conversationRenameLoading}
>
- {overviewVisible && (
-
+
+ {embedVisible && (
+
)}
);
diff --git a/web/src/pages/chat/markdown-content/index.tsx b/web/src/pages/chat/markdown-content/index.tsx
index bf2b5dc0..5e0d30c2 100644
--- a/web/src/pages/chat/markdown-content/index.tsx
+++ b/web/src/pages/chat/markdown-content/index.tsx
@@ -1,7 +1,6 @@
import Image from '@/components/image';
import SvgIcon from '@/components/svg-icon';
-import { IReference } from '@/interfaces/database/chat';
-import { IChunk } from '@/interfaces/database/knowledge';
+import { IReference, IReferenceChunk } from '@/interfaces/database/chat';
import { getExtension } from '@/utils/document-util';
import { InfoCircleOutlined } from '@ant-design/icons';
import { Button, Flex, Popover, Space } from 'antd';
@@ -11,6 +10,7 @@ import Markdown from 'react-markdown';
import reactStringReplace from 'react-string-replace';
import SyntaxHighlighter from 'react-syntax-highlighter';
import rehypeKatex from 'rehype-katex';
+import rehypeRaw from 'rehype-raw';
import remarkGfm from 'remark-gfm';
import remarkMath from 'remark-math';
import { visitParents } from 'unist-util-visit-parents';
@@ -36,7 +36,7 @@ const MarkdownContent = ({
content: string;
loading: boolean;
reference: IReference;
- clickDocumentButton?: (documentId: string, chunk: IChunk) => void;
+ clickDocumentButton?: (documentId: string, chunk: IReferenceChunk) => void;
}) => {
const { t } = useTranslation();
const { setDocumentIds, data: fileThumbnails } =
@@ -54,7 +54,7 @@ const MarkdownContent = ({
}, [reference, setDocumentIds]);
const handleDocumentButtonClick = useCallback(
- (documentId: string, chunk: IChunk, isPdf: boolean) => () => {
+ (documentId: string, chunk: IReferenceChunk, isPdf: boolean) => () => {
if (!isPdf) {
return;
}
@@ -85,15 +85,15 @@ const MarkdownContent = ({
const chunks = reference?.chunks ?? [];
const chunkItem = chunks[chunkIndex];
const document = reference?.doc_aggs?.find(
- (x) => x?.doc_id === chunkItem?.doc_id,
+ (x) => x?.doc_id === chunkItem?.document_id,
);
const documentId = document?.doc_id;
const fileThumbnail = documentId ? fileThumbnails[documentId] : '';
const fileExtension = documentId ? getExtension(document?.doc_name) : '';
- const imageId = chunkItem?.img_id;
+ const imageId = chunkItem?.image_id;
return (
@@ -116,7 +116,7 @@ const MarkdownContent = ({
@@ -176,7 +176,7 @@ const MarkdownContent = ({
return (
{
- const { conversationId } = useCreateSharedConversationOnMount();
- const { data } = useFetchNextSharedConversation(conversationId);
+ const { from, sharedId: conversationId } = useGetSharedChatSearchParams();
+ const { visible, hideModal, documentId, selectedChunk, clickDocumentButton } =
+ useClickDrawer();
const {
handlePressEnter,
@@ -25,9 +27,13 @@ const ChatContainer = () => {
loading,
ref,
derivedMessages,
- } = useSendSharedMessage(conversationId);
+ hasError,
+ } = useSendSharedMessage();
const sendDisabled = useSendButtonDisabled(value);
- const { from } = useGetSharedChatSearchParams();
+
+ if (!conversationId) {
+ return empty
;
+ }
return (
<>
@@ -44,7 +50,7 @@ const ChatContainer = () => {
reference={buildMessageItemReference(
{
message: derivedMessages,
- reference: data?.data?.reference,
+ reference: [],
},
message,
)}
@@ -54,6 +60,7 @@ const ChatContainer = () => {
derivedMessages?.length - 1 === i
}
index={i}
+ clickDocumentButton={clickDocumentButton}
>
);
})}
@@ -65,7 +72,7 @@ const ChatContainer = () => {
{
showUploadIcon={from === SharedFrom.Chat}
>
+ {visible && (
+
+ )}
>
);
};
diff --git a/web/src/pages/chat/shared-hooks.ts b/web/src/pages/chat/shared-hooks.ts
index 8508746e..99bab686 100644
--- a/web/src/pages/chat/shared-hooks.ts
+++ b/web/src/pages/chat/shared-hooks.ts
@@ -1,83 +1,41 @@
import { MessageType, SharedFrom } from '@/constants/chat';
-import {
- useCreateNextSharedConversation,
- useFetchNextSharedConversation,
-} from '@/hooks/chat-hooks';
+import { useCreateNextSharedConversation } from '@/hooks/chat-hooks';
import {
useSelectDerivedMessages,
useSendMessageWithSse,
} from '@/hooks/logic-hooks';
import { Message } from '@/interfaces/database/chat';
-import api from '@/utils/api';
+import { message } from 'antd';
+import { get } from 'lodash';
import trim from 'lodash/trim';
import { useCallback, useEffect, useState } from 'react';
import { useSearchParams } from 'umi';
import { v4 as uuid } from 'uuid';
import { useHandleMessageInputChange } from './hooks';
-export const useCreateSharedConversationOnMount = () => {
- const [currentQueryParameters] = useSearchParams();
- const [conversationId, setConversationId] = useState('');
-
- const { createSharedConversation: createConversation } =
- useCreateNextSharedConversation();
- const sharedId = currentQueryParameters.get('shared_id');
- const userId = currentQueryParameters.get('user_id');
-
- const setConversation = useCallback(async () => {
- if (sharedId) {
- const data = await createConversation(userId ?? undefined);
- const id = data.data?.id;
- if (id) {
- setConversationId(id);
- }
- }
- }, [createConversation, sharedId, userId]);
-
- useEffect(() => {
- setConversation();
- }, [setConversation]);
-
- return { conversationId };
-};
-
-export const useSelectNextSharedMessages = (conversationId: string) => {
- const { data, loading } = useFetchNextSharedConversation(conversationId);
-
- const {
- derivedMessages,
- ref,
- setDerivedMessages,
- addNewestAnswer,
- addNewestQuestion,
- removeLatestMessage,
- } = useSelectDerivedMessages();
-
- useEffect(() => {
- setDerivedMessages(data?.data?.message);
- }, [setDerivedMessages, data]);
-
- return {
- derivedMessages,
- addNewestAnswer,
- addNewestQuestion,
- removeLatestMessage,
- loading,
- ref,
- setDerivedMessages,
- };
-};
+const isCompletionError = (res: any) =>
+ res && (res?.response.status !== 200 || res?.data?.code !== 0);
export const useSendButtonDisabled = (value: string) => {
return trim(value) === '';
};
-export const useSendSharedMessage = (conversationId: string) => {
+export const useGetSharedChatSearchParams = () => {
+ const [searchParams] = useSearchParams();
+
+ return {
+ from: searchParams.get('from') as SharedFrom,
+ sharedId: searchParams.get('shared_id'),
+ };
+};
+
+export const useSendSharedMessage = () => {
+ const { from, sharedId: conversationId } = useGetSharedChatSearchParams();
const { createSharedConversation: setConversation } =
useCreateNextSharedConversation();
const { handleInputChange, value, setValue } = useHandleMessageInputChange();
const { send, answer, done } = useSendMessageWithSse(
- api.completeExternalConversation,
+ `/api/v1/${from === SharedFrom.Agent ? 'agentbots' : 'chatbots'}/${conversationId}/completions`,
);
const {
derivedMessages,
@@ -85,24 +43,25 @@ export const useSendSharedMessage = (conversationId: string) => {
removeLatestMessage,
addNewestAnswer,
addNewestQuestion,
- loading,
- } = useSelectNextSharedMessages(conversationId);
+ } = useSelectDerivedMessages();
+ const [hasError, setHasError] = useState(false);
const sendMessage = useCallback(
async (message: Message, id?: string) => {
const res = await send({
conversation_id: id ?? conversationId,
- quote: false,
- messages: [...(derivedMessages ?? []), message],
+ quote: true,
+ question: message.content,
+ session_id: get(derivedMessages, '0.session_id'),
});
- if (res && (res?.response.status !== 200 || res?.data?.code !== 0)) {
+ if (isCompletionError(res)) {
// cancel loading
setValue(message.content);
removeLatestMessage();
}
},
- [conversationId, derivedMessages, removeLatestMessage, setValue, send],
+ [send, conversationId, derivedMessages, setValue, removeLatestMessage],
);
const handleSendMessage = useCallback(
@@ -120,6 +79,18 @@ export const useSendSharedMessage = (conversationId: string) => {
[conversationId, setConversation, sendMessage],
);
+ const fetchSessionId = useCallback(async () => {
+ const ret = await send({ question: '' });
+ if (isCompletionError(ret)) {
+ message.error(ret?.data.message);
+ setHasError(true);
+ }
+ }, [send]);
+
+ useEffect(() => {
+ fetchSessionId();
+ }, [fetchSessionId, send]);
+
useEffect(() => {
if (answer.answer) {
addNewestAnswer(answer);
@@ -154,16 +125,8 @@ export const useSendSharedMessage = (conversationId: string) => {
value,
sendLoading: !done,
ref,
- loading,
+ loading: false,
derivedMessages,
- };
-};
-
-export const useGetSharedChatSearchParams = () => {
- const [searchParams] = useSearchParams();
-
- return {
- from: searchParams.get('from') as SharedFrom,
- sharedId: searchParams.get('shared_id'),
+ hasError,
};
};
diff --git a/web/src/pages/flow/header/index.tsx b/web/src/pages/flow/header/index.tsx
index 6bf5aa9e..5b5d4757 100644
--- a/web/src/pages/flow/header/index.tsx
+++ b/web/src/pages/flow/header/index.tsx
@@ -1,13 +1,15 @@
-import ChatOverviewModal from '@/components/api-service/chat-overview-modal';
-import { useSetModalState, useTranslate } from '@/hooks/common-hooks';
+import EmbedModal from '@/components/api-service/embed-modal';
+import { useShowEmbedModal } from '@/components/api-service/hooks';
+import { SharedFrom } from '@/constants/chat';
+import { useTranslate } from '@/hooks/common-hooks';
import { useFetchFlow } from '@/hooks/flow-hooks';
import { ArrowLeftOutlined } from '@ant-design/icons';
import { Button, Flex, Space } from 'antd';
import { useCallback } from 'react';
import { Link, useParams } from 'umi';
-import FlowIdModal from '../flow-id-modal';
import {
useGetBeginNodeDataQuery,
+ useGetBeginNodeDataQueryIsEmpty,
useSaveGraph,
useSaveGraphBeforeOpeningDebugDrawer,
useWatchAgentChange,
@@ -25,15 +27,16 @@ const FlowHeader = ({ showChatDrawer, chatDrawerVisible }: IProps) => {
const { handleRun } = useSaveGraphBeforeOpeningDebugDrawer(showChatDrawer);
const { data } = useFetchFlow();
const { t } = useTranslate('flow');
- const {
- visible: overviewVisible,
- hideModal: hideOverviewModal,
- // showModal: showOverviewModal,
- } = useSetModalState();
- const { visible, hideModal, showModal } = useSetModalState();
const { id } = useParams();
const time = useWatchAgentChange(chatDrawerVisible);
const getBeginNodeDataQuery = useGetBeginNodeDataQuery();
+ const { showEmbedModal, hideEmbedModal, embedVisible, beta } =
+ useShowEmbedModal();
+ const isBeginNodeDataQueryEmpty = useGetBeginNodeDataQueryIsEmpty();
+
+ const handleShowEmbedModal = useCallback(() => {
+ showEmbedModal();
+ }, [showEmbedModal]);
const handleRunAgent = useCallback(() => {
const query: BeginQuery[] = getBeginNodeDataQuery();
@@ -70,23 +73,25 @@ const FlowHeader = ({ showChatDrawer, chatDrawerVisible }: IProps) => {
- {/*