From 567a61ac10460215128fc5166324726ac393486d Mon Sep 17 00:00:00 2001 From: Henry Date: Sat, 17 Jun 2023 23:35:41 +0100 Subject: [PATCH] add fontsize and chatflowconfig customization --- .../ui/src/ui-component/dialog/APICodeDialog.js | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/packages/ui/src/ui-component/dialog/APICodeDialog.js b/packages/ui/src/ui-component/dialog/APICodeDialog.js index e2e7438d7..e64f4bf86 100644 --- a/packages/ui/src/ui-component/dialog/APICodeDialog.js +++ b/packages/ui/src/ui-component/dialog/APICodeDialog.js @@ -135,6 +135,9 @@ const embedCodeCustomization = (chatflowid) => { Chatbot.init({ chatflowid: "${chatflowid}", apiHost: "${baseURL}", + chatflowConfig: { + // topK: 2 + }, theme: { button: { backgroundColor: "#3B81F6", @@ -149,6 +152,7 @@ const embedCodeCustomization = (chatflowid) => { backgroundColor: "#ffffff", height: 700, width: 400, + fontSize: 16, poweredByTextColor: "#303235", botMessage: { backgroundColor: "#f7f8ff", @@ -189,6 +193,7 @@ const APICodeDialog = ({ show, dialogProps, onCancel }) => { const getAllAPIKeysApi = useApi(apiKeyApi.getAllAPIKeys) const updateChatflowApi = useApi(chatflowsApi.updateChatflow) + const getIsChatflowStreamingApi = useApi(chatflowsApi.getIsChatflowStreaming) const getConfigApi = useApi(configApi.getConfig) const onCheckBoxChanged = (newVal) => { @@ -553,6 +558,7 @@ query({ useEffect(() => { if (show) { getAllAPIKeysApi.request() + getIsChatflowStreamingApi.request(dialogProps.chatflowid) } // eslint-disable-next-line react-hooks/exhaustive-deps @@ -665,6 +671,15 @@ query({ wrapLines /> )} + {value !== 0 && getIsChatflowStreamingApi.data?.isStreaming && ( +

+ Read  + + here + +  on how to stream response back to application +

+ )} ))}