Skip to content

Commit

Permalink
Merge pull request #11 from Hostcomm/main
Browse files Browse the repository at this point in the history
updates
  • Loading branch information
birksy89 authored Oct 30, 2024
2 parents ebc4641 + dfaf8c6 commit 844b9b3
Show file tree
Hide file tree
Showing 13 changed files with 1,652 additions and 1,864 deletions.
1 change: 1 addition & 0 deletions packages/server/.env.example
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
PORT=3000
CXCORTEX_CONSOLE_URL="https://console.cxcortex.ai"

# APIKEY_PATH=/your_api_key_path/.flowise
# SECRETKEY_PATH=/your_api_key_path/.flowise
Expand Down
18 changes: 18 additions & 0 deletions packages/server/src/utils/addChatMesage.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { ChatMessage } from '../database/entities/ChatMessage'
import { IChatMessage } from '../Interface'
import { getRunningExpressApp } from '../utils/getRunningExpressApp'
import axios from 'axios'

/**
* Method that add chat messages.
Expand All @@ -15,5 +16,22 @@ export const utilAddChatMessage = async (chatMessage: Partial<IChatMessage>): Pr
}
const chatmessage = await appServer.AppDataSource.getRepository(ChatMessage).create(newChatMessage)
const dbResponse = await appServer.AppDataSource.getRepository(ChatMessage).save(chatmessage)

// When a chat message is created, we want to post it to the CXCortex Console
try {
const cxcortexURL = `${process.env.CXCORTEX_CONSOLE_URL}/api/webhook/flowise`

// Perform the post to the CXCortex Console
const response = await axios.post(cxcortexURL, {
...dbResponse
})

if (response.status !== 200) {
console.error(`Error posting chat message to CXCortex Console: ${response.statusText}`)
}
} catch (error) {
console.error(error)
}

return dbResponse
}
26 changes: 13 additions & 13 deletions packages/ui/index.html
Original file line number Diff line number Diff line change
@@ -1,29 +1,29 @@
<!DOCTYPE html>
<html lang="en">
<head>
<title>Flowise - Low-code LLM apps builder</title>
<link rel="icon" href="favicon.ico" />
<title>CXCortex Agents</title>
<link rel="icon" href="/favicon.ico" />
<!-- Meta Tags-->
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="theme-color" content="#2296f3" />
<meta name="title" content="Flowise - Low-code LLM apps builder" />
<meta name="description" content="Drag & drop UI to build your customized LLM flow" />
<meta name="title" content="CXCortex Agents" />
<meta name="description" content="CXCortex Agents - AI Powered Chat Solutions" />
<meta name="keywords" content="react, material-ui, workflow automation, llm, artificial-intelligence" />
<meta name="author" content="FlowiseAI" />
<meta name="author" content="CXCortex" />
<!-- Open Graph / Facebook -->
<meta property="og:locale" content="en_US" />
<meta property="og:type" content="website" />
<meta property="og:url" content="https://flowiseai.com/" />
<meta property="og:site_name" content="flowiseai.com" />
<meta property="og:title" content="Flowise - Low-code LLM apps builder" />
<meta property="og:description" content="Drag & drop UI to build your customized LLM flow" />
<meta property="og:url" content="https://console.cxcortex.ai/" />
<meta property="og:site_name" content="CXCortex.com" />
<meta property="og:title" content="CXCortex Agents" />
<meta property="og:description" content="CXCortex Agents - AI Powered Chat Solutions" />
<!-- Twitter -->
<meta property="twitter:card" content="summary_large_image" />
<meta property="twitter:url" content="https://twitter.com/FlowiseAI" />
<meta property="twitter:title" content="Flowise - Low-code LLM apps builder" />
<meta property="twitter:description" content="Drag & drop UI to build your customized LLM flow" />
<meta name="twitter:creator" content="@FlowiseAI" />
<meta property="twitter:url" content="https://twitter.com/CXCortex" />
<meta property="twitter:title" content="CXCortex Agents" />
<meta property="twitter:description" content="CXCortex Agents - AI Powered Chat Solutions" />
<meta name="twitter:creator" content="@CXCortex" />

<link rel="preconnect" href="https://fonts.gstatic.com" />
<link
Expand Down
2 changes: 2 additions & 0 deletions packages/ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
"email": "henryheng@flowiseai.com"
},
"dependencies": {
"@birksy89/flowise-embed": "^1.2.3",
"@birksy89/flowise-embed-react": "^1.0.3",
"@codemirror/lang-javascript": "^6.2.1",
"@codemirror/lang-json": "^6.0.1",
"@codemirror/view": "^6.22.3",
Expand Down
Binary file modified packages/ui/public/favicon-16x16.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified packages/ui/public/favicon-32x32.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified packages/ui/public/favicon.ico
Binary file not shown.
31 changes: 14 additions & 17 deletions packages/ui/public/index.html
Original file line number Diff line number Diff line change
@@ -1,38 +1,35 @@
<!DOCTYPE html>
<html lang="en">
<head>
<title>Flowise - Low-code LLM apps builder</title>
<title>CXCortex - Agents - Low-code LLM apps builder</title>
<link rel="icon" href="%PUBLIC_URL%/favicon.ico" />
<!-- Meta Tags-->
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="theme-color" content="#2296f3" />
<meta name="title" content="Flowise - Low-code LLM apps builder" />
<meta name="description" content="Flowise helps you to better integrate Web3 with existing Web2 applications" />
<meta name="title" content="CXCortex - Agents - Low-code LLM apps builder" />
<meta name="description" content="CXCortex - Agents helps you to better integrate Web3 with existing Web2 applications" />
<meta name="keywords" content="react, material-ui, reactjs, reactjs, workflow automation, web3, web2, blockchain" />
<meta name="author" content="CodedThemes" />
<!-- Open Graph / Facebook -->
<meta property="og:locale" content="en_US" />
<meta property="og:type" content="website" />
<meta property="og:url" content="https://flowiseai.com/" />
<meta property="og:site_name" content="flowiseai.com" />
<meta property="article:publisher" content="https://www.facebook.com/codedthemes" />
<meta property="og:title" content="Flowise - Low-code LLM apps builder" />
<meta
property="og:description"
content="Build customized LLM orchestration flow & agents, enable quick iterations from testing to production"
/>
<meta property="og:image" content="https://flowiseai.com/og-image/og-facebook.png" />
<meta property="og:url" content="https://agents.cxcortex.ai/" />
<meta property="og:site_name" content="CXCortex - Agentsai.com" />

<meta property="og:title" content="CXCortex - Agents - Low-code LLM apps builder" />
<meta property="og:description" content="CXCortex - Agents helps you to better build LLM flows using Langchain in simple GUI" />
<meta property="og:image" content="https://agents.cxcortex.ai/og-image/og-facebook.png" />
<!-- Twitter -->
<meta property="twitter:card" content="summary_large_image" />
<meta property="twitter:url" content="https://flowiseai.com" />
<meta property="twitter:title" content="Flowise - Low-code LLM apps builder" />
<meta property="twitter:url" content="https://agents.cxcortex.ai" />
<meta property="twitter:title" content="CXCortex - Agents - Low-code LLM apps builder" />
<meta
property="twitter:description"
content="Build customized LLM orchestration flow & agents, enable quick iterations from testing to production"
content="CXCortex - Agents helps you to better build LLM flows using Langchain in simple GUI"
/>
<meta property="twitter:image" content="https://flowiseai.com/og-image/og-twitter.png" />
<meta name="twitter:creator" content="@codedthemes" />
<meta property="twitter:image" content="https://agents.cxcortex.ai/og-image/og-twitter.png" />

<!--
Notice the use of %PUBLIC_URL% in the tags above.
It will be replaced with the URL of the `public` folder during the build.
Expand Down
Binary file modified packages/ui/src/assets/images/flowise_logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 3 additions & 3 deletions packages/ui/src/assets/scss/_themes-vars.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ $primary200: #90caf9;
$primary800: #1565c0;

// secondary
$secondaryLight: #ede7f6;
$secondaryMain: #673ab7;
$secondaryDark: #5e35b1;
$secondaryLight: #fbe9e7;
$secondaryMain: #ffab91;
$secondaryDark: #d84315;
$secondary200: #b39ddb;
$secondary800: #4527a0;

Expand Down
5 changes: 3 additions & 2 deletions packages/ui/src/views/chatbot/index.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { useEffect, useState } from 'react'
import { FullPageChat } from 'flowise-embed-react'
import { FullPageChat } from '@birksy89/flowise-embed-react'
import { useNavigate } from 'react-router-dom'

// Project import
Expand Down Expand Up @@ -120,7 +120,8 @@ const ChatbotFull = () => {
chatflowid={chatflow.id}
apiHost={baseURL}
chatflowConfig={chatbotOverrideConfig}
theme={{ chatWindow: chatbotTheme }}
// Nothing was passed in for the "button", which is used for the header color. This makes it the Hostcomm blue color.
theme={{ chatWindow: chatbotTheme, button: { backgroundColor: '#0099CD' } }}
/>
)}
<LoginDialog show={loginDialogOpen} dialogProps={loginDialogProps} onConfirm={onLoginClick} />
Expand Down
20 changes: 10 additions & 10 deletions packages/ui/src/views/chatflows/EmbedChat.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ function a11yProps(index) {

const embedPopupHtmlCode = (chatflowid) => {
return `<script type="module">
import Chatbot from "https://cdn.jsdelivr.net/npm/flowise-embed/dist/web.js"
import Chatbot from "https://cdn.jsdelivr.net/npm/@birksy89/flowise-embed/dist/web.js"
Chatbot.init({
chatflowid: "${chatflowid}",
apiHost: "${baseURL}",
Expand All @@ -49,7 +49,7 @@ const embedPopupHtmlCode = (chatflowid) => {
}

const embedPopupReactCode = (chatflowid) => {
return `import { BubbleChat } from 'flowise-embed-react'
return `import { BubbleChat } from '@birksy89/flowise-embed-react'
const App = () => {
return (
Expand All @@ -61,7 +61,7 @@ const App = () => {
const embedFullpageHtmlCode = (chatflowid) => {
return `<flowise-fullchatbot></flowise-fullchatbot>
<script type="module">
import Chatbot from "https://cdn.jsdelivr.net/npm/flowise-embed/dist/web.js"
import Chatbot from "https://cdn.jsdelivr.net/npm/@birksy89/flowise-embed/dist/web.js"
Chatbot.initFull({
chatflowid: "${chatflowid}",
apiHost: "${baseURL}",
Expand All @@ -70,7 +70,7 @@ const embedFullpageHtmlCode = (chatflowid) => {
}

const embedFullpageReactCode = (chatflowid) => {
return `import { FullPageChat } from "flowise-embed-react"
return `import { FullPageChat } from "@birksy89/flowise-embed-react"
const App = () => {
return (
Expand Down Expand Up @@ -238,7 +238,7 @@ const chatwindowConfig = (isReact = false) => {

const embedPopupHtmlCodeCustomization = (chatflowid) => {
return `<script type="module">
import Chatbot from "https://cdn.jsdelivr.net/npm/flowise-embed/dist/web.js"
import Chatbot from "https://cdn.jsdelivr.net/npm/@birksy89/flowise-embed/dist/web.js"
Chatbot.init({
chatflowid: "${chatflowid}",
apiHost: "${baseURL}",
Expand All @@ -255,7 +255,7 @@ const embedPopupHtmlCodeCustomization = (chatflowid) => {
}

const embedPopupReactCodeCustomization = (chatflowid) => {
return `import { BubbleChat } from 'flowise-embed-react'
return `import { BubbleChat } from '@birksy89/flowise-embed-react'
const App = () => {
return (
Expand All @@ -275,7 +275,7 @@ const App = () => {
const embedFullpageHtmlCodeCustomization = (chatflowid) => {
return `<flowise-fullchatbot></flowise-fullchatbot>
<script type="module">
import Chatbot from "https://cdn.jsdelivr.net/npm/flowise-embed/dist/web.js"
import Chatbot from "https://cdn.jsdelivr.net/npm/@birksy89/flowise-embed/dist/web.js"
Chatbot.initFull({
chatflowid: "${chatflowid}",
apiHost: "${baseURL}",
Expand All @@ -287,7 +287,7 @@ const embedFullpageHtmlCodeCustomization = (chatflowid) => {
}

const embedFullpageReactCodeCustomization = (chatflowid) => {
return `import { FullPageChat } from "flowise-embed-react"
return `import { FullPageChat } from "@birksy89/flowise-embed-react"
const App = () => {
return (
Expand Down Expand Up @@ -368,11 +368,11 @@ const EmbedChat = ({ chatflowid }) => {
<a
rel='noreferrer'
target='_blank'
href='https://www.npmjs.com/package/flowise-embed?activeTab=versions'
href='https://www.npmjs.com/package/@birksy89/flowise-embed?activeTab=versions'
>
version
</a>
:&nbsp;<code>{`https://cdn.jsdelivr.net/npm/flowise-embed@<version>/dist/web.js`}</code>
:&nbsp;<code>{`https://cdn.jsdelivr.net/npm/@birksy89/flowise-embed@<version>/dist/web.js`}</code>
</p>
</span>
<div style={{ height: 10 }}></div>
Expand Down
Loading

0 comments on commit 844b9b3

Please sign in to comment.