From 957da16d6ef5f4b2eb0de1711910c3b013cc1047 Mon Sep 17 00:00:00 2001 From: merrygoround-of-life Date: Wed, 11 Oct 2023 12:59:27 +0900 Subject: [PATCH 01/13] Fix: missing numexpr when using poetry to run --- pyproject.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/pyproject.toml b/pyproject.toml index 192528702..0bbd31714 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -90,6 +90,7 @@ langfuse = "^1.0.13" pillow = "^10.0.0" metal-sdk = "^2.2.0" markupsafe = "^2.1.3" +numexpr = "^2.8.6" [tool.poetry.group.dev.dependencies] From 7fbb1078da6a30da60510bf68b1514b418185d91 Mon Sep 17 00:00:00 2001 From: Ofer Mendelevitch Date: Sat, 14 Oct 2023 03:03:30 -0700 Subject: [PATCH 02/13] update of Vectara component --- src/backend/langflow/components/vectorstores/Vectara.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/backend/langflow/components/vectorstores/Vectara.py b/src/backend/langflow/components/vectorstores/Vectara.py index 6edc69822..509d12a99 100644 --- a/src/backend/langflow/components/vectorstores/Vectara.py +++ b/src/backend/langflow/components/vectorstores/Vectara.py @@ -5,7 +5,6 @@ from langchain.vectorstores import Vectara from langchain.schema import Document from langchain.vectorstores.base import VectorStore from langchain.schema import BaseRetriever -from langchain.embeddings.base import Embeddings class VectaraComponent(CustomComponent): @@ -22,7 +21,6 @@ class VectaraComponent(CustomComponent): "vectara_api_key": {"display_name": "Vectara API Key", "password": True}, "code": {"show": False}, "documents": {"display_name": "Documents"}, - "embedding": {"display_name": "Embedding"}, } def build( @@ -30,21 +28,21 @@ class VectaraComponent(CustomComponent): vectara_customer_id: str, vectara_corpus_id: str, vectara_api_key: str, - embedding: Optional[Embeddings] = None, documents: Optional[Document] = None, ) -> Union[VectorStore, BaseRetriever]: # If documents, then we need to create a Vectara instance using .from_documents - if documents is not None and embedding is not None: + if documents is not None: return Vectara.from_documents( documents=documents, # type: ignore vectara_customer_id=vectara_customer_id, vectara_corpus_id=vectara_corpus_id, vectara_api_key=vectara_api_key, - embedding=embedding, + source='langflow', ) return Vectara( vectara_customer_id=vectara_customer_id, vectara_corpus_id=vectara_corpus_id, vectara_api_key=vectara_api_key, + source='langflow', ) From d9e69b1ba30116bb41dacbe9561eab9c6f976562 Mon Sep 17 00:00:00 2001 From: Gabriel Luiz Freitas Almeida Date: Mon, 16 Oct 2023 09:59:43 -0300 Subject: [PATCH 03/13] =?UTF-8?q?=F0=9F=94=A7=20chore(.env.example):=20add?= =?UTF-8?q?=20LANGFLOW=5FAUTO=5FLOGIN=20variable=20to=20enable/disable=20a?= =?UTF-8?q?utomatic=20login=20feature?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .env.example | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.env.example b/.env.example index b3e592bdf..ccab7c28e 100644 --- a/.env.example +++ b/.env.example @@ -56,6 +56,14 @@ LANGFLOW_REMOVE_API_KEYS= # LANGFLOW_REDIS_CACHE_EXPIRE (default: 3600) LANGFLOW_CACHE_TYPE= +# Auto login +# If set to true then a superuser will be logged in automatically +# and the login page will be skipped, keeping the +# default experience of Langflow +# Values: true, false +# Example: LANGFLOW_AUTO_LOGIN=true +LANGFLOW_AUTO_LOGIN= + # Superuser username # Example: LANGFLOW_SUPERUSER=admin LANGFLOW_SUPERUSER= From 466c158f1576881deb4726877b3a1901d7a90307 Mon Sep 17 00:00:00 2001 From: anovazzi1 Date: Mon, 16 Oct 2023 13:53:36 -0300 Subject: [PATCH 04/13] fix(tabsContext.tsx): remove unnecessary noticeData setting when downloading a file feat(tabsContext.tsx): change the order of arguments in addFlow function call to improve readability feat(exportModal/index.tsx): add alertContext and setNoticeData to display a warning when saving a file with API keys feat(exportModal/index.tsx): add a caution message to inform users about the consequences of saving with API keys --- src/frontend/src/contexts/tabsContext.tsx | 5 +---- src/frontend/src/modals/exportModal/index.tsx | 17 ++++++++++++++--- 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/src/frontend/src/contexts/tabsContext.tsx b/src/frontend/src/contexts/tabsContext.tsx index 79b39ad60..cba2376b5 100644 --- a/src/frontend/src/contexts/tabsContext.tsx +++ b/src/frontend/src/contexts/tabsContext.tsx @@ -260,9 +260,6 @@ export function TabsProvider({ children }: { children: ReactNode }) { // simulate a click on the link element to trigger the download link.click(); - setNoticeData({ - title: "Warning: Critical data, JSON file may include API keys.", - }); } function downloadFlows() { @@ -300,7 +297,7 @@ export function TabsProvider({ children }: { children: ReactNode }) { let fileData = JSON.parse(text); if (fileData.flows) { fileData.flows.forEach((flow: FlowType) => { - id = addFlow(flow, newProject); + id = addFlow(newProject, flow); }); } // parse the text into a JSON object diff --git a/src/frontend/src/modals/exportModal/index.tsx b/src/frontend/src/modals/exportModal/index.tsx index 01b655b39..89bc292c9 100644 --- a/src/frontend/src/modals/exportModal/index.tsx +++ b/src/frontend/src/modals/exportModal/index.tsx @@ -4,6 +4,7 @@ import IconComponent from "../../components/genericIconComponent"; import { Button } from "../../components/ui/button"; import { Checkbox } from "../../components/ui/checkbox"; import { EXPORT_DIALOG_SUBTITLE } from "../../constants/constants"; +import { alertContext } from "../../contexts/alertContext"; import { TabsContext } from "../../contexts/tabsContext"; import { removeApiKeys } from "../../utils/reactflowUtils"; import BaseModal from "../baseModal"; @@ -11,7 +12,8 @@ import BaseModal from "../baseModal"; const ExportModal = forwardRef( (props: { children: ReactNode }, ref): JSX.Element => { const { flows, tabId, downloadFlow } = useContext(TabsContext); - const [checked, setChecked] = useState(false); + const { setNoticeData } = useContext(alertContext); + const [checked, setChecked] = useState(true); const flow = flows.find((f) => f.id === tabId); useEffect(() => { setName(flow!.name); @@ -44,6 +46,7 @@ const ExportModal = forwardRef(
{ setChecked(event); }} @@ -52,18 +55,26 @@ const ExportModal = forwardRef( Save with my API keys
+ + Caution: Uncheck this box only removes API keys from fields + specifically designated for API keys. +