Skip to content

Commit

Permalink
Merge pull request FlowiseAI#359 from FlowiseAI/feature/EmbedCustomiz…
Browse files Browse the repository at this point in the history
…ation

Feature/EmbedChat Customization
  • Loading branch information
HenryHengZJ authored Jun 18, 2023
2 parents c0e88d4 + 567a61a commit ba22b36
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions packages/ui/src/ui-component/dialog/APICodeDialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,9 @@ const embedCodeCustomization = (chatflowid) => {
Chatbot.init({
chatflowid: "${chatflowid}",
apiHost: "${baseURL}",
chatflowConfig: {
// topK: 2
},
theme: {
button: {
backgroundColor: "#3B81F6",
Expand All @@ -149,6 +152,7 @@ const embedCodeCustomization = (chatflowid) => {
backgroundColor: "#ffffff",
height: 700,
width: 400,
fontSize: 16,
poweredByTextColor: "#303235",
botMessage: {
backgroundColor: "#f7f8ff",
Expand Down Expand Up @@ -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) => {
Expand Down Expand Up @@ -553,6 +558,7 @@ query({
useEffect(() => {
if (show) {
getAllAPIKeysApi.request()
getIsChatflowStreamingApi.request(dialogProps.chatflowid)
}

// eslint-disable-next-line react-hooks/exhaustive-deps
Expand Down Expand Up @@ -665,6 +671,15 @@ query({
wrapLines
/>
)}
{value !== 0 && getIsChatflowStreamingApi.data?.isStreaming && (
<p>
Read&nbsp;
<a rel='noreferrer' target='_blank' href='https://docs.flowiseai.com/how-to-use#streaming'>
here
</a>
&nbsp;on how to stream response back to application
</p>
)}
</TabPanel>
))}
</DialogContent>
Expand Down

0 comments on commit ba22b36

Please sign in to comment.