Skip to content

Commit

Permalink
Merge branch 'main' into feature/Credential
Browse files Browse the repository at this point in the history
# Conflicts:
#	README.md
#	docker/.env.example
#	packages/components/nodes/documentloaders/Notion/NotionDB.ts
#	packages/components/nodes/memory/DynamoDb/DynamoDb.ts
#	packages/components/nodes/memory/MotorheadMemory/MotorheadMemory.ts
#	packages/components/nodes/memory/ZepMemory/ZepMemory.ts
#	packages/components/package.json
#	packages/components/src/utils.ts
#	packages/server/.env.example
#	packages/server/README.md
#	packages/server/marketplaces/chatflows/Conversational Retrieval QA Chain.json
#	packages/server/src/ChildProcess.ts
#	packages/server/src/DataSource.ts
#	packages/server/src/commands/start.ts
#	packages/server/src/index.ts
#	packages/server/src/utils/index.ts
#	packages/server/src/utils/logger.ts
  • Loading branch information
HenryHengZJ committed Jul 27, 2023
2 parents 0665dce + e2d3f27 commit 61dabbb
Show file tree
Hide file tree
Showing 107 changed files with 4,322 additions and 801 deletions.
35 changes: 34 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,9 +114,42 @@ Flowise has 3 different modules in a single mono repository.

11. Commit code and submit Pull Request from forked branch pointing to [Flowise master](https://github.com/FlowiseAI/Flowise/tree/master).

## 🌱 Env Variables

Flowise support different environment variables to configure your instance. You can specify the following variables in the `.env` file inside `packages/server` folder. Read [more](https://docs.flowiseai.com/environment-variables)

| Variable | Description | Type | Default |
| -------------------------- | ---------------------------------------------------------------------------- | ------------------------------------------------ | ----------------------------------- |
| PORT | The HTTP port Flowise runs on | Number | 3000 |
| FLOWISE_USERNAME | Username to login | String | |
| FLOWISE_PASSWORD | Password to login | String | |
| DEBUG | Print logs from components | Boolean | |
| 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` |
| EXECUTION_MODE | Whether predictions run in their own process or the main process | Enum String: `child`, `main` | `main` |
| TOOL_FUNCTION_BUILTIN_DEP | NodeJS built-in modules to be used for Tool Function | String | |
| TOOL_FUNCTION_EXTERNAL_DEP | External modules to be used for Tool Function | String | |
| OVERRIDE_DATABASE | Override current database with default | Enum String: `true`, `false` | `true` |
| DATABASE_TYPE | Type of database to store the flowise data | Enum String: `sqlite`, `mysql`, `postgres` | `sqlite` |
| DATABASE_PATH | Location where database is saved (When DATABASE_TYPE is sqlite) | String | `your-home-dir/.flowise` |
| DATABASE_HOST | Host URL or IP address (When DATABASE_TYPE is not sqlite) | String | |
| DATABASE_PORT | Database port (When DATABASE_TYPE is not sqlite) | String | |
| DATABASE_USERNAME | Database username (When DATABASE_TYPE is not sqlite) | String | |
| DATABASE_PASSWORD | Database password (When DATABASE_TYPE is not sqlite) | String | |
| DATABASE_NAME | Database name (When DATABASE_TYPE is not sqlite) | String | |
| PASSPHRASE | Passphrase used to create encryption key | String | `MYPASSPHRASE` |
| SECRETKEY_PATH | Location where encryption key (used to encrypt/decrypt credentials) is saved | String | `your-path/Flowise/packages/server` |

You can also specify the env variables when using `npx`. For example:

```
npx flowise start --PORT=3000 --DEBUG=true
```
## 📖 Contribute to Docs
In-Progress
[Flowise Docs](https://github.com/FlowiseAI/FlowiseDocs)
## 🏷️ Pull Request process
Expand Down
41 changes: 17 additions & 24 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,19 @@
<!-- markdownlint-disable MD030 -->

# Flowise
<img width="100%" src="https://github.com/FlowiseAI/Flowise/blob/main/images/flowise.png?raw=true"></a>

# Flowise - Build LLM Apps Easily

[![Release Notes](https://img.shields.io/github/release/FlowiseAI/Flowise)](https://github.com/FlowiseAI/Flowise/releases)
[![Discord](https://img.shields.io/discord/1087698854775881778?label=Discord&logo=discord)](https://discord.gg/jbaHfsRVBW)
[![Twitter Follow](https://img.shields.io/twitter/follow/FlowiseAI?style=social)](https://twitter.com/FlowiseAI)
[![GitHub star chart](https://img.shields.io/github/stars/FlowiseAI/Flowise?style=social)](https://star-history.com/#FlowiseAI/Flowise)
[![GitHub fork](https://img.shields.io/github/forks/FlowiseAI/Flowise?style=social)](https://github.com/FlowiseAI/Flowise/fork)

<h3>Drag & drop UI to build your customized LLM flow</h3>
<a href="https://github.com/FlowiseAI/Flowise">
<img width="100%" src="https://github.com/FlowiseAI/Flowise/blob/main/images/flowise.gif?raw=true"></a>

Drag & drop UI to build your customized LLM flow

## ⚡Quick Start

Download and Install [NodeJS](https://nodejs.org/en/download) >= 18.15.0
Expand Down Expand Up @@ -128,27 +135,7 @@ FLOWISE_PASSWORD=1234
## 🌱 Env Variables
Flowise support different environment variables to configure your instance. You can specify the following variables in the `.env` file inside `packages/server` folder.
| Variable | Description | Type | Default |
| ---------------- | ---------------------------------------------------------------------------- | ------------------------------------------------ | ----------------------------------- |
| PORT | The HTTP port Flowise runs on | Number | 3000 |
| PASSPHRASE | Passphrase used to create encryption key | String | `MYPASSPHRASE` |
| FLOWISE_USERNAME | Username to login | String |
| FLOWISE_PASSWORD | Password to login | String |
| DEBUG | Print logs from components | Boolean |
| 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` |
| DATABASE_PATH | Location where database is saved | String | `your/home/dir/.flowise` |
| APIKEY_PATH | Location where api keys are saved | String | `your/path/Flowise/packages/server` |
| SECRETKEY_PATH | Location where encryption key (used to encrypt/decrypt credentials) is saved | String | `your/path/Flowise/packages/server` |
| EXECUTION_MODE | Whether predictions run in their own process or the main process | Enum String: `child`, `main` | `main` |
You can also specify the env variables when using `npx`. For example:
```
npx flowise start --PORT=3000 --DEBUG=true
```
Flowise support different environment variables to configure your instance. You can specify the following variables in the `.env` file inside `packages/server` folder. Read [more](https://github.com/FlowiseAI/Flowise/blob/main/CONTRIBUTING.md#-env-variables)
## 📖 Documentation
Expand Down Expand Up @@ -182,6 +169,12 @@ Feel free to ask any questions, raise problems, and request new features in [dis
## 🙌 Contributing
Thanks go to these awesome contributors
<a href="https://github.com/FlowiseAI/Flowise/graphs/contributors">
<img src="https://contrib.rocks/image?repo=FlowiseAI/Flowise" />
</a>
See [contributing guide](CONTRIBUTING.md). Reach out to us at [Discord](https://discord.gg/jbaHfsRVBW) if you have any questions or issues.
[![Star History Chart](https://api.star-history.com/svg?repos=FlowiseAI/Flowise&type=Timeline)](https://star-history.com/#FlowiseAI/Flowise&Date)
Expand Down
36 changes: 36 additions & 0 deletions artillery-load-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# npm install -g artillery@latest
# artillery run artillery-load-test.yml
# Refer https://www.artillery.io/docs

config:
target: http://128.128.128.128:3000 # replace with your url
phases:
- duration: 1
arrivalRate: 1
rampTo: 2
name: Warm up phase
- duration: 1
arrivalRate: 2
rampTo: 3
name: Ramp up load
- duration: 1
arrivalRate: 3
name: Sustained peak load
scenarios:
- flow:
- loop:
- post:
url: '/api/v1/prediction/chatflow-id' # replace with your chatflowid
json:
question: 'hello' # replace with your question
count: 1 # how many request each user make

# User __
# 3 /
# 2 /
# 1 _/
# 1 2 3
# Seconds
# Total Users = 2 + 3 + 3 = 8
# Each making 1 HTTP call
# Over a duration of 3 seconds
19 changes: 15 additions & 4 deletions docker/.env.example
Original file line number Diff line number Diff line change
@@ -1,11 +1,22 @@
PORT=3000
PASSPHRASE=MYPASSPHRASE # Passphrase used to create encryption key
DATABASE_PATH=/root/.flowise
APIKEY_PATH=/root/.flowise
SECRETKEY_PATH=/root/.flowise
LOG_PATH=/root/.flowise/logs

# DATABASE_TYPE=postgres
# DATABASE_PORT=""
# DATABASE_HOST=""
# DATABASE_NAME="flowise"
# DATABASE_USER=""
# DATABASE_PASSWORD=""
# OVERRIDE_DATABASE=true

# FLOWISE_USERNAME=user
# FLOWISE_PASSWORD=1234
# DEBUG=true
# DATABASE_PATH=/your/database/path/.flowise
# APIKEY_PATH=/your/api/key/path
# SECRETKEY_PATH=/your/secret/key/path
# LOG_PATH=/your/log/path
# LOG_LEVEL=debug (error | warn | info | verbose | debug)
# EXECUTION_MODE=main (child | main)
# TOOL_FUNCTION_BUILTIN_DEP=crypto,fs
# TOOL_FUNCTION_EXTERNAL_DEP=moment,lodash
13 changes: 12 additions & 1 deletion docker/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Starts Flowise from [DockerHub Image](https://hub.docker.com/repository/docker/f
3. Open [http://localhost:3000](http://localhost:3000)
4. You can bring the containers down by `docker-compose stop`

## With Authrorization
## 🔒 Authentication

1. Create `.env` file and specify the `PORT`, `FLOWISE_USERNAME`, and `FLOWISE_PASSWORD` (refer to `.env.example`)
2. Pass `FLOWISE_USERNAME` and `FLOWISE_PASSWORD` to the `docker-compose.yml` file:
Expand All @@ -22,3 +22,14 @@ Starts Flowise from [DockerHub Image](https://hub.docker.com/repository/docker/f
3. `docker-compose up -d`
4. Open [http://localhost:3000](http://localhost:3000)
5. You can bring the containers down by `docker-compose stop`
## 🌱 Env Variables
If you like to persist your data (flows, logs, apikeys, credentials), set these variables in the `.env` file inside `docker` folder:
- DATABASE_PATH=/root/.flowise
- APIKEY_PATH=/root/.flowise
- LOG_PATH=/root/.flowise/logs
- SECRETKEY_PATH=/root/.flowise
Flowise also support different environment variables to configure your instance. Read [more](https://docs.flowiseai.com/environment-variables)
2 changes: 1 addition & 1 deletion docker/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@ services:
- PASSPHRASE=${PASSPHRASE}
- FLOWISE_USERNAME=${FLOWISE_USERNAME}
- FLOWISE_PASSWORD=${FLOWISE_PASSWORD}
- DEBUG=${DEBUG}
- DATABASE_PATH=${DATABASE_PATH}
- APIKEY_PATH=${APIKEY_PATH}
- SECRETKEY_PATH=${SECRETKEY_PATH}
- LOG_LEVEL=${LOG_LEVEL}
- LOG_PATH=${LOG_PATH}
- EXECUTION_MODE=${EXECUTION_MODE}
- DEBUG=${DEBUG}
ports:
- '${PORT}:${PORT}'
volumes:
Expand Down
Binary file added images/flowise.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "flowise",
"version": "1.2.15",
"version": "1.2.16",
"private": true,
"homepage": "https://flowiseai.com",
"workspaces": [
Expand Down Expand Up @@ -28,7 +28,6 @@
"*.{js,jsx,ts,tsx,json,md}": "eslint --fix"
},
"devDependencies": {
"turbo": "1.7.4",
"@babel/preset-env": "^7.19.4",
"@babel/preset-typescript": "7.18.6",
"@types/express": "^4.17.13",
Expand All @@ -48,6 +47,7 @@
"pretty-quick": "^3.1.3",
"rimraf": "^3.0.2",
"run-script-os": "^1.1.6",
"turbo": "1.7.4",
"typescript": "^4.8.4"
},
"engines": {
Expand Down
25 changes: 25 additions & 0 deletions packages/components/credentials/AirtableApi.credential.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import { INodeParams, INodeCredential } from '../src/Interface'

class AirtableApi implements INodeCredential {
label: string
name: string
description: string
inputs: INodeParams[]

constructor() {
this.label = 'Airtable API'
this.name = 'airtableApi'
this.description =
'Refer to <a target="_blank" href="https://support.airtable.com/docs/creating-and-using-api-keys-and-access-tokens">official guide</a> on how to get accessToken on Airtable'
this.inputs = [
{
label: 'Access Token',
name: 'accessToken',
type: 'password',
placeholder: '<AIRTABLE_ACCESS_TOKEN>'
}
]
}
}

module.exports = { credClass: AirtableApi }
22 changes: 22 additions & 0 deletions packages/components/credentials/BraveSearchApi.credential.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import { INodeParams, INodeCredential } from '../src/Interface'

class BraveSearchApi implements INodeCredential {
label: string
name: string
description: string
inputs: INodeParams[]

constructor() {
this.label = 'Brave Search API'
this.name = 'braveSearchApi'
this.inputs = [
{
label: 'BraveSearch Api Key',
name: 'braveApiKey',
type: 'password'
}
]
}
}

module.exports = { credClass: BraveSearchApi }
21 changes: 21 additions & 0 deletions packages/components/credentials/ReplicateApi.credential.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import { INodeParams, INodeCredential } from '../src/Interface'

class ReplicateApi implements INodeCredential {
label: string
name: string
inputs: INodeParams[]

constructor() {
this.label = 'Replicate API'
this.name = 'replicateApi'
this.inputs = [
{
label: 'Replicate Api Key',
name: 'replicateApiKey',
type: 'password'
}
]
}
}

module.exports = { credClass: ReplicateApi }
29 changes: 29 additions & 0 deletions packages/components/credentials/SingleStoreApi.credential.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import { INodeParams, INodeCredential } from '../src/Interface'

class SingleStoreApi implements INodeCredential {
label: string
name: string
description: string
inputs: INodeParams[]

constructor() {
this.label = 'SingleStore API'
this.name = 'singleStoreApi'
this.inputs = [
{
label: 'User',
name: 'user',
type: 'string',
placeholder: '<SINGLESTORE_USERNAME>'
},
{
label: 'Password',
name: 'password',
type: 'password',
placeholder: '<SINGLESTORE_PASSWORD>'
}
]
}
}

module.exports = { credClass: SingleStoreApi }
Loading

0 comments on commit 61dabbb

Please sign in to comment.