Skip to content

Commit

Permalink
Client code
Browse files Browse the repository at this point in the history
  • Loading branch information
Hansika Asthana committed Mar 11, 2024
1 parent 305a585 commit 69283ad
Show file tree
Hide file tree
Showing 399 changed files with 6,369 additions and 9,571 deletions.
8 changes: 4 additions & 4 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ module.exports = {
'plugin:react/recommended',
'plugin:react/jsx-runtime',
'plugin:react-hooks/recommended',
'plugin:jsx-a11y/recommended',
'plugin:prettier/recommended'
'plugin:jsx-a11y/recommended'
// 'plugin:prettier/recommended'
],
settings: {
react: {
Expand All @@ -22,7 +22,7 @@ module.exports = {
'unused-imports/no-unused-imports': 'warn',
'unused-imports/no-unused-vars': ['warn', { vars: 'all', varsIgnorePattern: '^_', args: 'after-used', argsIgnorePattern: '^_' }],
'no-undef': 'off',
'no-console': [process.env.CI ? 'error' : 'warn', { allow: ['warn', 'error', 'info'] }],
'prettier/prettier': 'error'
'no-console': [process.env.CI ? 'error' : 'warn', { allow: ['warn', 'error', 'info'] }]
// 'prettier/prettier': 'error'
}
}
5 changes: 2 additions & 3 deletions CONTRIBUTING-ZH.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@

不确定要贡献什么?一些想法:

-`packages/components` 创建新组件
-Langchain 创建新组件
- 更新现有组件,如扩展功能、修复错误
- 添加新的 Chatflow 想法

Expand All @@ -40,7 +40,7 @@ Flowise 在一个单一的单体存储库中有 3 个不同的模块。

- `server`:用于提供 API 逻辑的 Node 后端
- `ui`:React 前端
- `components`:Langchain/LlamaIndex 组件
- `components`:Langchain 组件

#### 先决条件

Expand Down Expand Up @@ -125,7 +125,6 @@ Flowise 支持不同的环境变量来配置您的实例。您可以在 `package
| FLOWISE_PASSWORD | 登录密码 | 字符串 | |
| FLOWISE_FILE_SIZE_LIMIT | 上传文件大小限制 | 字符串 | 50mb |
| DEBUG | 打印组件的日志 | 布尔值 | |
| BLOB_STORAGE_PATH | 存储位置 | 字符串 | `your-home-dir/.flowise/storage` |
| LOG_PATH | 存储日志文件的位置 | 字符串 | `your-path/Flowise/logs` |
| LOG_LEVEL | 日志的不同级别 | 枚举字符串: `error`, `info`, `verbose`, `debug` | `info` |
| APIKEY_PATH | 存储 API 密钥的位置 | 字符串 | `your-path/Flowise/packages/server` |
Expand Down
5 changes: 2 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ Found an issue? [Report it](https://github.com/FlowiseAI/Flowise/issues/new/choo

Not sure what to contribute? Some ideas:

- Create new components from `packages/components`
- Create new components from Langchain
- Update existing components such as extending functionality, fixing bugs
- Add new chatflow ideas

Expand All @@ -40,7 +40,7 @@ Flowise has 3 different modules in a single mono repository.

- `server`: Node backend to serve API logics
- `ui`: React frontend
- `components`: Third-party nodes integrations
- `components`: Langchain components

#### Prerequisite

Expand Down Expand Up @@ -129,7 +129,6 @@ Flowise support different environment variables to configure your instance. You
| FLOWISE_PASSWORD | Password to login | String | |
| FLOWISE_FILE_SIZE_LIMIT | Upload File Size Limit | String | 50mb |
| DEBUG | Print logs from components | Boolean | |
| BLOB_STORAGE_PATH | Location where uploaded files are stored | String | `your-home-dir/.flowise/storage` |
| LOG_PATH | Location where log files are stored | String | `your-path/Flowise/logs` |
| LOG_LEVEL | Different levels of logs | Enum String: `error`, `info`, `verbose`, `debug` | `info` |
| APIKEY_PATH | Location where api keys are saved | String | `your-path/Flowise/packages/server` |
Expand Down
2 changes: 1 addition & 1 deletion README-ZH.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ Flowise 在一个单一的代码库中有 3 个不同的模块。

- `server`:用于提供 API 逻辑的 Node 后端
- `ui`:React 前端
- `components`第三方节点集成
- `components`Langchain 组件

### 先决条件

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ Flowise has 3 different modules in a single mono repository.

- `server`: Node backend to serve API logics
- `ui`: React frontend
- `components`: Third-party nodes integrations
- `components`: Langchain components

### Prerequisite

Expand Down
20 changes: 20 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
version: '3.8'

services:
fusionflow:
image: registry.digitalocean.com/maslow--registry/flowise:1.0.2
ports:
- "3000:3000"
networks:
- fusionflow_network

chromaDB:
image: registry.digitalocean.com/maslow--registry/chroma:latest
ports:
- "8000:8000"
networks:
- fusionflow_network

networks:
fusionflow_network:
driver: bridge
1 change: 0 additions & 1 deletion docker/.env.example
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ DATABASE_PATH=/root/.flowise
APIKEY_PATH=/root/.flowise
SECRETKEY_PATH=/root/.flowise
LOG_PATH=/root/.flowise/logs
BLOB_STORAGE_PATH=/root/.flowise/storage

# CORS_ORIGINS="*"
# IFRAME_ORIGINS="*"
Expand Down
1 change: 0 additions & 1 deletion docker/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,5 @@ If you like to persist your data (flows, logs, apikeys, credentials), set these
- APIKEY_PATH=/root/.flowise
- LOG_PATH=/root/.flowise/logs
- SECRETKEY_PATH=/root/.flowise
- BLOB_STORAGE_PATH=/root/.flowise/storage
Flowise also support different environment variables to configure your instance. Read [more](https://docs.flowiseai.com/environment-variables)
1 change: 0 additions & 1 deletion docker/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ services:
- FLOWISE_SECRETKEY_OVERWRITE=${FLOWISE_SECRETKEY_OVERWRITE}
- LOG_LEVEL=${LOG_LEVEL}
- LOG_PATH=${LOG_PATH}
- BLOB_STORAGE_PATH=${BLOB_STORAGE_PATH}
- DISABLE_FLOWISE_TELEMETRY=${DISABLE_FLOWISE_TELEMETRY}
ports:
- '${PORT}:${PORT}'
Expand Down
14 changes: 14 additions & 0 deletions fusionflow-ChatEmbed/.eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
module.exports = {
root: true,
extends: ['eslint:recommended', 'plugin:@typescript-eslint/recommended', 'prettier', 'plugin:solid/typescript'],
plugins: ['@typescript-eslint', 'solid'],
parser: '@typescript-eslint/parser',
ignorePatterns: ['**/*.md'],
rules: {
'@next/next/no-img-element': 'off',
'@next/next/no-html-link-for-pages': 'off',
'solid/no-innerhtml': 'off',
'@typescript-eslint/no-namespace': 'off',
'@typescript-eslint/no-explicit-any': 'off'
}
}
2 changes: 2 additions & 0 deletions fusionflow-ChatEmbed/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
node_modules
.idea
18 changes: 18 additions & 0 deletions fusionflow-ChatEmbed/.husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

set -e # Exit on any error

echo "Running ESLint for linting..."
npm run lint

echo "Running ESLint for fixing issues..."
npm run lint-fix

echo "Formatting code..."
npm run format

echo "Checking formatting..."
npm run format:check

echo "Pre-commit checks passed."
4 changes: 4 additions & 0 deletions fusionflow-ChatEmbed/.npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
src
rollup.config.js
tailwind.config.cjs
tsconfig.json
3 changes: 3 additions & 0 deletions fusionflow-ChatEmbed/.prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
node_modules
build
dist
8 changes: 8 additions & 0 deletions fusionflow-ChatEmbed/.prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"semi": true,
"singleQuote": true,
"tabWidth": 2,
"trailingComma": "all",
"printWidth": 150,
"endOfLine": "lf"
}
147 changes: 147 additions & 0 deletions fusionflow-ChatEmbed/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,147 @@
<!-- markdownlint-disable MD030 -->

# Flowise Embed

Javascript library to display flowise chatbot on your website

![Flowise](https://github.com/FlowiseAI/FlowiseChatEmbed/blob/main/images/ChatEmbed.gif?raw=true)

Install:

```bash
yarn install
```

Dev:

```bash
yarn dev
```

Build:

```bash
yarn build
```

## Embed in your HTML

### PopUp

```html
<script type="module">
import Chatbot from 'https://cdn.jsdelivr.net/npm/flowise-embed/dist/web.js';
Chatbot.init({
chatflowid: '<chatflowid>',
apiHost: 'http://localhost:3000',
});
</script>
```

### FullPage

```html
<script type="module">
import Chatbot from './web.js';
Chatbot.initFull({
chatflowid: '<chatflowid>',
apiHost: 'http://localhost:3000',
});
</script>
<flowise-fullchatbot></flowise-fullchatbot>
```

To enable full screen, add `margin: 0` to <code>body</code> style, and confirm you don't set height and width

```html
<body style="margin: 0">
<script type="module">
import Chatbot from './web.js';
Chatbot.initFull({
chatflowid: '<chatflowid>',
apiHost: 'http://localhost:3000',
theme: {
chatWindow: {
// height: 700, don't set height
// width: 400, don't set width
},
},
});
</script>
</body>
```

## Configuration

You can also customize chatbot with different configuration

```html
<script type="module">
import Chatbot from 'https://cdn.jsdelivr.net/npm/flowise-embed/dist/web.js';
Chatbot.init({
chatflowid: '91e9c803-5169-4db9-8207-3c0915d71c5f',
apiHost: 'http://localhost:3000',
chatflowConfig: {
// topK: 2
},
observersConfig: {
// (optional) Allows you to execute code in parent based upon signal observations within the chatbot.
// The userinput field submitted to bot ("" when reset by bot)
observeUserInput: (userInput) => {
console.log({ userInput });
},
// The bot message stack has changed
observeMessages: (messages) => {
console.log({ messages });
},
// The bot loading signal changed
observeLoading: (loading) => {
console.log({ loading });
},
},
theme: {
button: {
backgroundColor: '#3B81F6',
right: 20,
bottom: 20,
size: 'medium',
iconColor: 'white',
customIconSrc: 'https://raw.githubusercontent.com/walkxcode/dashboard-icons/main/svg/google-messages.svg',
},
chatWindow: {
showTitle: true, // show/hide the title bar
title: 'Flowise Bot',
titleAvatarSrc: 'https://raw.githubusercontent.com/walkxcode/dashboard-icons/main/svg/google-messages.svg',
welcomeMessage: 'Hello! This is custom welcome message',
backgroundColor: '#ffffff',
height: 700,
width: 400,
fontSize: 16,
poweredByTextColor: '#303235',
botMessage: {
backgroundColor: '#f7f8ff',
textColor: '#303235',
showAvatar: true,
avatarSrc: 'https://raw.githubusercontent.com/zahidkhawaja/langchain-chat-nextjs/main/public/parroticon.png',
},
userMessage: {
backgroundColor: '#3B81F6',
textColor: '#ffffff',
showAvatar: true,
avatarSrc: 'https://raw.githubusercontent.com/zahidkhawaja/langchain-chat-nextjs/main/public/usericon.png',
},
textInput: {
placeholder: 'Type your question',
backgroundColor: '#ffffff',
textColor: '#303235',
sendButtonColor: '#3B81F6',
},
},
},
});
</script>
```

## License

Source code in this repository is made available under the [MIT License](https://github.com/FlowiseAI/Flowise/blob/master/LICENSE.md).
21 changes: 21 additions & 0 deletions fusionflow-ChatEmbed/base.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"$schema": "https://json.schemastore.org/tsconfig",
"display": "Default",
"compilerOptions": {
"composite": false,
"declaration": true,
"declarationMap": true,
"esModuleInterop": true,
"forceConsistentCasingInFileNames": true,
"inlineSources": false,
"isolatedModules": true,
"moduleResolution": "node",
"noUnusedLocals": false,
"noUnusedParameters": false,
"preserveWatchOutput": true,
"skipLibCheck": true,
"strict": true,
"downlevelIteration": true
},
"exclude": ["node_modules"]
}
Binary file added fusionflow-ChatEmbed/images/ChatEmbed.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 69283ad

Please sign in to comment.