diff --git a/langflow/backend/langflow_backend/api/endpoints.py b/langflow/backend/langflow_backend/api/endpoints.py index 1ca745b20..6e1b6a1f4 100644 --- a/langflow/backend/langflow_backend/api/endpoints.py +++ b/langflow/backend/langflow_backend/api/endpoints.py @@ -1,186 +1,21 @@ -from fastapi import APIRouter -from langflow_backend.api import signature -from langflow_backend.api import list_endpoints -from langflow_backend.utils import payload -from langchain.agents.loading import load_agent_executor_from_config -from langchain.chains.loading import load_chain_from_config -from langchain.llms.loading import load_llm_from_config - -from langchain.prompts.loading import load_prompt_from_config -from typing import Any -import io -import contextlib -import re +from fastapi import APIRouter, HTTPException +from langflow_backend.interface.types import build_langchain_types_dict, get_type_list +from langflow_backend.interface.loading import process_data_graph +from typing import Any, Dict # build router router = APIRouter() -def get_type_list(): - all_types = get_all() - - all_types.pop("tools") - - for key, value in all_types.items(): - all_types[key] = [item["template"]["_type"] for item in value.values()] - - return all_types - - @router.get("/all") def get_all(): - return { - "chains": { - chain: signature.get_chain(chain) for chain in list_endpoints.list_chains() - }, - "agents": { - agent: signature.get_agent(agent) for agent in list_endpoints.list_agents() - }, - "prompts": { - prompt: signature.get_prompt(prompt) - for prompt in list_endpoints.list_prompts() - }, - "llms": {llm: signature.get_llm(llm) for llm in list_endpoints.list_llms()}, - "tools": { - tool: signature.get_tool(tool) for tool in list_endpoints.list_tools() - }, - } + return build_langchain_types_dict() @router.post("/predict") -def get_load(data: dict[str, Any]): - # Get type list - type_list = get_type_list() - - # Substitute ZeroShotPromt with PromptTemplate - for node in data["nodes"]: - if node["data"]["type"] == "ZeroShotPrompt": - # Build Prompt Template - tools = [ - tool - for tool in data["nodes"] - if tool["type"] != "chatOutputNode" - and "Tool" in tool["data"]["node"]["base_classes"] - ] - node["data"] = build_prompt_template(prompt=node["data"], tools=tools) - break - - # Add input variables - data = payload.extract_input_variables(data) - - # Nodes, edges and root node - message = data["message"] - nodes = data["nodes"] - edges = data["edges"] - root = payload.get_root_node(data) - - extracted_json = payload.build_json(root, nodes, edges) - - # Build json - if extracted_json["_type"] in type_list["agents"]: - loaded = load_agent_executor_from_config(extracted_json) - - with io.StringIO() as output_buffer, contextlib.redirect_stdout(output_buffer): - result = loaded.run(message) - thought = output_buffer.getvalue() - - elif extracted_json["_type"] in type_list["chains"]: - loaded = load_chain_from_config(extracted_json) - - with io.StringIO() as output_buffer, contextlib.redirect_stdout(output_buffer): - result = loaded.run(message) - thought = output_buffer.getvalue() - - elif extracted_json["_type"] in type_list["llms"]: - loaded = load_llm_from_config(extracted_json) - - with io.StringIO() as output_buffer, contextlib.redirect_stdout(output_buffer): - result = loaded(message) - thought = output_buffer.getvalue() - else: - result = "Error: Type should be either agent, chain or llm" - thought = "" - - # Remove unnecessary data from response - begin = thought.rfind(message) - thought = thought[(begin + len(message)) :] - - return { - "result": result, - "thought": re.sub( - r"\x1b\[([0-9,A-Z]{1,2}(;[0-9,A-Z]{1,2})?)?[m|K]", "", thought - ).strip(), - } - - -def build_prompt_template(prompt, tools): - prefix = prompt["node"]["template"]["prefix"]["value"] - suffix = prompt["node"]["template"]["suffix"]["value"] - format_instructions = prompt["node"]["template"]["format_instructions"]["value"] - - tool_strings = "\n".join( - [ - f"{tool['data']['node']['name']}: {tool['data']['node']['description']}" - for tool in tools - ] - ) - tool_names = ", ".join([tool["data"]["node"]["name"] for tool in tools]) - format_instructions = format_instructions.format(tool_names=tool_names) - value = "\n\n".join([prefix, tool_strings, format_instructions, suffix]) - - prompt["type"] = "PromptTemplate" - - prompt["node"] = { - "template": { - "_type": "prompt", - "input_variables": { - "type": "str", - "required": True, - "placeholder": "", - "list": True, - "show": False, - "multiline": False, - }, - "output_parser": { - "type": "BaseOutputParser", - "required": False, - "placeholder": "", - "list": False, - "show": False, - "multline": False, - "value": None, - }, - "template": { - "type": "str", - "required": True, - "placeholder": "", - "list": False, - "show": True, - "multiline": True, - "value": value, - }, - "template_format": { - "type": "str", - "required": False, - "placeholder": "", - "list": False, - "show": False, - "multline": False, - "value": "f-string", - }, - "validate_template": { - "type": "bool", - "required": False, - "placeholder": "", - "list": False, - "show": False, - "multline": False, - "value": True, - }, - }, - "description": "Schema to represent a prompt for an LLM.", - "base_classes": ["BasePromptTemplate"], - } - - return prompt +def get_load(data: Dict[str, Any]): + try: + return process_data_graph(data) + except Exception as e: + return HTTPException(status_code=500, detail=str(e)) diff --git a/langflow/backend/langflow_backend/api/list_endpoints.py b/langflow/backend/langflow_backend/api/list_endpoints.py index 0f637345b..4925615ba 100644 --- a/langflow/backend/langflow_backend/api/list_endpoints.py +++ b/langflow/backend/langflow_backend/api/list_endpoints.py @@ -1,14 +1,6 @@ from fastapi import APIRouter -from langchain import chains -from langchain import agents -from langchain import prompts -from langchain import llms -from langchain.chains.conversation import memory as memories -from langchain.agents.load_tools import get_all_tool_names -from langflow_backend.utils import util, allowed_components -from langflow_backend.custom import customs - +from langflow_backend.interface.listing import list_type # build router router = APIRouter( @@ -32,61 +24,35 @@ def read_items(): @router.get("/chains") def list_chains(): """List all chain types""" - return [ - chain.__annotations__["return"].__name__ - for chain in chains.loading.type_to_loader_dict.values() - if chain.__annotations__["return"].__name__ in allowed_components.CHAINS - ] + return list_type("chains") @router.get("/agents") def list_agents(): """List all agent types""" # return list(agents.loading.AGENT_TO_CLASS.keys()) - return [ - agent.__name__ - for agent in agents.loading.AGENT_TO_CLASS.values() - if agent.__name__ in allowed_components.AGENTS - ] + return list_type("agents") @router.get("/prompts") def list_prompts(): """List all prompt types""" - custom_prompts = customs.get_custom_prompts() - library_prompts = [ - prompt.__annotations__["return"].__name__ - for prompt in prompts.loading.type_to_loader_dict.values() - if prompt.__annotations__["return"].__name__ in allowed_components.PROMPTS - ] - return library_prompts + list(custom_prompts.keys()) + return list_type("prompts") @router.get("/llms") def list_llms(): """List all llm types""" - return [ - llm.__name__ - for llm in llms.type_to_cls_dict.values() - if llm.__name__ in allowed_components.LLMS - ] + return list_type("llms") @router.get("/memories") def list_memories(): """List all memory types""" - return [memory.__name__ for memory in memories.type_to_cls_dict.values()] + return list_type("memories") @router.get("/tools") def list_tools(): """List all load tools""" - - tools = [] - - for tool in get_all_tool_names(): - tool_params = util.get_tool_params(util.get_tools_dict(tool)) - if tool_params and tool_params["name"] in allowed_components.TOOLS: - tools.append(tool_params["name"]) - - return tools + return list_type("tools") diff --git a/langflow/backend/langflow_backend/api/signature.py b/langflow/backend/langflow_backend/api/signature.py index 7aa0d3b83..4a2bfdc19 100644 --- a/langflow/backend/langflow_backend/api/signature.py +++ b/langflow/backend/langflow_backend/api/signature.py @@ -1,17 +1,6 @@ -from typing import Any, Dict from fastapi import APIRouter, HTTPException -from langchain import agents, chains, llms, prompts -from langchain.agents.load_tools import ( - _BASE_TOOLS, - _EXTRA_LLM_TOOLS, - _EXTRA_OPTIONAL_TOOLS, - _LLM_TOOLS, - get_all_tool_names, -) -from langchain.chains.conversation import memory as memories -from langflow_backend.utils import util -from langflow_backend.custom import customs +from langflow_backend.interface.signature import get_signature # build router router = APIRouter( @@ -24,9 +13,7 @@ router = APIRouter( def get_chain(name: str): """Get the signature of a chain.""" try: - return util.build_template_from_function( - name, chains.loading.type_to_loader_dict - ) + return get_signature(name, "chains") except ValueError as exc: raise HTTPException(status_code=404, detail="Chain not found") from exc @@ -35,7 +22,7 @@ def get_chain(name: str): def get_agent(name: str): """Get the signature of an agent.""" try: - return util.build_template_from_class(name, agents.loading.AGENT_TO_CLASS) + return get_signature(name, "agents") except ValueError as exc: raise HTTPException(status_code=404, detail="Agent not found") from exc @@ -44,11 +31,7 @@ def get_agent(name: str): def get_prompt(name: str): """Get the signature of a prompt.""" try: - if name in customs.get_custom_prompts().keys(): - return customs.get_custom_prompts()[name] - return util.build_template_from_function( - name, prompts.loading.type_to_loader_dict - ) + return get_signature(name, "prompts") except ValueError as exc: raise HTTPException(status_code=404, detail="Prompt not found") from exc @@ -57,7 +40,7 @@ def get_prompt(name: str): def get_llm(name: str): """Get the signature of an llm.""" try: - return util.build_template_from_class(name, llms.type_to_cls_dict) + return get_signature(name, "llms") except ValueError as exc: raise HTTPException(status_code=404, detail="LLM not found") from exc @@ -66,7 +49,7 @@ def get_llm(name: str): def get_memory(name: str): """Get the signature of a memory.""" try: - return util.build_template_from_class(name, memories.type_to_cls_dict) + return get_signature(name, "memories") except ValueError as exc: raise HTTPException(status_code=404, detail="Memory not found") from exc @@ -74,51 +57,7 @@ def get_memory(name: str): @router.get("/tool") def get_tool(name: str): """Get the signature of a tool.""" - - all_tools = {} - for tool in get_all_tool_names(): - if tool_params := util.get_tool_params(util.get_tools_dict(tool)): - all_tools[tool_params["name"]] = tool - - # Raise error if name is not in tools - if name not in all_tools.keys(): - raise HTTPException(status_code=404, detail=f"Tool {name} not found.") - - type_dict = { - "str": { - "type": "str", - "required": False, - "list": False, - "show": True, - "placeholder": "", - "value": "", - }, - "llm": {"type": "BaseLLM", "required": True, "list": False, "show": True}, - } - - tool_type = all_tools[name] - - if tool_type in _BASE_TOOLS: - params = [] - elif tool_type in _LLM_TOOLS: - params = ["llm"] - elif tool_type in _EXTRA_LLM_TOOLS: - _, extra_keys = _EXTRA_LLM_TOOLS[tool_type] - params = ["llm"] + extra_keys - elif tool_type in _EXTRA_OPTIONAL_TOOLS: - _, extra_keys = _EXTRA_OPTIONAL_TOOLS[tool_type] - params = extra_keys - else: - params = [] - - template = { - param: (type_dict[param] if param == "llm" else type_dict["str"]) - for param in params - } # type: Dict[str, Any] - template["_type"] = tool_type - - return { - "template": template, - **util.get_tool_params(util.get_tools_dict(tool_type)), - "base_classes": ["Tool"], - } + try: + return get_signature(name, "tools") + except ValueError as exc: + raise HTTPException(status_code=404, detail="Tool not found") from exc diff --git a/langflow/backend/langflow_backend/interface/__init__.py b/langflow/backend/langflow_backend/interface/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/langflow/backend/langflow_backend/interface/listing.py b/langflow/backend/langflow_backend/interface/listing.py new file mode 100644 index 000000000..a71f843ee --- /dev/null +++ b/langflow/backend/langflow_backend/interface/listing.py @@ -0,0 +1,74 @@ +from langchain import chains, agents, prompts, llms +from langflow_backend.custom import customs +from langflow_backend.utils import util, allowed_components +from langchain.agents.load_tools import get_all_tool_names +from langchain.chains.conversation import memory as memories + + +def list_type(object_type: str): + """List all components""" + return { + "chains": list_chain_types, + "agents": list_agents, + "prompts": list_prompts, + "llms": list_llms, + "tools": list_tools, + "memories": list_memories, + }.get(object_type, lambda: "Invalid type")() + + +def list_agents(): + """List all agent types""" + # return list(agents.loading.AGENT_TO_CLASS.keys()) + return [ + agent.__name__ + for agent in agents.loading.AGENT_TO_CLASS.values() + if agent.__name__ in allowed_components.AGENTS + ] + + +def list_prompts(): + """List all prompt types""" + custom_prompts = customs.get_custom_prompts() + library_prompts = [ + prompt.__annotations__["return"].__name__ + for prompt in prompts.loading.type_to_loader_dict.values() + if prompt.__annotations__["return"].__name__ in allowed_components.PROMPTS + ] + return library_prompts + list(custom_prompts.keys()) + + +def list_tools(): + """List all load tools""" + + tools = [] + + for tool in get_all_tool_names(): + tool_params = util.get_tool_params(util.get_tools_dict(tool)) + if tool_params and tool_params["name"] in allowed_components.TOOLS: + tools.append(tool_params["name"]) + + return tools + + +def list_llms(): + """List all llm types""" + return [ + llm.__name__ + for llm in llms.type_to_cls_dict.values() + if llm.__name__ in allowed_components.LLMS + ] + + +def list_chain_types(): + """List all chain types""" + return [ + chain.__annotations__["return"].__name__ + for chain in chains.loading.type_to_loader_dict.values() + if chain.__annotations__["return"].__name__ in allowed_components.CHAINS + ] + + +def list_memories(): + """List all memory types""" + return [memory.__name__ for memory in memories.type_to_cls_dict.values()] diff --git a/langflow/backend/langflow_backend/interface/loading.py b/langflow/backend/langflow_backend/interface/loading.py new file mode 100644 index 000000000..5882b898d --- /dev/null +++ b/langflow/backend/langflow_backend/interface/loading.py @@ -0,0 +1,152 @@ +import contextlib +import re +import io +from typing import Any, Dict +from langflow_backend.interface.types import get_type_list +from langchain.agents.loading import load_agent_executor_from_config +from langchain.chains.loading import load_chain_from_config +from langchain.llms.loading import load_llm_from_config +from langflow_backend.utils import payload + + +def replace_zero_shot_prompt_with_prompt_template(nodes): + for node in nodes: + if node["data"]["type"] == "ZeroShotPrompt": + # Build Prompt Template + tools = [ + tool + for tool in nodes + if tool["type"] != "chatOutputNode" + and "Tool" in tool["data"]["node"]["base_classes"] + ] + node["data"] = build_prompt_template(prompt=node["data"], tools=tools) + break + return nodes + + +def process_data_graph(data_graph: Dict[str, Any]): + nodes = data_graph["nodes"] + # Substitute ZeroShotPrompt with PromptTemplate + nodes = replace_zero_shot_prompt_with_prompt_template(nodes) + # Add input variables + data_graph = payload.extract_input_variables(data_graph) + # Nodes, edges and root node + message = data_graph["message"] + edges = data_graph["edges"] + root = payload.get_root_node(data_graph) + extracted_json = payload.build_json(root, nodes, edges) + + # Process json + result, thought = get_result_and_thought(extracted_json, message) + + # Remove unnecessary data from response + begin = thought.rfind(message) + thought = thought[(begin + len(message)) :] + + return { + "result": result, + "thought": re.sub( + r"\x1b\[([0-9,A-Z]{1,2}(;[0-9,A-Z]{1,2})?)?[m|K]", "", thought + ).strip(), + } + + +def get_result_and_thought(extracted_json: Dict[str, Any], message: str): + # Get type list + type_list = get_type_list() + if extracted_json["_type"] in type_list["agents"]: + loaded = load_agent_executor_from_config(extracted_json) + + with io.StringIO() as output_buffer, contextlib.redirect_stdout(output_buffer): + result = loaded.run(message) + thought = output_buffer.getvalue() + + elif extracted_json["_type"] in type_list["chains"]: + loaded = load_chain_from_config(extracted_json) + + with io.StringIO() as output_buffer, contextlib.redirect_stdout(output_buffer): + result = loaded.run(message) + thought = output_buffer.getvalue() + + elif extracted_json["_type"] in type_list["llms"]: + loaded = load_llm_from_config(extracted_json) + + with io.StringIO() as output_buffer, contextlib.redirect_stdout(output_buffer): + result = loaded(message) + thought = output_buffer.getvalue() + else: + result = "Error: Type should be either agent, chain or llm" + thought = "" + return result, thought + + +def build_prompt_template(prompt, tools): + prefix = prompt["node"]["template"]["prefix"]["value"] + suffix = prompt["node"]["template"]["suffix"]["value"] + format_instructions = prompt["node"]["template"]["format_instructions"]["value"] + + tool_strings = "\n".join( + [ + f"{tool['data']['node']['name']}: {tool['data']['node']['description']}" + for tool in tools + ] + ) + tool_names = ", ".join([tool["data"]["node"]["name"] for tool in tools]) + format_instructions = format_instructions.format(tool_names=tool_names) + value = "\n\n".join([prefix, tool_strings, format_instructions, suffix]) + + prompt["type"] = "PromptTemplate" + + prompt["node"] = { + "template": { + "_type": "prompt", + "input_variables": { + "type": "str", + "required": True, + "placeholder": "", + "list": True, + "show": False, + "multiline": False, + }, + "output_parser": { + "type": "BaseOutputParser", + "required": False, + "placeholder": "", + "list": False, + "show": False, + "multline": False, + "value": None, + }, + "template": { + "type": "str", + "required": True, + "placeholder": "", + "list": False, + "show": True, + "multiline": True, + "value": value, + }, + "template_format": { + "type": "str", + "required": False, + "placeholder": "", + "list": False, + "show": False, + "multline": False, + "value": "f-string", + }, + "validate_template": { + "type": "bool", + "required": False, + "placeholder": "", + "list": False, + "show": False, + "multline": False, + "value": True, + }, + }, + "description": "Schema to represent a prompt for an LLM.", + "base_classes": ["BasePromptTemplate"], + } + + return prompt diff --git a/langflow/backend/langflow_backend/interface/signature.py b/langflow/backend/langflow_backend/interface/signature.py new file mode 100644 index 000000000..ad1ffbb79 --- /dev/null +++ b/langflow/backend/langflow_backend/interface/signature.py @@ -0,0 +1,123 @@ +from typing import Dict, Any # noqa: F401 +from langchain import agents, chains, llms, prompts +from langchain.agents.load_tools import ( + _BASE_TOOLS, + _EXTRA_LLM_TOOLS, + _EXTRA_OPTIONAL_TOOLS, + _LLM_TOOLS, + get_all_tool_names, +) +from langchain.chains.conversation import memory as memories + +from langflow_backend.utils import util +from langflow_backend.custom import customs + + +def get_signature(name: str, object_type: str): + """Get the signature of an object.""" + return { + "chains": get_chain_signature, + "agents": get_agent_signature, + "prompts": get_prompt_signature, + "llms": get_llm_signature, + "tools": get_tool_signature, + "memories": get_memory_signature, + }.get(object_type, lambda name: f"Invalid type: {name}")(name) + + +def get_chain_signature(name: str): + """Get the chain type by signature.""" + try: + return util.build_template_from_function( + name, chains.loading.type_to_loader_dict + ) + except ValueError as exc: + raise ValueError("Chain not found") from exc + + +def get_agent_signature(name: str): + """Get the signature of an agent.""" + try: + return util.build_template_from_class(name, agents.loading.AGENT_TO_CLASS) + except ValueError as exc: + raise ValueError("Agent not found") from exc + + +def get_prompt_signature(name: str): + """Get the signature of a prompt.""" + try: + if name in customs.get_custom_prompts().keys(): + return customs.get_custom_prompts()[name] + return util.build_template_from_function( + name, prompts.loading.type_to_loader_dict + ) + except ValueError as exc: + raise ValueError("Prompt not found") from exc + + +def get_llm_signature(name: str): + """Get the signature of an llm.""" + try: + return util.build_template_from_class(name, llms.type_to_cls_dict) + except ValueError as exc: + raise ValueError("LLM not found") from exc + + +def get_memory_signature(name: str): + """Get the signature of a memory.""" + try: + return util.build_template_from_class(name, memories.type_to_cls_dict) + except ValueError as exc: + raise ValueError("Memory not found") from exc + + +def get_tool_signature(name: str): + """Get the signature of a tool.""" + + all_tools = {} + for tool in get_all_tool_names(): + if tool_params := util.get_tool_params(util.get_tools_dict(tool)): + all_tools[tool_params["name"]] = tool + + # Raise error if name is not in tools + if name not in all_tools.keys(): + raise ValueError("Tool not found") + + type_dict = { + "str": { + "type": "str", + "required": False, + "list": False, + "show": True, + "placeholder": "", + "value": "", + }, + "llm": {"type": "BaseLLM", "required": True, "list": False, "show": True}, + } + + tool_type = all_tools[name] + + if tool_type in _BASE_TOOLS: + params = [] + elif tool_type in _LLM_TOOLS: + params = ["llm"] + elif tool_type in _EXTRA_LLM_TOOLS: + _, extra_keys = _EXTRA_LLM_TOOLS[tool_type] + params = ["llm"] + extra_keys + elif tool_type in _EXTRA_OPTIONAL_TOOLS: + _, extra_keys = _EXTRA_OPTIONAL_TOOLS[tool_type] + params = extra_keys + else: + params = [] + + template = { + param: (type_dict[param] if param == "llm" else type_dict["str"]) + for param in params + } # type: Dict[str, Any] + template["_type"] = tool_type + + return { + "template": template, + **util.get_tool_params(util.get_tools_dict(tool_type)), + "base_classes": ["Tool"], + } diff --git a/langflow/backend/langflow_backend/interface/types.py b/langflow/backend/langflow_backend/interface/types.py new file mode 100644 index 000000000..ea96d6977 --- /dev/null +++ b/langflow/backend/langflow_backend/interface/types.py @@ -0,0 +1,31 @@ +from langflow_backend.interface.listing import list_type +from langflow_backend.interface.signature import get_signature + + +def get_type_list(): + """Get a list of all langchain types""" + all_types = build_langchain_types_dict() + + all_types.pop("tools") + + for key, value in all_types.items(): + all_types[key] = [item["template"]["_type"] for item in value.values()] + + return all_types + + +def build_langchain_types_dict(): + """Build a dictionary of all langchain types""" + return { + "chains": { + chain: get_signature(chain, "chains") for chain in list_type("chains") + }, + "agents": { + agent: get_signature(agent, "agents") for agent in list_type("agents") + }, + "prompts": { + prompt: get_signature(prompt, "prompts") for prompt in list_type("prompts") + }, + "llms": {llm: get_signature(llm, "llms") for llm in list_type("llms")}, + "tools": {tool: get_signature(tool, "tools") for tool in list_type("tools")}, + } diff --git a/langflow/backend/langflow_backend/utils/util.py b/langflow/backend/langflow_backend/utils/util.py index 3e5e50541..17d669426 100644 --- a/langflow/backend/langflow_backend/utils/util.py +++ b/langflow/backend/langflow_backend/utils/util.py @@ -10,10 +10,10 @@ from langchain.agents.load_tools import ( _EXTRA_LLM_TOOLS, _EXTRA_OPTIONAL_TOOLS, ) -from typing import Optional +from typing import Optional, Dict -def build_template_from_function(name: str, type_to_loader_dict: dict): +def build_template_from_function(name: str, type_to_loader_dict: Dict): classes = [ item.__annotations__["return"].__name__ for item in type_to_loader_dict.values() ] @@ -59,7 +59,7 @@ def build_template_from_function(name: str, type_to_loader_dict: dict): } -def build_template_from_class(name: str, type_to_cls_dict: dict): +def build_template_from_class(name: str, type_to_cls_dict: Dict): classes = [item.__name__ for item in type_to_cls_dict.values()] # Raise error if name is not in chains @@ -130,8 +130,8 @@ def get_tools_dict(name: Optional[str] = None): """Get the tools dictionary.""" tools = { **_BASE_TOOLS, - **_LLM_TOOLS, - **{k: v[0] for k, v in _EXTRA_LLM_TOOLS.items()}, + **_LLM_TOOLS, # type: ignore + **{k: v[0] for k, v in _EXTRA_LLM_TOOLS.items()}, # type: ignore **{k: v[0] for k, v in _EXTRA_OPTIONAL_TOOLS.items()}, } return tools[name] if name else tools @@ -283,7 +283,7 @@ def format_dict(d, name: Optional[str] = None): "temperature", "model_name", ] - or any(text in key for text in ["password", "token", "api", "key"]) + or "api_key" in key ) # Add password field diff --git a/langflow/backend/poetry.lock b/langflow/backend/poetry.lock index 6e8b8eab3..2f3f8875f 100644 --- a/langflow/backend/poetry.lock +++ b/langflow/backend/poetry.lock @@ -616,6 +616,25 @@ category = "main" optional = false python-versions = ">=3.7" +[[package]] +name = "mypy" +version = "1.1.1" +description = "Optional static typing for Python" +category = "dev" +optional = false +python-versions = ">=3.7" + +[package.dependencies] +mypy-extensions = ">=1.0.0" +tomli = {version = ">=1.1.0", markers = "python_version < \"3.11\""} +typing-extensions = ">=3.10" + +[package.extras] +dmypy = ["psutil (>=4.0)"] +install-types = ["pip"] +python2 = ["typed-ast (>=1.4.0,<2)"] +reports = ["lxml"] + [[package]] name = "mypy-extensions" version = "1.0.0" @@ -796,7 +815,7 @@ python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" [[package]] name = "pydantic" -version = "1.10.5" +version = "1.10.6" description = "Data validation and settings management using python type hints" category = "main" optional = false @@ -898,6 +917,14 @@ python-versions = ">=3.6,<4" [package.dependencies] pyasn1 = ">=0.1.3" +[[package]] +name = "ruff" +version = "0.0.254" +description = "An extremely fast Python linter, written in Rust." +category = "dev" +optional = false +python-versions = ">=3.7" + [[package]] name = "six" version = "1.16.0" @@ -1132,7 +1159,7 @@ testing = ["big-O", "flake8 (<5)", "jaraco.functools", "jaraco.itertools", "more [metadata] lock-version = "1.1" python-versions = "^3.9" -content-hash = "60d773cc238912b3adbe51458a006fcef73b07f9e09de636b37ba4d3c99c022b" +content-hash = "e48340fa47860cf68370d1c4b44a2c28267e8182e981508705cd37491213a32b" [metadata.files] aiohttp = [ @@ -1767,6 +1794,34 @@ multidict = [ {file = "multidict-6.0.4-cp39-cp39-win_amd64.whl", hash = "sha256:33029f5734336aa0d4c0384525da0387ef89148dc7191aae00ca5fb23d7aafc2"}, {file = "multidict-6.0.4.tar.gz", hash = "sha256:3666906492efb76453c0e7b97f2cf459b0682e7402c0489a95484965dbc1da49"}, ] +mypy = [ + {file = "mypy-1.1.1-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:39c7119335be05630611ee798cc982623b9e8f0cff04a0b48dfc26100e0b97af"}, + {file = "mypy-1.1.1-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:61bf08362e93b6b12fad3eab68c4ea903a077b87c90ac06c11e3d7a09b56b9c1"}, + {file = "mypy-1.1.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:dbb19c9f662e41e474e0cff502b7064a7edc6764f5262b6cd91d698163196799"}, + {file = "mypy-1.1.1-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:315ac73cc1cce4771c27d426b7ea558fb4e2836f89cb0296cbe056894e3a1f78"}, + {file = "mypy-1.1.1-cp310-cp310-win_amd64.whl", hash = "sha256:5cb14ff9919b7df3538590fc4d4c49a0f84392237cbf5f7a816b4161c061829e"}, + {file = "mypy-1.1.1-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:26cdd6a22b9b40b2fd71881a8a4f34b4d7914c679f154f43385ca878a8297389"}, + {file = "mypy-1.1.1-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:5b5f81b40d94c785f288948c16e1f2da37203c6006546c5d947aab6f90aefef2"}, + {file = "mypy-1.1.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:21b437be1c02712a605591e1ed1d858aba681757a1e55fe678a15c2244cd68a5"}, + {file = "mypy-1.1.1-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:d809f88734f44a0d44959d795b1e6f64b2bbe0ea4d9cc4776aa588bb4229fc1c"}, + {file = "mypy-1.1.1-cp311-cp311-win_amd64.whl", hash = "sha256:a380c041db500e1410bb5b16b3c1c35e61e773a5c3517926b81dfdab7582be54"}, + {file = "mypy-1.1.1-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:b7c7b708fe9a871a96626d61912e3f4ddd365bf7f39128362bc50cbd74a634d5"}, + {file = "mypy-1.1.1-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:c1c10fa12df1232c936830839e2e935d090fc9ee315744ac33b8a32216b93707"}, + {file = "mypy-1.1.1-cp37-cp37m-musllinux_1_1_x86_64.whl", hash = "sha256:0a28a76785bf57655a8ea5eb0540a15b0e781c807b5aa798bd463779988fa1d5"}, + {file = "mypy-1.1.1-cp37-cp37m-win_amd64.whl", hash = "sha256:ef6a01e563ec6a4940784c574d33f6ac1943864634517984471642908b30b6f7"}, + {file = "mypy-1.1.1-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:d64c28e03ce40d5303450f547e07418c64c241669ab20610f273c9e6290b4b0b"}, + {file = "mypy-1.1.1-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:64cc3afb3e9e71a79d06e3ed24bb508a6d66f782aff7e56f628bf35ba2e0ba51"}, + {file = "mypy-1.1.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:ce61663faf7a8e5ec6f456857bfbcec2901fbdb3ad958b778403f63b9e606a1b"}, + {file = "mypy-1.1.1-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:2b0c373d071593deefbcdd87ec8db91ea13bd8f1328d44947e88beae21e8d5e9"}, + {file = "mypy-1.1.1-cp38-cp38-win_amd64.whl", hash = "sha256:2888ce4fe5aae5a673386fa232473014056967f3904f5abfcf6367b5af1f612a"}, + {file = "mypy-1.1.1-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:19ba15f9627a5723e522d007fe708007bae52b93faab00f95d72f03e1afa9598"}, + {file = "mypy-1.1.1-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:59bbd71e5c58eed2e992ce6523180e03c221dcd92b52f0e792f291d67b15a71c"}, + {file = "mypy-1.1.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:9401e33814cec6aec8c03a9548e9385e0e228fc1b8b0a37b9ea21038e64cdd8a"}, + {file = "mypy-1.1.1-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:4b398d8b1f4fba0e3c6463e02f8ad3346f71956b92287af22c9b12c3ec965a9f"}, + {file = "mypy-1.1.1-cp39-cp39-win_amd64.whl", hash = "sha256:69b35d1dcb5707382810765ed34da9db47e7f95b3528334a3c999b0c90fe523f"}, + {file = "mypy-1.1.1-py3-none-any.whl", hash = "sha256:4e4e8b362cdf99ba00c2b218036002bdcdf1e0de085cdb296a49df03fb31dfc4"}, + {file = "mypy-1.1.1.tar.gz", hash = "sha256:ae9ceae0f5b9059f33dbc62dea087e942c0ccab4b7a003719cb70f9b8abfa32f"}, +] mypy-extensions = [ {file = "mypy_extensions-1.0.0-py3-none-any.whl", hash = "sha256:4392f6c0eb8a5668a69e23d168ffa70f0be9ccfd32b5cc2d26a34ae5b844552d"}, {file = "mypy_extensions-1.0.0.tar.gz", hash = "sha256:75dbf8955dc00442a438fc4d0666508a9a97b6bd41aa2f0ffe9d2f2725af0782"}, @@ -1888,42 +1943,42 @@ pycparser = [ {file = "pycparser-2.21.tar.gz", hash = "sha256:e644fdec12f7872f86c58ff790da456218b10f863970249516d60a5eaca77206"}, ] pydantic = [ - {file = "pydantic-1.10.5-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:5920824fe1e21cbb3e38cf0f3dd24857c8959801d1031ce1fac1d50857a03bfb"}, - {file = "pydantic-1.10.5-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:3bb99cf9655b377db1a9e47fa4479e3330ea96f4123c6c8200e482704bf1eda2"}, - {file = "pydantic-1.10.5-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:2185a3b3d98ab4506a3f6707569802d2d92c3a7ba3a9a35683a7709ea6c2aaa2"}, - {file = "pydantic-1.10.5-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:f582cac9d11c227c652d3ce8ee223d94eb06f4228b52a8adaafa9fa62e73d5c9"}, - {file = "pydantic-1.10.5-cp310-cp310-musllinux_1_1_i686.whl", hash = "sha256:c9e5b778b6842f135902e2d82624008c6a79710207e28e86966cd136c621bfee"}, - {file = "pydantic-1.10.5-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:72ef3783be8cbdef6bca034606a5de3862be6b72415dc5cb1fb8ddbac110049a"}, - {file = "pydantic-1.10.5-cp310-cp310-win_amd64.whl", hash = "sha256:45edea10b75d3da43cfda12f3792833a3fa70b6eee4db1ed6aed528cef17c74e"}, - {file = "pydantic-1.10.5-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:63200cd8af1af2c07964546b7bc8f217e8bda9d0a2ef0ee0c797b36353914984"}, - {file = "pydantic-1.10.5-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:305d0376c516b0dfa1dbefeae8c21042b57b496892d721905a6ec6b79494a66d"}, - {file = "pydantic-1.10.5-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:1fd326aff5d6c36f05735c7c9b3d5b0e933b4ca52ad0b6e4b38038d82703d35b"}, - {file = "pydantic-1.10.5-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:6bb0452d7b8516178c969d305d9630a3c9b8cf16fcf4713261c9ebd465af0d73"}, - {file = "pydantic-1.10.5-cp311-cp311-musllinux_1_1_i686.whl", hash = "sha256:9a9d9155e2a9f38b2eb9374c88f02fd4d6851ae17b65ee786a87d032f87008f8"}, - {file = "pydantic-1.10.5-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:f836444b4c5ece128b23ec36a446c9ab7f9b0f7981d0d27e13a7c366ee163f8a"}, - {file = "pydantic-1.10.5-cp311-cp311-win_amd64.whl", hash = "sha256:8481dca324e1c7b715ce091a698b181054d22072e848b6fc7895cd86f79b4449"}, - {file = "pydantic-1.10.5-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:87f831e81ea0589cd18257f84386bf30154c5f4bed373b7b75e5cb0b5d53ea87"}, - {file = "pydantic-1.10.5-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:7ce1612e98c6326f10888df951a26ec1a577d8df49ddcaea87773bfbe23ba5cc"}, - {file = "pydantic-1.10.5-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:58e41dd1e977531ac6073b11baac8c013f3cd8706a01d3dc74e86955be8b2c0c"}, - {file = "pydantic-1.10.5-cp37-cp37m-musllinux_1_1_i686.whl", hash = "sha256:6a4b0aab29061262065bbdede617ef99cc5914d1bf0ddc8bcd8e3d7928d85bd6"}, - {file = "pydantic-1.10.5-cp37-cp37m-musllinux_1_1_x86_64.whl", hash = "sha256:36e44a4de37b8aecffa81c081dbfe42c4d2bf9f6dff34d03dce157ec65eb0f15"}, - {file = "pydantic-1.10.5-cp37-cp37m-win_amd64.whl", hash = "sha256:261f357f0aecda005934e413dfd7aa4077004a174dafe414a8325e6098a8e419"}, - {file = "pydantic-1.10.5-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:b429f7c457aebb7fbe7cd69c418d1cd7c6fdc4d3c8697f45af78b8d5a7955760"}, - {file = "pydantic-1.10.5-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:663d2dd78596c5fa3eb996bc3f34b8c2a592648ad10008f98d1348be7ae212fb"}, - {file = "pydantic-1.10.5-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:51782fd81f09edcf265823c3bf43ff36d00db246eca39ee765ef58dc8421a642"}, - {file = "pydantic-1.10.5-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:c428c0f64a86661fb4873495c4fac430ec7a7cef2b8c1c28f3d1a7277f9ea5ab"}, - {file = "pydantic-1.10.5-cp38-cp38-musllinux_1_1_i686.whl", hash = "sha256:76c930ad0746c70f0368c4596020b736ab65b473c1f9b3872310a835d852eb19"}, - {file = "pydantic-1.10.5-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:3257bd714de9db2102b742570a56bf7978e90441193acac109b1f500290f5718"}, - {file = "pydantic-1.10.5-cp38-cp38-win_amd64.whl", hash = "sha256:f5bee6c523d13944a1fdc6f0525bc86dbbd94372f17b83fa6331aabacc8fd08e"}, - {file = "pydantic-1.10.5-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:532e97c35719f137ee5405bd3eeddc5c06eb91a032bc755a44e34a712420daf3"}, - {file = "pydantic-1.10.5-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:ca9075ab3de9e48b75fa8ccb897c34ccc1519177ad8841d99f7fd74cf43be5bf"}, - {file = "pydantic-1.10.5-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:bd46a0e6296346c477e59a954da57beaf9c538da37b9df482e50f836e4a7d4bb"}, - {file = "pydantic-1.10.5-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:3353072625ea2a9a6c81ad01b91e5c07fa70deb06368c71307529abf70d23325"}, - {file = "pydantic-1.10.5-cp39-cp39-musllinux_1_1_i686.whl", hash = "sha256:3f9d9b2be177c3cb6027cd67fbf323586417868c06c3c85d0d101703136e6b31"}, - {file = "pydantic-1.10.5-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:b473d00ccd5c2061fd896ac127b7755baad233f8d996ea288af14ae09f8e0d1e"}, - {file = "pydantic-1.10.5-cp39-cp39-win_amd64.whl", hash = "sha256:5f3bc8f103b56a8c88021d481410874b1f13edf6e838da607dcb57ecff9b4594"}, - {file = "pydantic-1.10.5-py3-none-any.whl", hash = "sha256:7c5b94d598c90f2f46b3a983ffb46ab806a67099d118ae0da7ef21a2a4033b28"}, - {file = "pydantic-1.10.5.tar.gz", hash = "sha256:9e337ac83686645a46db0e825acceea8e02fca4062483f40e9ae178e8bd1103a"}, + {file = "pydantic-1.10.6-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:f9289065611c48147c1dd1fd344e9d57ab45f1d99b0fb26c51f1cf72cd9bcd31"}, + {file = "pydantic-1.10.6-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:8c32b6bba301490d9bb2bf5f631907803135e8085b6aa3e5fe5a770d46dd0160"}, + {file = "pydantic-1.10.6-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:fd9b9e98068fa1068edfc9eabde70a7132017bdd4f362f8b4fd0abed79c33083"}, + {file = "pydantic-1.10.6-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:1c84583b9df62522829cbc46e2b22e0ec11445625b5acd70c5681ce09c9b11c4"}, + {file = "pydantic-1.10.6-cp310-cp310-musllinux_1_1_i686.whl", hash = "sha256:b41822064585fea56d0116aa431fbd5137ce69dfe837b599e310034171996084"}, + {file = "pydantic-1.10.6-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:61f1f08adfaa9cc02e0cbc94f478140385cbd52d5b3c5a657c2fceb15de8d1fb"}, + {file = "pydantic-1.10.6-cp310-cp310-win_amd64.whl", hash = "sha256:32937835e525d92c98a1512218db4eed9ddc8f4ee2a78382d77f54341972c0e7"}, + {file = "pydantic-1.10.6-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:bbd5c531b22928e63d0cb1868dee76123456e1de2f1cb45879e9e7a3f3f1779b"}, + {file = "pydantic-1.10.6-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:e277bd18339177daa62a294256869bbe84df1fb592be2716ec62627bb8d7c81d"}, + {file = "pydantic-1.10.6-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:89f15277d720aa57e173954d237628a8d304896364b9de745dcb722f584812c7"}, + {file = "pydantic-1.10.6-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:b243b564cea2576725e77aeeda54e3e0229a168bc587d536cd69941e6797543d"}, + {file = "pydantic-1.10.6-cp311-cp311-musllinux_1_1_i686.whl", hash = "sha256:3ce13a558b484c9ae48a6a7c184b1ba0e5588c5525482681db418268e5f86186"}, + {file = "pydantic-1.10.6-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:3ac1cd4deed871dfe0c5f63721e29debf03e2deefa41b3ed5eb5f5df287c7b70"}, + {file = "pydantic-1.10.6-cp311-cp311-win_amd64.whl", hash = "sha256:b1eb6610330a1dfba9ce142ada792f26bbef1255b75f538196a39e9e90388bf4"}, + {file = "pydantic-1.10.6-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:4ca83739c1263a044ec8b79df4eefc34bbac87191f0a513d00dd47d46e307a65"}, + {file = "pydantic-1.10.6-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:ea4e2a7cb409951988e79a469f609bba998a576e6d7b9791ae5d1e0619e1c0f2"}, + {file = "pydantic-1.10.6-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:53de12b4608290992a943801d7756f18a37b7aee284b9ffa794ee8ea8153f8e2"}, + {file = "pydantic-1.10.6-cp37-cp37m-musllinux_1_1_i686.whl", hash = "sha256:60184e80aac3b56933c71c48d6181e630b0fbc61ae455a63322a66a23c14731a"}, + {file = "pydantic-1.10.6-cp37-cp37m-musllinux_1_1_x86_64.whl", hash = "sha256:415a3f719ce518e95a92effc7ee30118a25c3d032455d13e121e3840985f2efd"}, + {file = "pydantic-1.10.6-cp37-cp37m-win_amd64.whl", hash = "sha256:72cb30894a34d3a7ab6d959b45a70abac8a2a93b6480fc5a7bfbd9c935bdc4fb"}, + {file = "pydantic-1.10.6-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:3091d2eaeda25391405e36c2fc2ed102b48bac4b384d42b2267310abae350ca6"}, + {file = "pydantic-1.10.6-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:751f008cd2afe812a781fd6aa2fb66c620ca2e1a13b6a2152b1ad51553cb4b77"}, + {file = "pydantic-1.10.6-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:12e837fd320dd30bd625be1b101e3b62edc096a49835392dcf418f1a5ac2b832"}, + {file = "pydantic-1.10.6-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:587d92831d0115874d766b1f5fddcdde0c5b6c60f8c6111a394078ec227fca6d"}, + {file = "pydantic-1.10.6-cp38-cp38-musllinux_1_1_i686.whl", hash = "sha256:476f6674303ae7965730a382a8e8d7fae18b8004b7b69a56c3d8fa93968aa21c"}, + {file = "pydantic-1.10.6-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:3a2be0a0f32c83265fd71a45027201e1278beaa82ea88ea5b345eea6afa9ac7f"}, + {file = "pydantic-1.10.6-cp38-cp38-win_amd64.whl", hash = "sha256:0abd9c60eee6201b853b6c4be104edfba4f8f6c5f3623f8e1dba90634d63eb35"}, + {file = "pydantic-1.10.6-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:6195ca908045054dd2d57eb9c39a5fe86409968b8040de8c2240186da0769da7"}, + {file = "pydantic-1.10.6-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:43cdeca8d30de9a897440e3fb8866f827c4c31f6c73838e3a01a14b03b067b1d"}, + {file = "pydantic-1.10.6-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:4c19eb5163167489cb1e0161ae9220dadd4fc609a42649e7e84a8fa8fff7a80f"}, + {file = "pydantic-1.10.6-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:012c99a9c0d18cfde7469aa1ebff922e24b0c706d03ead96940f5465f2c9cf62"}, + {file = "pydantic-1.10.6-cp39-cp39-musllinux_1_1_i686.whl", hash = "sha256:528dcf7ec49fb5a84bf6fe346c1cc3c55b0e7603c2123881996ca3ad79db5bfc"}, + {file = "pydantic-1.10.6-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:163e79386c3547c49366e959d01e37fc30252285a70619ffc1b10ede4758250a"}, + {file = "pydantic-1.10.6-cp39-cp39-win_amd64.whl", hash = "sha256:189318051c3d57821f7233ecc94708767dd67687a614a4e8f92b4a020d4ffd06"}, + {file = "pydantic-1.10.6-py3-none-any.whl", hash = "sha256:acc6783751ac9c9bc4680379edd6d286468a1dc8d7d9906cd6f1186ed682b2b0"}, + {file = "pydantic-1.10.6.tar.gz", hash = "sha256:cf95adb0d1671fc38d8c43dd921ad5814a735e7d9b4d9e437c088002863854fd"}, ] pygments = [ {file = "Pygments-2.14.0-py3-none-any.whl", hash = "sha256:fa7bd7bd2771287c0de303af8bfdfc731f51bd2c6a47ab69d117138893b82717"}, @@ -2082,6 +2137,25 @@ rsa = [ {file = "rsa-4.9-py3-none-any.whl", hash = "sha256:90260d9058e514786967344d0ef75fa8727eed8a7d2e43ce9f4bcf1b536174f7"}, {file = "rsa-4.9.tar.gz", hash = "sha256:e38464a49c6c85d7f1351b0126661487a7e0a14a50f1675ec50eb34d4f20ef21"}, ] +ruff = [ + {file = "ruff-0.0.254-py3-none-macosx_10_7_x86_64.whl", hash = "sha256:dd58c500d039fb381af8d861ef456c3e94fd6855c3d267d6c6718c9a9fe07be0"}, + {file = "ruff-0.0.254-py3-none-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl", hash = "sha256:688379050ae05394a6f9f9c8471587fd5dcf22149bd4304a4ede233cc4ef89a1"}, + {file = "ruff-0.0.254-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:ac1429be6d8bd3db0bf5becac3a38bd56f8421447790c50599cd90fd53417ec4"}, + {file = "ruff-0.0.254-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:059a380c08e849b6f312479b18cc63bba2808cff749ad71555f61dd930e3c9a2"}, + {file = "ruff-0.0.254-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:b3f15d5d033fd3dcb85d982d6828ddab94134686fac2c02c13a8822aa03e1321"}, + {file = "ruff-0.0.254-py3-none-manylinux_2_17_ppc64.manylinux2014_ppc64.whl", hash = "sha256:8deba44fd563361c488dedec90dc330763ee0c01ba54e17df54ef5820079e7e0"}, + {file = "ruff-0.0.254-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:ef20bf798ffe634090ad3dc2e8aa6a055f08c448810a2f800ab716cc18b80107"}, + {file = "ruff-0.0.254-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:0deb1d7226ea9da9b18881736d2d96accfa7f328c67b7410478cc064ad1fa6aa"}, + {file = "ruff-0.0.254-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:27d39d697fdd7df1f2a32c1063756ee269ad8d5345c471ee3ca450636d56e8c6"}, + {file = "ruff-0.0.254-py3-none-musllinux_1_2_aarch64.whl", hash = "sha256:2fc21d060a3197ac463596a97d9b5db2d429395938b270ded61dd60f0e57eb21"}, + {file = "ruff-0.0.254-py3-none-musllinux_1_2_armv7l.whl", hash = "sha256:f70dc93bc9db15cccf2ed2a831938919e3e630993eeea6aba5c84bc274237885"}, + {file = "ruff-0.0.254-py3-none-musllinux_1_2_i686.whl", hash = "sha256:09c764bc2bd80c974f7ce1f73a46092c286085355a5711126af351b9ae4bea0c"}, + {file = "ruff-0.0.254-py3-none-musllinux_1_2_x86_64.whl", hash = "sha256:d4385cdd30153b7aa1d8f75dfd1ae30d49c918ead7de07e69b7eadf0d5538a1f"}, + {file = "ruff-0.0.254-py3-none-win32.whl", hash = "sha256:c38291bda4c7b40b659e8952167f386e86ec29053ad2f733968ff1d78b4c7e15"}, + {file = "ruff-0.0.254-py3-none-win_amd64.whl", hash = "sha256:e15742df0f9a3615fbdc1ee9a243467e97e75bf88f86d363eee1ed42cedab1ec"}, + {file = "ruff-0.0.254-py3-none-win_arm64.whl", hash = "sha256:b435afc4d65591399eaf4b2af86e441a71563a2091c386cadf33eaa11064dc09"}, + {file = "ruff-0.0.254.tar.gz", hash = "sha256:0eb66c9520151d3bd950ea43b3a088618a8e4e10a5014a72687881e6f3606312"}, +] six = [ {file = "six-1.16.0-py2.py3-none-any.whl", hash = "sha256:8abb2f1d86890a2dfb989f9a77cfcfd3e47c2a354b01111771326f8aa26e0254"}, {file = "six-1.16.0.tar.gz", hash = "sha256:1e61c37477a1626458e36f7b1d82aa5c9b094fa4802892072e49de9c60c4c926"}, diff --git a/langflow/backend/pyproject.toml b/langflow/backend/pyproject.toml index 2c06228e6..c95bd2681 100644 --- a/langflow/backend/pyproject.toml +++ b/langflow/backend/pyproject.toml @@ -20,6 +20,8 @@ langchain = {git = "https://github.com/ibiscp/langchain.git", rev = "ibis"} [tool.poetry.group.dev.dependencies] black = "^23.1.0" ipykernel = "^6.21.2" +mypy = "^1.1.1" +ruff = "^0.0.254" [build-system] requires = ["poetry-core"]