diff --git a/packages/components/nodes/vectorstores/Elasticsearch/Elasticsearch.ts b/packages/components/nodes/vectorstores/Elasticsearch/Elasticsearch.ts
index 5f3cf206..04c90c6b 100644
--- a/packages/components/nodes/vectorstores/Elasticsearch/Elasticsearch.ts
+++ b/packages/components/nodes/vectorstores/Elasticsearch/Elasticsearch.ts
@@ -183,13 +183,26 @@ const prepareConnectionOptions = (
} else if (cloudId) {
let username = getCredentialParam('username', credentialData, nodeData)
let password = getCredentialParam('password', credentialData, nodeData)
- elasticSearchClientOptions = {
- cloud: {
- id: cloudId
- },
- auth: {
- username: username,
- password: password
+ if (cloudId.startsWith('http')) {
+ elasticSearchClientOptions = {
+ node: cloudId,
+ auth: {
+ username: username,
+ password: password
+ },
+ tls: {
+ rejectUnauthorized: false
+ }
+ }
+ } else {
+ elasticSearchClientOptions = {
+ cloud: {
+ id: cloudId
+ },
+ auth: {
+ username: username,
+ password: password
+ }
}
}
}
diff --git a/packages/server/src/index.ts b/packages/server/src/index.ts
index 2d40f32e..fb4a5f5a 100644
--- a/packages/server/src/index.ts
+++ b/packages/server/src/index.ts
@@ -138,6 +138,7 @@ export class App {
'/api/v1/verify/apikey/',
'/api/v1/chatflows/apikey/',
'/api/v1/public-chatflows',
+ '/api/v1/public-chatbotConfig',
'/api/v1/prediction/',
'/api/v1/vector/upsert/',
'/api/v1/node-icon/',
@@ -328,6 +329,23 @@ export class App {
return res.status(404).send(`Chatflow ${req.params.id} not found`)
})
+ // Get specific chatflow chatbotConfig via id (PUBLIC endpoint, used to retrieve config for embedded chat)
+ // Safe as public endpoint as chatbotConfig doesn't contain sensitive credential
+ this.app.get('/api/v1/public-chatbotConfig/:id', async (req: Request, res: Response) => {
+ const chatflow = await this.AppDataSource.getRepository(ChatFlow).findOneBy({
+ id: req.params.id
+ })
+ if (chatflow && chatflow.chatbotConfig) {
+ try {
+ const parsedConfig = JSON.parse(chatflow.chatbotConfig)
+ return res.json(parsedConfig)
+ } catch (e) {
+ return res.status(500).send(`Error parsing Chatbot Config for Chatflow ${req.params.id}`)
+ }
+ }
+ return res.status(404).send(`Chatbot Config for Chatflow ${req.params.id} not found`)
+ })
+
// Save chatflow
this.app.post('/api/v1/chatflows', async (req: Request, res: Response) => {
const body = req.body
diff --git a/packages/ui/src/menu-items/settings.js b/packages/ui/src/menu-items/settings.js
index 307bd0bd..1e0f58dd 100644
--- a/packages/ui/src/menu-items/settings.js
+++ b/packages/ui/src/menu-items/settings.js
@@ -1,8 +1,8 @@
// assets
-import { IconTrash, IconFileUpload, IconFileExport, IconCopy, IconSearch, IconMessage } from '@tabler/icons'
+import { IconTrash, IconFileUpload, IconFileExport, IconCopy, IconSearch, IconMessage, IconPictureInPictureOff } from '@tabler/icons'
// constant
-const icons = { IconTrash, IconFileUpload, IconFileExport, IconCopy, IconSearch, IconMessage }
+const icons = { IconTrash, IconFileUpload, IconFileExport, IconCopy, IconSearch, IconMessage, IconPictureInPictureOff }
// ==============================|| SETTINGS MENU ITEMS ||============================== //
@@ -11,6 +11,13 @@ const settings = {
title: '',
type: 'group',
children: [
+ {
+ id: 'conversationStarters',
+ title: 'Starter Prompts',
+ type: 'item',
+ url: '',
+ icon: icons.IconPictureInPictureOff
+ },
{
id: 'viewMessages',
title: 'View Messages',
diff --git a/packages/ui/src/ui-component/button/FlowListMenu.js b/packages/ui/src/ui-component/button/FlowListMenu.js
index 94ecdd01..16bc86f2 100644
--- a/packages/ui/src/ui-component/button/FlowListMenu.js
+++ b/packages/ui/src/ui-component/button/FlowListMenu.js
@@ -11,6 +11,7 @@ import FileCopyIcon from '@mui/icons-material/FileCopy'
import FileDownloadIcon from '@mui/icons-material/Downloading'
import FileDeleteIcon from '@mui/icons-material/Delete'
import FileCategoryIcon from '@mui/icons-material/Category'
+import PictureInPictureAltIcon from '@mui/icons-material/PictureInPictureAlt'
import Button from '@mui/material/Button'
import KeyboardArrowDownIcon from '@mui/icons-material/KeyboardArrowDown'
import { IconX } from '@tabler/icons'
@@ -27,6 +28,7 @@ import TagDialog from '../dialog/TagDialog'
import { generateExportFlowData } from '../../utils/genericHelper'
import useNotifier from '../../utils/useNotifier'
+import StarterPromptsDialog from '../dialog/StarterPromptsDialog'
const StyledMenu = styled((props) => (