Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature - Env variable to disable ChatFlow reuse #2559

Merged

Conversation

danieldabate
Copy link
Contributor

Discussed in #2533, this PR adds a new env variable DISABLE_CHATFLOW_REUSE to allow users to decide if they want to create a new ChatFlow in each interaction or reuse current one when possible.

This is useful for a few reasons:

Implementation

Current implementation adds a new condition to the ifFlowReusable function to check for the new env variable DISABLE_CHATFLOW_REUSE.

This approach is simple and keeps the chatflowPool active for other use cases, like AgentFlow abortion.

Alternative implementation

Another possible solution is to make the chatflowPool creation optional. At first this was my preferred approach because I think it's cleaner, but it would break the AgentFlow abortion logic. With the PR implementation regular ChatFlows are still stored in the pool but never used.

Copy link
Contributor

@HenryHengZJ HenryHengZJ left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks @danieldabate !

@HenryHengZJ HenryHengZJ merged commit 5ba9493 into FlowiseAI:main Jun 4, 2024
2 checks passed
@danieldabate danieldabate deleted the feature/disable-chatflow-reuse branch June 4, 2024 10:33
birksy89 added a commit to Hostcomm/Flowise that referenced this pull request Jun 12, 2024
commit 6828691
Author: Henry <hzj94@hotmail.com>
Date:   Tue Jun 11 22:37:14 2024 +0100

    🥳 flowise@1.8.2 release

commit 5e4d640
Author: Jared McQueen <jaredmcqueen@gmail.com>
Date:   Tue Jun 11 17:05:04 2024 -0400

    fix totalChars accumulator for undefined pageContent (FlowiseAI#2619)

commit 6fb775f
Author: jiabaow <60721007+jiabaow@users.noreply.github.com>
Date:   Tue Jun 11 13:56:34 2024 -0700

    add Fireworks LLM (FlowiseAI#2597)

    * add Fireworks LLM

    * support multiple models

    * Update Fireworks.ts

    * fix linting

    ---------

    Co-authored-by: Henry Heng <henryheng@flowiseai.com>

commit 88ee9b0
Author: Mingxin Hou <136245460+mingxin0607@users.noreply.github.com>
Date:   Tue Jun 11 13:56:22 2024 -0700

    Fireworks ai chat model (FlowiseAI#2596)

    * fireworks chat model

    * add chatFireworks to streamAvaliableLLMs

    * add model parameter input

    * Update ChatFireworks.ts

    * fix linting

    ---------

    Co-authored-by: Henry Heng <henryheng@flowiseai.com>

commit 9f9aff3
Author: Torsten Raudssus <github@raudssus.de>
Date:   Tue Jun 11 17:29:28 2024 +0200

    Adding pnpm-store to gitignore (FlowiseAI#2600)

commit 66e1296
Author: Torsten Raudssus <github@raudssus.de>
Date:   Tue Jun 11 17:29:07 2024 +0200

    Searxng Tool implementation (FlowiseAI#2599)

    * Searxng Tool implementation, first commit with most functionality

    * Fixed complains of pnpm lint

    * Picky linter

commit f1e78d8
Author: Saurav Maheshkar <sauravvmaheshkar@gmail.com>
Date:   Fri Jun 7 15:49:24 2024 +0100

    gh: refactor community files (FlowiseAI#2572)

    * gh: refactor community files

    * fix: links to other files

    * docs: move to i18n

commit be3a887
Author: Daniel D'Abate <danieldabate@gmail.com>
Date:   Fri Jun 7 16:35:57 2024 +0200

    Improvement - Reduce size of final docker image with multistage build (FlowiseAI#2598)

    * Reduce size of final docker image with multistage build

    * Dockerfile - Move PUPPETEER_SKIP_DOWNLOAD flag to build stage

commit c8939dc
Author: 不知火 Shiranui <supersonic@livemail.tw>
Date:   Fri Jun 7 19:14:06 2024 +0800

    Add data source adapter of MariaDB (FlowiseAI#2595)

    fix(datasource.ts): add mariadb

commit 34251fa
Author: Daniel D'Abate <danieldabate@gmail.com>
Date:   Fri Jun 7 13:04:25 2024 +0200

    Bugfix - Add x-forwarded-proto as source for http protocol for base url and add base url field to ChatflowTool (FlowiseAI#2592)

commit cb93d9d
Author: Daniel D'Abate <danieldabate@gmail.com>
Date:   Thu Jun 6 15:17:35 2024 +0200

    Bugfix - JS function "execute" from node crashing the frontend and response is hidden (FlowiseAI#2589)

    * Bugfix - Fix crash when executing JS function from node and fix hidden response

    * add toString() to code executed result

    * Change height of CodeEditor to make it bigger, but still make the result visible below.

    ---------

    Co-authored-by: Henry Heng <henryheng@flowiseai.com>

commit 5899e50
Author: toi500 <138339291+toi500@users.noreply.github.com>
Date:   Wed Jun 5 22:55:45 2024 +0200

    Adding Agentflow Template (FlowiseAI#2586)

    adding agentflow template

    Co-authored-by: toi500 <toi500@gmail.com>

commit e0a03ad
Author: Aman Soni <amansoni7477030@gmail.com>
Date:   Thu Jun 6 02:25:27 2024 +0530

    HTML Embed Chat popup configuration updated (FlowiseAI#2583)

    * HTML Embed Chat popup configuration updated

    * HTML Embed Chat popup configuration

    * Update EmbedChat.jsx

    update spacing to be consistent

    ---------

    Co-authored-by: Henry Heng <henryheng@flowiseai.com>

commit 582dcc8
Author: Henry Heng <henryheng@flowiseai.com>
Date:   Tue Jun 4 18:45:45 2024 +0100

    Feature/add status check ping (FlowiseAI#2579)

    add status check ping

commit 5a73eaa
Author: Erasmo Pinheiro <85361327+erasmo-pinheiro@users.noreply.github.com>
Date:   Tue Jun 4 12:23:30 2024 -0300

    fix: Change the CMD flowise command in Dockerfile to be the same as in the document (FlowiseAI#2563)

    * fix: Change the CMD flowise command to be the same as in the documentation.

    * Remove unnecessary npx command from dockerfile

    * Command was changed by the entrypoint in Docker Composer

    ---------

    Co-authored-by: Erasmo De Souza Pinheiro <erasmodesouzapinheiro@Erasmos-MacBook-Air.local>

commit 4ec8376
Author: Henry Heng <henryheng@flowiseai.com>
Date:   Tue Jun 4 15:44:27 2024 +0100

    Bugfix/get rid of double quotes when replacing variable value (FlowiseAI#2577)

    get rid of double quotes when replacing variable value

commit 5ba9493
Author: Daniel D'Abate <danieldabate@gmail.com>
Date:   Tue Jun 4 11:11:57 2024 +0200

    Feature - Env variable to disable ChatFlow reuse (FlowiseAI#2559)

commit bdbb6f8
Author: Jared McQueen <jaredmcqueen@gmail.com>
Date:   Mon Jun 3 21:57:30 2024 -0400

    adding a document loader returns the correct id (FlowiseAI#2538)

commit 55f52c4
Author: Saurav Maheshkar <sauravvmaheshkar@gmail.com>
Date:   Tue Jun 4 02:57:07 2024 +0100

    feat(ci): enable `pnpm` caching in CI (FlowiseAI#2530)

commit 7eb9341
Author: Jared McQueen <jaredmcqueen@gmail.com>
Date:   Mon Jun 3 21:50:43 2024 -0400

    adding url to source for all web scrapers (FlowiseAI#2537)

commit a799ac8
Author: Daniel D'Abate <danieldabate@gmail.com>
Date:   Tue Jun 4 03:31:36 2024 +0200

    Improve OpenSearchURL credential storing user and password in separate fields from the URL (FlowiseAI#2549)

    OpenSearch - Improve OpenSearchURL credential storing user and password in separate fields from the URL

commit 76abd20
Author: Henry <hzj94@hotmail.com>
Date:   Mon Jun 3 13:34:21 2024 +0100

    🥳 flowise-components@1.8.2 minor bugfix release

commit 272fd91
Author: Henry Heng <henryheng@flowiseai.com>
Date:   Mon Jun 3 13:09:59 2024 +0100

    Bugfix/supabase upsert ids (FlowiseAI#2561)

    * fix upserting same id with supabase

    * remove dedicated addvectors logic for ids

    * Update pnpm-lock.yaml

    * add fix for null id column

commit f2a0ffe
Author: Henry Heng <henryheng@flowiseai.com>
Date:   Sun Jun 2 02:41:48 2024 +0100

    Bugfix/Check for proper thread id and avoid throwing error (FlowiseAI#2551)

    check for proper thread id and avoid throwing error

commit 8c66d2c
Author: Henry Heng <henryheng@flowiseai.com>
Date:   Sun Jun 2 02:33:40 2024 +0100

    Bugfix/Avoid passing runnable assign when worker agent has no input variables (FlowiseAI#2550)

    avoid passing runnable assign when worker agent has no input variables

commit e15e6fa
Author: Henry Heng <henryheng@flowiseai.com>
Date:   Sat Jun 1 12:37:00 2024 +0100

    Bugfix/Disable output prediction from llmchain streaming (FlowiseAI#2543)

    disable output prediction from llmchain streaming

commit e5f0ca2
Author: Daniel D'Abate <danieldabate@gmail.com>
Date:   Sat Jun 1 13:36:39 2024 +0200

    Fix OpenSearch vector store upsert (FlowiseAI#2545)

commit 1d99270
Author: Henry <hzj94@hotmail.com>
Date:   Sat Jun 1 00:09:38 2024 +0100

    🥳 flowise@1.8.1 minor bugfix release

commit c42ef95
Author: Henry <hzj94@hotmail.com>
Date:   Sat Jun 1 00:09:10 2024 +0100

    🥳 flowise-ui@1.8.1 minor bugfix release

commit f64931b
Author: Henry <hzj94@hotmail.com>
Date:   Sat Jun 1 00:08:49 2024 +0100

    🥳 flowise-components@1.8.1 minor bugfix release

commit 6a58ae4
Author: Henry Heng <henryheng@flowiseai.com>
Date:   Fri May 31 23:41:21 2024 +0100

    Bugfix/In-mem VS not able to load document (FlowiseAI#2542)

    fix where in-mem VS not able to load document

commit 04e0ce1
Author: Henry Heng <henryheng@flowiseai.com>
Date:   Fri May 31 13:20:34 2024 +0100

    Chore/update flowise-embed version on lock file (FlowiseAI#2535)

    update flowise-embed version on lock file

commit b5b929e
Author: Henry Heng <henryheng@flowiseai.com>
Date:   Thu May 30 22:27:17 2024 +0100

    Feat/Exa Search Tool (FlowiseAI#2524)

    * add exa search tool

    * add exa svg

commit 7706b34
Author: Fahreddin Özcan <88107904+fahreddinozcan@users.noreply.github.com>
Date:   Thu May 30 23:20:02 2024 +0200

    Update Upstash Logo for White Background (FlowiseAI#2511)

    * update: upstash logo for white background

    * update: upstash chat memory logo

commit d505637
Author: YISH <mokeyish@hotmail.com>
Date:   Thu May 30 19:58:20 2024 +0800

    Fix JSON escaping (better) (FlowiseAI#2498)

    Fix JSON escaping

commit eb738a1
Author: Rafael Reis <raffareis@gmail.com>
Date:   Thu May 30 08:54:55 2024 -0300

    Fix for Whisper Error: 'File is not defined' when using Speech to Text (FlowiseAI#2526)

    * tested ok

    * update localai stt file

    * update toFile method for OpenAI Assistant uploads

    ---------

    Co-authored-by: Henry Heng <henryheng@flowiseai.com>
    Co-authored-by: Henry <hzj94@hotmail.com>

commit 059eae4
Author: Henry Heng <henryheng@flowiseai.com>
Date:   Thu May 30 11:59:19 2024 +0100

    Bugfix/model list unreachable (FlowiseAI#2522)

    * fallback to fetch local models json file

    * enable user to specify local path to load models.json

    * Update pnpm-lock.yaml

commit d734747
Author: Henry Heng <henryheng@flowiseai.com>
Date:   Thu May 30 00:18:51 2024 +0100

    Bugfix/Upserting same id with supabase (FlowiseAI#2521)

    fix upserting same id with supabase

commit 912c8f3
Author: Daniel D'Abate <danieldabate@gmail.com>
Date:   Thu May 30 00:40:01 2024 +0200

    Feature: Support role-based authentication for AWS (FlowiseAI#2470)

    * Storage, DynamoDBChatMemory - Make AWS credentials optional to support role-based authentication

    * Lint fix

commit 48ac815
Author: Henry Heng <henryheng@flowiseai.com>
Date:   Wed May 29 23:39:11 2024 +0100

    Bugfix/Restore Requests Tool (FlowiseAI#2513)

    restore requests tool

commit 2878af6
Author: patrickreinan <patrickreinan@gmail.com>
Date:   Wed May 29 14:25:32 2024 -0300

    Added LOG_JSON_SPACES to control json beautify (FlowiseAI#2483)

    * Added: environment var LOG_JSON_SPACES with default value 2. Used to no beautify JSON on handler.ts
    Fix: logger.verbose was not working because default log level was info

    * Update handler.ts

    ---------

    Co-authored-by: patrick <patrick.alves@br.experian.com>
    Co-authored-by: Henry Heng <henryheng@flowiseai.com>

commit 5d649b2
Author: Henry <hzj94@hotmail.com>
Date:   Wed May 29 18:22:41 2024 +0100

    update server ts config to exclude test.ts

commit f5b0886
Author: jiabaow <60721007+jiabaow@users.noreply.github.com>
Date:   Wed May 29 10:01:35 2024 -0700

    test validateKey (FlowiseAI#2485)

    add validateKey.test.ts

commit 97386bc
Author: Henry Heng <henryheng@flowiseai.com>
Date:   Tue May 28 22:36:12 2024 +0100

    Bugfix/Files not removed when doc store loader is deleted (FlowiseAI#2502)

    fix files not removed when doc store loader is deleted

commit 22f3969
Author: Henry Heng <henryheng@flowiseai.com>
Date:   Fri May 24 18:57:49 2024 +0100

    Bugfix/Use vm2 for chatflow tool (FlowiseAI#2482)

    use vm2 for chatflow tool

commit 82899d9
Author: YISH <mokeyish@hotmail.com>
Date:   Fri May 24 09:26:34 2024 +0800

    Fix JSON escaping (FlowiseAI#2461)

commit 50c53de
Author: jiabaow <60721007+jiabaow@users.noreply.github.com>
Date:   Thu May 23 17:22:41 2024 -0700

    Together AI llms (FlowiseAI#2454)

    * add TogetherAI.ts skeleton

    * add TogetherAI api links

    * fix constructing final obj

    * fix INodeData import

    * fix category

    * fix version & streaming

    * add stop

    * update constructor

    * update constructor with default values

    * add togetherAI logo

    * add credential

    * change logo

    * update streaming

    * disable streaming

    * remove model

    * clean up comment

    * delete unused icon

    * add togetherAI for streaming

    * Update index.ts

    ---------

    Co-authored-by: Henry Heng <henryheng@flowiseai.com>

commit e32b643
Author: Henry Heng <henryheng@flowiseai.com>
Date:   Thu May 23 15:46:11 2024 +0100

    Bugfix/Regex check for auth middleware (FlowiseAI#2469)

    add regex check for auth middleware

commit 265de4e
Author: patrickreinan <patrickreinan@gmail.com>
Date:   Thu May 23 07:49:15 2024 -0300

    Added Opensearch credential (FlowiseAI#2458)

    * Added Openserch credential

    * fix issues detected by linter

    * rename to camelcase openSearchUrl

    * Update OpenSearch.ts

    ---------

    Co-authored-by: patrick <patrick.alves@br.experian.com>
    Co-authored-by: Henry Heng <henryheng@flowiseai.com>

commit ff23817
Author: Vinod Kiran <vinodkiran@outlook.in>
Date:   Wed May 22 18:05:08 2024 +0530

    Chore/upgrade llamaindex version (FlowiseAI#2440)

    * updates to loader to support file upload

    * adding a todo

    * upgrade llamaindex

    * update groq icon

    * update azure models

    * update llamaindex version

    ---------

    Co-authored-by: Henry <hzj94@hotmail.com>

commit e83dcb0
Author: Henry <hzj94@hotmail.com>
Date:   Tue May 21 16:50:53 2024 +0100

    🥳 flowise-ui@1.8.0 release

commit 9d10dc4
Author: Henry <hzj94@hotmail.com>
Date:   Tue May 21 16:50:29 2024 +0100

    🥳 flowise@1.8.0 release

commit 68625c0
Author: Henry <hzj94@hotmail.com>
Date:   Tue May 21 16:49:59 2024 +0100

    🥳 flowise-components@1.8.0 release

commit 8ebc4dc
Author: Henry Heng <henryheng@flowiseai.com>
Date:   Tue May 21 16:36:42 2024 +0100

    Feature/lang graph (FlowiseAI#2319)

    * add langgraph

    * datasource: initial commit

    * datasource: datasource details and chunks

    * datasource: Document Store Node

    * more changes

    * Document Store - Base functionality

    * Document Store Loader Component

    * Document Store Loader Component

    * before merging the modularity PR

    * after merging the modularity PR

    * preview mode

    * initial draft PR

    * fixes

    * minor updates and  fixes

    * preview with loader and splitter

    * preview with credential

    * show stored chunks

    * preview update...

    * edit config

    * save, preview and other changes

    * save, preview and other changes

    * save, process and other changes

    * save, process and other changes

    * alpha1 - for internal testing

    * rerouting urls

    * bug fix on new leader create

    * pagination support for chunks

    * delete document store

    * Update pnpm-lock.yaml

    * doc store card view

    * Update store files to use updated storage functions, Document Store Table View and other changes

    * ui changes

    * add expanded chunk dialog, improve ui

    * change throw Error to InternalError

    * Bug Fixes and removal of subFolder, adding of view chunks for store

    * lint fixes

    * merge changes

    * DocumentStoreStatus component

    * ui changes for doc store

    * add remove metadata key field, add custom document loader

    * add chatflows used doc store chips

    * add types/interfaces to DocumentStore Services

    * document loader list dialog title bar color change

    * update interfaces

    * Whereused Chatflow Name and Added chunkNo to retain order of created chunks.

    * use typeorm order chunkNo, ui changes

    * update tabler icons react

    * cleanup agents

    * add pysandbox tool

    * add abort functionality, loading next agent

    * add empty view svg

    * update chatflow tool with chatId

    * rename to agentflows

    * update worker for prompt input values

    * update dashboard to agentflows, agentcanvas

    * fix marketplace use template

    * add agentflow templates

    * resolve merge conflict

    * update baseURL

    ---------

    Co-authored-by: vinodkiran <vinodkiran@usa.net>
    Co-authored-by: Vinod Paidimarry <vinodkiran@outlook.in>

commit 95f1090
Author: Vinod Kiran <vinodkiran@outlook.in>
Date:   Tue May 21 16:40:30 2024 +0530

    BugFix FlowiseAI#2386: Double quotes are not escaped, flow crashes (FlowiseAI#2448)

    Fix for FlowiseAI#2386

commit 5733a80
Author: YISH <mokeyish@hotmail.com>
Date:   Tue May 21 00:09:27 2024 +0800

    Avoid .env packaging into docker images. (FlowiseAI#2451)

commit 8caca47
Author: Henry Heng <henryheng@flowiseai.com>
Date:   Mon May 20 17:08:34 2024 +0100

    Feature/Add prepend messages to memory (FlowiseAI#2410)

    add prepend messages to memory

commit 816436f
Author: Henry Heng <henryheng@flowiseai.com>
Date:   Fri May 17 11:41:29 2024 +0100

    Chore/upgrade lc version (FlowiseAI#2422)

    * update langchain version, openai, mistral, vertex, anthropic, introduced toolagent

    * upgrade @google/generative-ai 0.7.0, replicate and faiss-node

    * update cohere ver

    * adding chatCohere to streaming

    * update gemini to have image upload

    * update google genai, remove aiplugin

    * upgrade langchain version

    * fix lint

commit 0521e6b
Author: Quinn <44334535+QuinnGT@users.noreply.github.com>
Date:   Fri May 17 03:41:09 2024 -0700

    Updated bedrock model list (FlowiseAI#2426)

    Added missing relevant chat and embed models. Added descriptions from aws docs.

commit 0365afb
Author: Henry Heng <henryheng@flowiseai.com>
Date:   Fri May 17 11:40:17 2024 +0100

    Feature/Add rpc filter to supabase (FlowiseAI#2425)

    add rpc filter to supabase
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants