diff --git a/langflow/backend/langflow_backend/interface/signature.py b/langflow/backend/langflow_backend/interface/signature.py
index ad1ffbb79..c5d24d560 100644
--- a/langflow/backend/langflow_backend/interface/signature.py
+++ b/langflow/backend/langflow_backend/interface/signature.py
@@ -86,7 +86,7 @@ def get_tool_signature(name: str):
type_dict = {
"str": {
"type": "str",
- "required": False,
+ "required": True,
"list": False,
"show": True,
"placeholder": "",
@@ -111,9 +111,15 @@ def get_tool_signature(name: str):
params = []
template = {
- param: (type_dict[param] if param == "llm" else type_dict["str"])
+ param: (type_dict[param].copy() if param == "llm" else type_dict["str"].copy())
for param in params
- } # type: Dict[str, Any]
+ }
+
+ # Remove required from aiosession
+ if "aiosession" in template.keys():
+ template["aiosession"]["required"] = False
+ template["aiosession"]["show"] = False
+
template["_type"] = tool_type
return {
diff --git a/langflow/frontend/src/alerts/error/index.tsx b/langflow/frontend/src/alerts/error/index.tsx
index 65a582be5..94e71a98e 100644
--- a/langflow/frontend/src/alerts/error/index.tsx
+++ b/langflow/frontend/src/alerts/error/index.tsx
@@ -1,64 +1,66 @@
import { Transition } from "@headlessui/react";
import { XCircleIcon, XMarkIcon } from "@heroicons/react/24/outline";
import { useEffect, useState } from "react";
-import { ErrorAlertType} from "../../types/alerts";
+import { ErrorAlertType } from "../../types/alerts";
-export default function ErrorAlert({ title, list = [], id, removeAlert }:ErrorAlertType) {
- const [show, setShow] = useState(true);
- useEffect(() => {
- if(show){
- setTimeout(() => {
- setShow(false); setTimeout(() => {removeAlert(id);}, 500);
- }, 5000);
- }
- }, [id, removeAlert, show]);
- return (
-
-
-
-
-
-
-
-
{title}
- {list.length !== 0
- ?
-
-
- {list.map((item, index) => (
- - {item}
- ))}
-
-
- :
- <>>
- }
-
-
-
-
-
-
-
-
-
-
- );
+export default function ErrorAlert({
+ title,
+ list = [],
+ id,
+ removeAlert,
+}: ErrorAlertType) {
+ const [show, setShow] = useState(true);
+ useEffect(() => {
+ if (show) {
+ setTimeout(() => {
+ setShow(false);
+ setTimeout(() => {
+ removeAlert(id);
+ }, 500);
+ }, 5000);
+ }
+ }, [id, removeAlert, show]);
+ return (
+
+ {
+ setShow(false);
+ setTimeout(() => {
+ removeAlert(id);
+ }, 500);
+ }}
+ className="rounded-md w-96 mt-6 shadow-xl bg-red-50 p-4 cursor-pointer"
+ >
+
+
+
+
+
+
{title}
+ {list.length !== 0 ? (
+
+
+ {list.map((item, index) => (
+ - {item}
+ ))}
+
+
+ ) : (
+ <>>
+ )}
+
+
+
+
+ );
}
diff --git a/langflow/frontend/src/alerts/notice/index.tsx b/langflow/frontend/src/alerts/notice/index.tsx
index 86e55c8e4..3c5095339 100644
--- a/langflow/frontend/src/alerts/notice/index.tsx
+++ b/langflow/frontend/src/alerts/notice/index.tsx
@@ -4,63 +4,64 @@ import { useEffect, useState } from "react";
import { Link } from "react-router-dom";
import { NoticeAlertType } from "../../types/alerts";
-export default function NoticeAlert({ title, link = "", id, removeAlert }:NoticeAlertType) {
- const [show, setShow] = useState(true);
- useEffect(() => {
- if(show){
- setTimeout(() => {
- setShow(false); setTimeout(() => {removeAlert(id);}, 500);
- }, 5000);
- }
- }, [id, removeAlert, show]);
- return (
-
-
-
-
-
-
-
-
{title}
-
- {link !== ""
- ?
-
- Details
-
- :
- <>>
- }
-
-
-
-
-
-
-
-
-
-
- );
+export default function NoticeAlert({
+ title,
+ link = "",
+ id,
+ removeAlert,
+}: NoticeAlertType) {
+ const [show, setShow] = useState(true);
+ useEffect(() => {
+ if (show) {
+ setTimeout(() => {
+ setShow(false);
+ setTimeout(() => {
+ removeAlert(id);
+ }, 500);
+ }, 5000);
+ }
+ }, [id, removeAlert, show]);
+ return (
+
+ {
+ setShow(false);
+ removeAlert(id);
+ }}
+ className="rounded-md w-96 mt-6 shadow-xl bg-blue-50 p-4"
+ >
+
+
+
+
+
+
{title}
+
+ {link !== "" ? (
+
+ Details
+
+ ) : (
+ <>>
+ )}
+
+
+
+
+
+ );
}
diff --git a/langflow/frontend/src/alerts/success/index.tsx b/langflow/frontend/src/alerts/success/index.tsx
index 07659c19e..80b98b05d 100644
--- a/langflow/frontend/src/alerts/success/index.tsx
+++ b/langflow/frontend/src/alerts/success/index.tsx
@@ -3,50 +3,51 @@ import { CheckCircleIcon, XMarkIcon } from "@heroicons/react/24/outline";
import { useEffect, useState } from "react";
import { SuccessAlertType } from "../../types/alerts";
-export default function SuccessAlert({ title, id, removeAlert }:SuccessAlertType) {
- const [show, setShow] = useState(true);
- useEffect(() => {
- if(show){
- setTimeout(() => {
- setShow(false); setTimeout(() => {removeAlert(id);}, 500);
- }, 5000);
- }
- }, [id, removeAlert, show]);
- return (
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- );
+export default function SuccessAlert({
+ title,
+ id,
+ removeAlert,
+}: SuccessAlertType) {
+ const [show, setShow] = useState(true);
+ useEffect(() => {
+ if (show) {
+ setTimeout(() => {
+ setShow(false);
+ setTimeout(() => {
+ removeAlert(id);
+ }, 500);
+ }, 5000);
+ }
+ }, [id, removeAlert, show]);
+ return (
+
+ {
+ setShow(false);
+ removeAlert(id);
+ }}
+ className="rounded-md w-96 mt-6 shadow-xl bg-green-50 p-4"
+ >
+
+
+
+ );
}
diff --git a/langflow/frontend/src/components/chatComponent/index.tsx b/langflow/frontend/src/components/chatComponent/index.tsx
index 4cf6dcd82..0ddd1764c 100644
--- a/langflow/frontend/src/components/chatComponent/index.tsx
+++ b/langflow/frontend/src/components/chatComponent/index.tsx
@@ -147,7 +147,7 @@ export default function Chat({ flow, reactFlowInstance }: ChatType) {
clearChat();
}}
>
- clear
+ Clear
diff --git a/langflow/frontend/src/contexts/tabsContext.tsx b/langflow/frontend/src/contexts/tabsContext.tsx
index 7b3f60e06..ba148f2d9 100644
--- a/langflow/frontend/src/contexts/tabsContext.tsx
+++ b/langflow/frontend/src/contexts/tabsContext.tsx
@@ -1,7 +1,8 @@
-import { createContext, useEffect, useState, useRef, ReactNode } from "react";
+import { createContext, useEffect, useState, useRef, ReactNode, useContext } from "react";
import { FlowType } from "../types/flow";
import { TabsContextType } from "../types/tabs";
import { normalCaseToSnakeCase } from "../utils";
+import { alertContext } from "./alertContext";
const TabsContextInitialValue: TabsContextType = {
tabIndex: 0,
@@ -20,6 +21,7 @@ export const TabsContext = createContext
(
);
export function TabsProvider({ children }: { children: ReactNode }) {
+ const {setNoticeData} = useContext(alertContext)
const [tabIndex, setTabIndex] = useState(0);
const [flows, setFlows] = useState>([]);
const [id, setId] = useState(0);
@@ -66,6 +68,7 @@ export function TabsProvider({ children }: { children: ReactNode }) {
// simulate a click on the link element to trigger the download
link.click();
+ setNoticeData({title:"Warning: Critical data, including API keys, in JSON file. Keep secure and do not share."})
}
/**