Merge branch 'release' into dev

This commit is contained in:
Lucas Oliveira 2023-10-25 20:06:21 -03:00
commit dd3f3d4ca8
9 changed files with 430 additions and 425 deletions

View file

@ -35,6 +35,7 @@ format:
cd src/frontend && npm run format
lint:
make install_backend
poetry run mypy src/backend/langflow
poetry run black . --check
poetry run ruff . --fix

810
poetry.lock generated

File diff suppressed because it is too large Load diff

View file

@ -1,6 +1,6 @@
[tool.poetry]
name = "langflow"
version = "0.5.3"
version = "0.5.4"
description = "A Python package with a built-in web application"
authors = ["Logspace <contact@logspace.ai>"]
maintainers = [
@ -33,7 +33,7 @@ google-search-results = "^2.4.1"
google-api-python-client = "^2.79.0"
typer = "^0.9.0"
gunicorn = "^21.2.0"
langchain = "^0.0.312"
langchain = "^0.0.320"
openai = "^0.27.8"
pandas = "2.0.3"
chromadb = "^0.3.21"

View file

@ -54,9 +54,10 @@ def get_all(
logger.debug("Building langchain types dict")
try:
return get_all_types_dict(settings_service)
types_dict = get_all_types_dict(settings_service)
except Exception as exc:
raise HTTPException(status_code=500, detail=str(exc)) from exc
return types_dict
# For backwards compatibility we will keep the old endpoint

View file

@ -5,6 +5,7 @@ from langchain.agents.load_tools import (
_EXTRA_OPTIONAL_TOOLS,
_LLM_TOOLS,
)
from langchain.tools.python.tool import PythonInputs
from langflow.custom import customs
from langflow.interface.base import LangChainTypeCreator
@ -161,8 +162,14 @@ class ToolCreator(LangChainTypeCreator):
template = Template(fields=fields, type_name=tool_type)
tool_params = {**tool_params, **self.type_to_loader_dict[name]["params"]}
template_dict = template.to_dict()
if (
"args_schema" in template_dict
and template_dict.get("args_schema").get("value") == PythonInputs
):
template_dict["args_schema"]["value"] = ""
return {
"template": util.format_dict(template.to_dict()),
"template": util.format_dict(template_dict),
**tool_params,
"base_classes": base_classes,
}

View file

@ -28,10 +28,14 @@ class UtilityCreator(LangChainTypeCreator):
"""
if self.type_dict is None:
settings_service = get_settings_service()
self.type_dict = {
utility_name: import_class(f"langchain.utilities.{utility_name}")
for utility_name in utilities.__all__
}
self.type_dict = {}
for utility_name in utilities.__all__:
try:
imported = import_class(f"langchain.utilities.{utility_name}")
self.type_dict[utility_name] = imported
except Exception:
pass
self.type_dict["SQLDatabase"] = utilities.SQLDatabase
# Filter according to settings.utilities
self.type_dict = {

View file

@ -1,18 +1,28 @@
import { useContext, useEffect, useState } from "react";
import { useParams } from "react-router-dom";
import { darkContext } from "../../contexts/darkContext";
import { TabsContext } from "../../contexts/tabsContext";
import { getVersion } from "../../controllers/API";
import Page from "../FlowPage/components/PageComponent";
export default function ViewPage() {
const { flows, tabId, setTabId } = useContext(TabsContext);
const { id } = useParams();
const { setDark } = useContext(darkContext);
const { id, theme } = useParams();
// Set flow tab id
useEffect(() => {
setTabId(id!);
}, [id]);
useEffect(() => {
if (theme) {
setDark(theme === "dark");
} else {
setDark(false);
}
}, [theme]);
// Initialize state variable for the version
const [version, setVersion] = useState("");
useEffect(() => {

View file

@ -44,7 +44,7 @@ const Router = () => {
}
/>
<Route
path="view"
path="view/:theme?"
element={
<ProtectedRoute>
<ViewPage />

View file

@ -96,7 +96,7 @@ def test_prompt_template(client: TestClient, logged_in_headers):
"placeholder": "",
"show": False,
"multiline": False,
"value": True,
"value": False,
"password": False,
"name": "validate_template",
"type": "bool",