Merge branch 'zustand/io/migration' into cz/new-tests

This commit is contained in:
cristhianzl 2024-04-01 21:29:38 -03:00
commit fe743fd0fa
11 changed files with 1328 additions and 1330 deletions

View file

View file

@ -2,7 +2,7 @@ import Admonition from '@theme/Admonition';
# Outputs # Outputs
### ChatOutput ## Chat Output
This component is designed to send a message to the chat. This component is designed to send a message to the chat.
@ -22,7 +22,7 @@ This component is designed to send a message to the chat.
</p> </p>
</Admonition> </Admonition>
### TextOutput ## Text Output
This component is designed to display text data to the user. It's particularly useful for scenarios where you don't want to send the text data to the chat, but still want to display it. This component is designed to display text data to the user. It's particularly useful for scenarios where you don't want to send the text data to the chat, but still want to display it.

200
poetry.lock generated
View file

@ -2666,21 +2666,6 @@ protobuf = ">=3.19.5,<3.20.0 || >3.20.0,<3.20.1 || >3.20.1,<4.21.1 || >4.21.1,<4
[package.extras] [package.extras]
grpc = ["grpcio (>=1.44.0,<2.0.0.dev0)"] grpc = ["grpcio (>=1.44.0,<2.0.0.dev0)"]
[[package]]
name = "gotrue"
version = "2.4.2"
description = "Python Client Library for Supabase Auth"
optional = false
python-versions = "<4.0,>=3.8"
files = [
{file = "gotrue-2.4.2-py3-none-any.whl", hash = "sha256:64cd40933d1f0a5d5cc4f4bd93bc51d730b94812447b6600f774790a4901e455"},
{file = "gotrue-2.4.2.tar.gz", hash = "sha256:e100745161f1c58dd05b9c1ef8bcd4cd78cdfb38d8d2c253ade63143a3dc6aeb"},
]
[package.dependencies]
httpx = ">=0.23,<0.28"
pydantic = ">=1.10,<3"
[[package]] [[package]]
name = "greenlet" name = "greenlet"
version = "3.0.3" version = "3.0.3"
@ -3908,60 +3893,53 @@ name = "langflow-base"
version = "0.0.13" version = "0.0.13"
description = "A Python package with a built-in web application" description = "A Python package with a built-in web application"
optional = false optional = false
python-versions = ">=3.10,<3.12" python-versions = "<3.12,>=3.10"
files = [] files = [
develop = true {file = "langflow_base-0.0.13-py3-none-any.whl", hash = "sha256:86a8cd4f4dac68a1c00b4fe434cd5df1ef4af939295a1a5516e4cc14aaf79e7a"},
{file = "langflow_base-0.0.13.tar.gz", hash = "sha256:b7ee7d93e29c20bdb2a1431498d5715ed2a8fbfe9ca5d7d49926a9a10937e8c2"},
]
[package.dependencies] [package.dependencies]
alembic = "^1.13.0" alembic = ">=1.13.0,<2.0.0"
bcrypt = "4.0.1" bcrypt = "4.0.1"
cachetools = "^5.3.1" cachetools = ">=5.3.1,<6.0.0"
chromadb = "^0.4.24" chromadb = ">=0.4.24,<0.5.0"
docstring-parser = "^0.15" docstring-parser = ">=0.15,<0.16"
duckdb = "^0.9.2" duckdb = ">=0.9.2,<0.10.0"
fastapi = "^0.109.0" fastapi = ">=0.109.0,<0.110.0"
gunicorn = "^21.2.0" gunicorn = ">=21.2.0,<22.0.0"
httpx = "^0.25" httpx = ">=0.25,<0.26"
jq = {version = "^1.7.0", markers = "sys_platform != \"win32\""} jq = {version = ">=1.7.0,<2.0.0", markers = "sys_platform != \"win32\""}
langchain = "~0.1.0" langchain = ">=0.1.0,<0.2.0"
langchain-anthropic = "^0.1.4" langchain-anthropic = ">=0.1.4,<0.2.0"
langchain-astradb = "^0.1.0" langchain-astradb = ">=0.1.0,<0.2.0"
langchain-experimental = "*" langchain-experimental = "*"
loguru = "^0.7.1" loguru = ">=0.7.1,<0.8.0"
multiprocess = "^0.70.14" multiprocess = ">=0.70.14,<0.71.0"
opentelemetry-api = "^1.23.0" opentelemetry-api = ">=1.23.0,<2.0.0"
opentelemetry-exporter-otlp = "^1.23.0" opentelemetry-exporter-otlp = ">=1.23.0,<2.0.0"
opentelemetry-instrumentation-asgi = "^0.44b0" opentelemetry-instrumentation-asgi = ">=0.44b0,<0.45"
opentelemetry-instrumentation-fastapi = "^0.44b0" opentelemetry-instrumentation-fastapi = ">=0.44b0,<0.45"
opentelemetry-instrumentation-httpx = "^0.44b0" opentelemetry-instrumentation-httpx = ">=0.44b0,<0.45"
opentelemetry-sdk = "^1.23.0" opentelemetry-sdk = ">=1.23.0,<2.0.0"
orjson = "3.9.15" orjson = "3.9.15"
pandas = "2.2.0" pandas = "2.2.0"
passlib = "^1.7.4" passlib = ">=1.7.4,<2.0.0"
pillow = "^10.2.0" pillow = ">=10.2.0,<11.0.0"
platformdirs = "^4.2.0" platformdirs = ">=4.2.0,<5.0.0"
pydantic = "^2.5.0" pydantic = ">=2.5.0,<3.0.0"
pydantic-settings = "^2.1.0" pydantic-settings = ">=2.1.0,<3.0.0"
pypdf = "^4.1.0" pypdf = ">=4.1.0,<5.0.0"
python-docx = "^1.1.0" python-docx = ">=1.1.0,<2.0.0"
python-jose = "^3.3.0" python-jose = ">=3.3.0,<4.0.0"
python-multipart = "^0.0.7" python-multipart = ">=0.0.7,<0.0.8"
python-socketio = "^5.11.0" python-socketio = ">=5.11.0,<6.0.0"
rich = "^13.7.0" rich = ">=13.7.0,<14.0.0"
sqlmodel = "^0.0.14" sqlmodel = ">=0.0.14,<0.0.15"
typer = "^0.9.0" typer = ">=0.9.0,<0.10.0"
uvicorn = "^0.27.0" uvicorn = ">=0.27.0,<0.28.0"
websockets = "*" websockets = "*"
[package.extras]
all = []
deploy = []
local = []
[package.source]
type = "directory"
url = "src/backend/base"
[[package]] [[package]]
name = "langfuse" name = "langfuse"
version = "2.21.1" version = "2.21.1"
@ -6150,23 +6128,6 @@ docs = ["sphinx (>=1.7.1)"]
redis = ["redis"] redis = ["redis"]
tests = ["pytest (>=5.4.1)", "pytest-cov (>=2.8.1)", "pytest-mypy (>=0.8.0)", "pytest-timeout (>=2.1.0)", "redis", "sphinx (>=6.0.0)", "types-redis"] tests = ["pytest (>=5.4.1)", "pytest-cov (>=2.8.1)", "pytest-mypy (>=0.8.0)", "pytest-timeout (>=2.1.0)", "redis", "sphinx (>=6.0.0)", "types-redis"]
[[package]]
name = "postgrest"
version = "0.16.2"
description = "PostgREST client for Python. This library provides an ORM interface to PostgREST."
optional = false
python-versions = "<4.0,>=3.8"
files = [
{file = "postgrest-0.16.2-py3-none-any.whl", hash = "sha256:cf89106d0877ac2c7b070ad136f78350eb89dbdd998cd83d6852010e0bcdb878"},
{file = "postgrest-0.16.2.tar.gz", hash = "sha256:6c5c8e53cdcede8b6654ddfc7505e5af0c41ce56c6935f7b1d05545bb899d8b8"},
]
[package.dependencies]
deprecation = ">=2.1.0,<3.0.0"
httpx = ">=0.24,<0.28"
pydantic = ">=1.9,<3.0"
strenum = ">=0.4.9,<0.5.0"
[[package]] [[package]]
name = "posthog" name = "posthog"
version = "3.5.0" version = "3.5.0"
@ -7762,22 +7723,6 @@ files = [
[package.extras] [package.extras]
full = ["numpy"] full = ["numpy"]
[[package]]
name = "realtime"
version = "1.0.3"
description = ""
optional = false
python-versions = "<4.0,>=3.8"
files = [
{file = "realtime-1.0.3-py3-none-any.whl", hash = "sha256:809b99a1c09390a4580ca2d37d84c85dffacb1804f80c6f5a4491d312c20e6e3"},
{file = "realtime-1.0.3.tar.gz", hash = "sha256:1a39b5dcdb345b4cc7fd43bc035feb38ca915c9248962f20d264625bc8eb2c4e"},
]
[package.dependencies]
python-dateutil = ">=2.8.1,<3.0.0"
typing-extensions = ">=4.2.0,<5.0.0"
websockets = ">=11,<13"
[[package]] [[package]]
name = "red-black-tree-mod" name = "red-black-tree-mod"
version = "1.20" version = "1.20"
@ -8506,38 +8451,6 @@ anyio = ">=3.4.0,<5"
[package.extras] [package.extras]
full = ["httpx (>=0.22.0)", "itsdangerous", "jinja2", "python-multipart (>=0.0.7)", "pyyaml"] full = ["httpx (>=0.22.0)", "itsdangerous", "jinja2", "python-multipart (>=0.0.7)", "pyyaml"]
[[package]]
name = "storage3"
version = "0.7.4"
description = "Supabase Storage client for Python."
optional = false
python-versions = "<4.0,>=3.8"
files = [
{file = "storage3-0.7.4-py3-none-any.whl", hash = "sha256:0b8e8839b10a64063796ce55a41462c7ffd6842e0ada74f25f5dcf37e1d1bade"},
{file = "storage3-0.7.4.tar.gz", hash = "sha256:61fcbf836f566405981722abb7d56caa57025b261e7a316e73316701abf0c040"},
]
[package.dependencies]
httpx = ">=0.24,<0.28"
python-dateutil = ">=2.8.2,<3.0.0"
typing-extensions = ">=4.2.0,<5.0.0"
[[package]]
name = "strenum"
version = "0.4.15"
description = "An Enum that inherits from str."
optional = false
python-versions = "*"
files = [
{file = "StrEnum-0.4.15-py3-none-any.whl", hash = "sha256:a30cda4af7cc6b5bf52c8055bc4bf4b2b6b14a93b574626da33df53cf7740659"},
{file = "StrEnum-0.4.15.tar.gz", hash = "sha256:878fb5ab705442070e4dd1929bb5e2249511c0bcf2b0eeacf3bcd80875c82eff"},
]
[package.extras]
docs = ["myst-parser[linkify]", "sphinx", "sphinx-rtd-theme"]
release = ["twine"]
test = ["pylint", "pytest", "pytest-black", "pytest-cov", "pytest-pylint"]
[[package]] [[package]]
name = "striprtf" name = "striprtf"
version = "0.0.26" version = "0.0.26"
@ -8549,39 +8462,6 @@ files = [
{file = "striprtf-0.0.26.tar.gz", hash = "sha256:fdb2bba7ac440072d1c41eab50d8d74ae88f60a8b6575c6e2c7805dc462093aa"}, {file = "striprtf-0.0.26.tar.gz", hash = "sha256:fdb2bba7ac440072d1c41eab50d8d74ae88f60a8b6575c6e2c7805dc462093aa"},
] ]
[[package]]
name = "supabase"
version = "2.4.1"
description = "Supabase client for Python."
optional = false
python-versions = "<4.0,>=3.8"
files = [
{file = "supabase-2.4.1-py3-none-any.whl", hash = "sha256:8b95744ce4ad24245ec23c090f273dfc9c2d9a53e3a80186959903947dbe1ed6"},
{file = "supabase-2.4.1.tar.gz", hash = "sha256:a7dec0586f8931f378a45b2ffb28d8e37b3719f979c17f541b0156019144e645"},
]
[package.dependencies]
gotrue = ">=1.3,<3.0"
httpx = ">=0.24,<0.28"
postgrest = ">=0.10.8,<0.17.0"
realtime = ">=1.0.0,<2.0.0"
storage3 = ">=0.5.3,<0.8.0"
supafunc = ">=0.3.1,<0.5.0"
[[package]]
name = "supafunc"
version = "0.4.5"
description = "Library for Supabase Functions"
optional = false
python-versions = "<4.0,>=3.8"
files = [
{file = "supafunc-0.4.5-py3-none-any.whl", hash = "sha256:2208045f8f5c797924666f6a332efad75ad368f8030b2e4ceb9d2bf63f329373"},
{file = "supafunc-0.4.5.tar.gz", hash = "sha256:a6466d78bdcaa58b7f0303793643103baae8106a87acd5d01e196179a9d0d024"},
]
[package.dependencies]
httpx = ">=0.24,<0.28"
[[package]] [[package]]
name = "sympy" name = "sympy"
version = "1.12" version = "1.12"
@ -10283,4 +10163,4 @@ local = ["ctransformers", "llama-cpp-python", "sentence-transformers"]
[metadata] [metadata]
lock-version = "2.0" lock-version = "2.0"
python-versions = ">=3.10,<3.12" python-versions = ">=3.10,<3.12"
content-hash = "b66acb0ed04e62c9f311828307ac1503bc7a19912753c217d4ea6237f474543a" content-hash = "b1b40cf39cc544faf5ca6ad04a2be009df7d8d343d86c1e9d7c02d21b2cad431"

View file

@ -28,8 +28,8 @@ enable = true
[tool.poetry.dependencies] [tool.poetry.dependencies]
python = ">=3.10,<3.12" python = ">=3.10,<3.12"
langflow-base = { path = "./src/backend/base", develop = true } # langflow-base = { path = "./src/backend/base", develop = true }
langflow-base = "0.0.13"
beautifulsoup4 = "^4.12.2" beautifulsoup4 = "^4.12.2"
google-search-results = "^2.4.1" google-search-results = "^2.4.1"
google-api-python-client = "^2.118.0" google-api-python-client = "^2.118.0"
@ -50,7 +50,6 @@ faiss-cpu = "^1.7.4"
types-cachetools = "^5.3.0.5" types-cachetools = "^5.3.0.5"
pinecone-client = "^3.0.3" pinecone-client = "^3.0.3"
pymongo = "^4.6.0" pymongo = "^4.6.0"
supabase = "^2.3.0"
certifi = "^2023.11.17" certifi = "^2023.11.17"
psycopg = "^3.1.9" psycopg = "^3.1.9"
psycopg-binary = "^3.1.9" psycopg-binary = "^3.1.9"
@ -61,7 +60,7 @@ flower = { version = "^2.0.0", optional = true }
metaphor-python = "^0.1.11" metaphor-python = "^0.1.11"
zep-python = "*" zep-python = "*"
pywin32 = { version = "^306", markers = "sys_platform == 'win32'" } pywin32 = { version = "^306", markers = "sys_platform == 'win32'" }
langfuse = "^2.9.0" langfuse = "*"
metal-sdk = "^2.5.0" metal-sdk = "^2.5.0"
markupsafe = "^2.1.3" markupsafe = "^2.1.3"
extract-msg = "^0.47.0" extract-msg = "^0.47.0"

View file

@ -5,7 +5,7 @@
"data": { "data": {
"nodes": [ "nodes": [
{ {
"id": "ChatInput-r2WbA", "id": "ChatInput-t7F8v",
"type": "genericNode", "type": "genericNode",
"position": { "position": {
"x": 1283.2700598313072, "x": 1283.2700598313072,
@ -51,7 +51,7 @@
"info": "", "info": "",
"load_from_db": false, "load_from_db": false,
"title_case": false, "title_case": false,
"value": "what i said in the past?" "value": ""
}, },
"return_record": { "return_record": {
"type": "bool", "type": "bool",
@ -170,11 +170,11 @@
"field_order": [], "field_order": [],
"beta": false "beta": false
}, },
"id": "ChatInput-r2WbA" "id": "ChatInput-t7F8v"
}, },
"selected": false, "selected": false,
"width": 384, "width": 384,
"height": 471, "height": 469,
"positionAbsolute": { "positionAbsolute": {
"x": 1283.2700598313072, "x": 1283.2700598313072,
"y": 982.5953650473145 "y": 982.5953650473145
@ -182,7 +182,7 @@
"dragging": false "dragging": false
}, },
{ {
"id": "ChatOutput-65FlE", "id": "ChatOutput-P1jEe",
"type": "genericNode", "type": "genericNode",
"position": { "position": {
"x": 3154.916355514023, "x": 3154.916355514023,
@ -348,11 +348,11 @@
"field_order": [], "field_order": [],
"beta": false "beta": false
}, },
"id": "ChatOutput-65FlE" "id": "ChatOutput-P1jEe"
}, },
"selected": false, "selected": false,
"width": 384, "width": 384,
"height": 479, "height": 477,
"dragging": false, "dragging": false,
"positionAbsolute": { "positionAbsolute": {
"x": 3154.916355514023, "x": 3154.916355514023,
@ -360,7 +360,7 @@
} }
}, },
{ {
"id": "MemoryComponent-CsMk7", "id": "MemoryComponent-cdA1J",
"type": "genericNode", "type": "genericNode",
"position": { "position": {
"x": 1289.9606870058817, "x": 1289.9606870058817,
@ -552,13 +552,13 @@
"field_order": [], "field_order": [],
"beta": true "beta": true
}, },
"id": "MemoryComponent-CsMk7", "id": "MemoryComponent-cdA1J",
"description": "Retrieves stored chat messages given a specific Session ID.", "description": "Retrieves stored chat messages given a specific Session ID.",
"display_name": "Chat Memory" "display_name": "Chat Memory"
}, },
"selected": false, "selected": false,
"width": 384, "width": 384,
"height": 491, "height": 489,
"dragging": false, "dragging": false,
"positionAbsolute": { "positionAbsolute": {
"x": 1289.9606870058817, "x": 1289.9606870058817,
@ -566,7 +566,7 @@
} }
}, },
{ {
"id": "Prompt-p9ug4", "id": "Prompt-ODkUx",
"type": "genericNode", "type": "genericNode",
"position": { "position": {
"x": 1894.594426342426, "x": 1894.594426342426,
@ -699,13 +699,13 @@
"beta": false, "beta": false,
"error": null "error": null
}, },
"id": "Prompt-p9ug4", "id": "Prompt-ODkUx",
"description": "A component for creating prompt templates using dynamic variables.", "description": "A component for creating prompt templates using dynamic variables.",
"display_name": "Prompt" "display_name": "Prompt"
}, },
"selected": false, "selected": false,
"width": 384, "width": 384,
"height": 479, "height": 477,
"dragging": false, "dragging": false,
"positionAbsolute": { "positionAbsolute": {
"x": 1894.594426342426, "x": 1894.594426342426,
@ -713,7 +713,7 @@
} }
}, },
{ {
"id": "OpenAIModel-OwSm5", "id": "OpenAIModel-9RykF",
"type": "genericNode", "type": "genericNode",
"position": { "position": {
"x": 2561.5850334731617, "x": 2561.5850334731617,
@ -979,29 +979,137 @@
], ],
"beta": false "beta": false
}, },
"id": "OpenAIModel-OwSm5" "id": "OpenAIModel-9RykF"
}, },
"selected": false, "selected": false,
"width": 384, "width": 384,
"height": 565, "height": 563,
"positionAbsolute": { "positionAbsolute": {
"x": 2561.5850334731617, "x": 2561.5850334731617,
"y": 553.2745131130916 "y": 553.2745131130916
}, },
"dragging": false "dragging": false
},
{
"id": "TextOutput-vrs6T",
"type": "genericNode",
"position": {
"x": 1911.4785906252087,
"y": 247.39079954376987
},
"data": {
"type": "TextOutput",
"node": {
"template": {
"input_value": {
"type": "str",
"required": false,
"placeholder": "",
"list": false,
"show": true,
"multiline": false,
"value": "",
"fileTypes": [],
"file_path": "",
"password": false,
"name": "input_value",
"display_name": "Value",
"advanced": false,
"input_types": [
"Record",
"Text"
],
"dynamic": false,
"info": "Text or Record to be passed as output.",
"load_from_db": false,
"title_case": false
},
"code": {
"type": "code",
"required": true,
"placeholder": "",
"list": false,
"show": true,
"multiline": true,
"value": "from typing import Optional\n\nfrom langflow.base.io.text import TextComponent\nfrom langflow.field_typing import Text\n\n\nclass TextOutput(TextComponent):\n display_name = \"Text Output\"\n description = \"Display a text output in the Interaction Panel.\"\n icon = \"type\"\n\n def build_config(self):\n return {\n \"input_value\": {\n \"display_name\": \"Value\",\n \"input_types\": [\"Record\", \"Text\"],\n \"info\": \"Text or Record to be passed as output.\",\n },\n \"record_template\": {\n \"display_name\": \"Record Template\",\n \"multiline\": True,\n \"info\": \"Template to convert Record to Text. If left empty, it will be dynamically set to the Record's text key.\",\n \"advanced\": True,\n },\n }\n\n def build(self, input_value: Optional[Text] = \"\", record_template: str = \"\") -> Text:\n return super().build(input_value=input_value, record_template=record_template)\n",
"fileTypes": [],
"file_path": "",
"password": false,
"name": "code",
"advanced": true,
"dynamic": true,
"info": "",
"load_from_db": false,
"title_case": false
},
"record_template": {
"type": "str",
"required": false,
"placeholder": "",
"list": false,
"show": true,
"multiline": true,
"value": "",
"fileTypes": [],
"file_path": "",
"password": false,
"name": "record_template",
"display_name": "Record Template",
"advanced": true,
"dynamic": false,
"info": "Template to convert Record to Text. If left empty, it will be dynamically set to the Record's text key.",
"load_from_db": false,
"title_case": false,
"input_types": [
"Text"
]
},
"_type": "CustomComponent"
},
"description": "Display a text output in the Interaction Panel.",
"icon": "type",
"base_classes": [
"str",
"object",
"Text"
],
"display_name": "Inspect Memory",
"documentation": "",
"custom_fields": {
"input_value": null,
"record_template": null
},
"output_types": [
"Text"
],
"field_formatters": {},
"frozen": false,
"field_order": [],
"beta": false
},
"id": "TextOutput-vrs6T"
},
"selected": false,
"width": 384,
"height": 289,
"positionAbsolute": {
"x": 1911.4785906252087,
"y": 247.39079954376987
},
"dragging": false
} }
], ],
"edges": [ "edges": [
{ {
"source": "MemoryComponent-CsMk7", "source": "MemoryComponent-cdA1J",
"sourceHandle": "{œbaseClassesœ:[œstrœ,œTextœ,œobjectœ],œdataTypeœ:œMemoryComponentœ,œidœ:œMemoryComponent-CsMk7œ}", "sourceHandle": "{œbaseClassesœ:[œstrœ,œTextœ,œobjectœ],œdataTypeœ:œMemoryComponentœ,œidœ:œMemoryComponent-cdA1Jœ}",
"target": "Prompt-p9ug4", "target": "Prompt-ODkUx",
"targetHandle": "{œfieldNameœ:œcontextœ,œidœ:œPrompt-p9ug4œ,œinputTypesœ:[œDocumentœ,œBaseOutputParserœ,œRecordœ,œTextœ],œtypeœ:œstrœ}", "targetHandle": "{œfieldNameœ:œcontextœ,œidœ:œPrompt-ODkUxœ,œinputTypesœ:[œDocumentœ,œBaseOutputParserœ,œRecordœ,œTextœ],œtypeœ:œstrœ}",
"data": { "data": {
"targetHandle": { "targetHandle": {
"fieldName": "context", "fieldName": "context",
"type": "str", "type": "str",
"id": "Prompt-p9ug4", "id": "Prompt-ODkUx",
"inputTypes": [ "inputTypes": [
"Document", "Document",
"BaseOutputParser", "BaseOutputParser",
@ -1016,26 +1124,26 @@
"object" "object"
], ],
"dataType": "MemoryComponent", "dataType": "MemoryComponent",
"id": "MemoryComponent-CsMk7" "id": "MemoryComponent-cdA1J"
} }
}, },
"style": { "style": {
"stroke": "#555" "stroke": "#555"
}, },
"className": "stroke-gray-900 stroke-connection", "className": "stroke-gray-900 stroke-connection",
"id": "reactflow__edge-MemoryComponent-CsMk7{œbaseClassesœ:[œstrœ,œTextœ,œobjectœ],œdataTypeœ:œMemoryComponentœ,œidœ:œMemoryComponent-CsMk7œ}-Prompt-p9ug4{œfieldNameœ:œcontextœ,œidœ:œPrompt-p9ug4œ,œinputTypesœ:[œDocumentœ,œBaseOutputParserœ,œRecordœ,œTextœ],œtypeœ:œstrœ}", "id": "reactflow__edge-MemoryComponent-cdA1J{œbaseClassesœ:[œstrœ,œTextœ,œobjectœ],œdataTypeœ:œMemoryComponentœ,œidœ:œMemoryComponent-cdA1Jœ}-Prompt-ODkUx{œfieldNameœ:œcontextœ,œidœ:œPrompt-ODkUxœ,œinputTypesœ:[œDocumentœ,œBaseOutputParserœ,œRecordœ,œTextœ],œtypeœ:œstrœ}",
"selected": false "selected": false
}, },
{ {
"source": "ChatInput-r2WbA", "source": "ChatInput-t7F8v",
"sourceHandle": "{œbaseClassesœ:[œTextœ,œobjectœ,œRecordœ,œstrœ],œdataTypeœ:œChatInputœ,œidœ:œChatInput-r2WbAœ}", "sourceHandle": "{œbaseClassesœ:[œTextœ,œobjectœ,œRecordœ,œstrœ],œdataTypeœ:œChatInputœ,œidœ:œChatInput-t7F8vœ}",
"target": "Prompt-p9ug4", "target": "Prompt-ODkUx",
"targetHandle": "{œfieldNameœ:œuser_messageœ,œidœ:œPrompt-p9ug4œ,œinputTypesœ:[œDocumentœ,œBaseOutputParserœ,œRecordœ,œTextœ],œtypeœ:œstrœ}", "targetHandle": "{œfieldNameœ:œuser_messageœ,œidœ:œPrompt-ODkUxœ,œinputTypesœ:[œDocumentœ,œBaseOutputParserœ,œRecordœ,œTextœ],œtypeœ:œstrœ}",
"data": { "data": {
"targetHandle": { "targetHandle": {
"fieldName": "user_message", "fieldName": "user_message",
"type": "str", "type": "str",
"id": "Prompt-p9ug4", "id": "Prompt-ODkUx",
"inputTypes": [ "inputTypes": [
"Document", "Document",
"BaseOutputParser", "BaseOutputParser",
@ -1051,25 +1159,25 @@
"str" "str"
], ],
"dataType": "ChatInput", "dataType": "ChatInput",
"id": "ChatInput-r2WbA" "id": "ChatInput-t7F8v"
} }
}, },
"style": { "style": {
"stroke": "#555" "stroke": "#555"
}, },
"className": "stroke-gray-900 stroke-connection", "className": "stroke-gray-900 stroke-connection",
"id": "reactflow__edge-ChatInput-r2WbA{œbaseClassesœ:[œTextœ,œobjectœ,œRecordœ,œstrœ],œdataTypeœ:œChatInputœ,œidœ:œChatInput-r2WbAœ}-Prompt-p9ug4{œfieldNameœ:œuser_messageœ,œidœ:œPrompt-p9ug4œ,œinputTypesœ:[œDocumentœ,œBaseOutputParserœ,œRecordœ,œTextœ],œtypeœ:œstrœ}", "id": "reactflow__edge-ChatInput-t7F8v{œbaseClassesœ:[œTextœ,œobjectœ,œRecordœ,œstrœ],œdataTypeœ:œChatInputœ,œidœ:œChatInput-t7F8vœ}-Prompt-ODkUx{œfieldNameœ:œuser_messageœ,œidœ:œPrompt-ODkUxœ,œinputTypesœ:[œDocumentœ,œBaseOutputParserœ,œRecordœ,œTextœ],œtypeœ:œstrœ}",
"selected": false "selected": false
}, },
{ {
"source": "Prompt-p9ug4", "source": "Prompt-ODkUx",
"sourceHandle": "{œbaseClassesœ:[œTextœ,œstrœ,œobjectœ],œdataTypeœ:œPromptœ,œidœ:œPrompt-p9ug4œ}", "sourceHandle": "{œbaseClassesœ:[œTextœ,œstrœ,œobjectœ],œdataTypeœ:œPromptœ,œidœ:œPrompt-ODkUxœ}",
"target": "OpenAIModel-OwSm5", "target": "OpenAIModel-9RykF",
"targetHandle": "{œfieldNameœ:œinput_valueœ,œidœ:œOpenAIModel-OwSm5œ,œinputTypesœ:[œTextœ],œtypeœ:œstrœ}", "targetHandle": "{œfieldNameœ:œinput_valueœ,œidœ:œOpenAIModel-9RykFœ,œinputTypesœ:[œTextœ],œtypeœ:œstrœ}",
"data": { "data": {
"targetHandle": { "targetHandle": {
"fieldName": "input_value", "fieldName": "input_value",
"id": "OpenAIModel-OwSm5", "id": "OpenAIModel-9RykF",
"inputTypes": [ "inputTypes": [
"Text" "Text"
], ],
@ -1082,24 +1190,24 @@
"object" "object"
], ],
"dataType": "Prompt", "dataType": "Prompt",
"id": "Prompt-p9ug4" "id": "Prompt-ODkUx"
} }
}, },
"style": { "style": {
"stroke": "#555" "stroke": "#555"
}, },
"className": "stroke-foreground stroke-connection", "className": "stroke-gray-900 stroke-connection",
"id": "reactflow__edge-Prompt-p9ug4{œbaseClassesœ:[œTextœ,œstrœ,œobjectœ],œdataTypeœ:œPromptœ,œidœ:œPrompt-p9ug4œ}-OpenAIModel-OwSm5{œfieldNameœ:œinput_valueœ,œidœ:œOpenAIModel-OwSm5œ,œinputTypesœ:[œTextœ],œtypeœ:œstrœ}" "id": "reactflow__edge-Prompt-ODkUx{œbaseClassesœ:[œTextœ,œstrœ,œobjectœ],œdataTypeœ:œPromptœ,œidœ:œPrompt-ODkUxœ}-OpenAIModel-9RykF{œfieldNameœ:œinput_valueœ,œidœ:œOpenAIModel-9RykFœ,œinputTypesœ:[œTextœ],œtypeœ:œstrœ}"
}, },
{ {
"source": "OpenAIModel-OwSm5", "source": "OpenAIModel-9RykF",
"sourceHandle": "{œbaseClassesœ:[œstrœ,œobjectœ,œTextœ],œdataTypeœ:œOpenAIModelœ,œidœ:œOpenAIModel-OwSm5œ}", "sourceHandle": "{œbaseClassesœ:[œstrœ,œobjectœ,œTextœ],œdataTypeœ:œOpenAIModelœ,œidœ:œOpenAIModel-9RykFœ}",
"target": "ChatOutput-65FlE", "target": "ChatOutput-P1jEe",
"targetHandle": "{œfieldNameœ:œinput_valueœ,œidœ:œChatOutput-65FlEœ,œinputTypesœ:[œTextœ],œtypeœ:œstrœ}", "targetHandle": "{œfieldNameœ:œinput_valueœ,œidœ:œChatOutput-P1jEeœ,œinputTypesœ:[œTextœ],œtypeœ:œstrœ}",
"data": { "data": {
"targetHandle": { "targetHandle": {
"fieldName": "input_value", "fieldName": "input_value",
"id": "ChatOutput-65FlE", "id": "ChatOutput-P1jEe",
"inputTypes": [ "inputTypes": [
"Text" "Text"
], ],
@ -1112,22 +1220,53 @@
"Text" "Text"
], ],
"dataType": "OpenAIModel", "dataType": "OpenAIModel",
"id": "OpenAIModel-OwSm5" "id": "OpenAIModel-9RykF"
}
},
"style": {
"stroke": "#555"
},
"className": "stroke-gray-900 stroke-connection",
"id": "reactflow__edge-OpenAIModel-9RykF{œbaseClassesœ:[œstrœ,œobjectœ,œTextœ],œdataTypeœ:œOpenAIModelœ,œidœ:œOpenAIModel-9RykFœ}-ChatOutput-P1jEe{œfieldNameœ:œinput_valueœ,œidœ:œChatOutput-P1jEeœ,œinputTypesœ:[œTextœ],œtypeœ:œstrœ}"
},
{
"source": "MemoryComponent-cdA1J",
"sourceHandle": "{œbaseClassesœ:[œstrœ,œTextœ,œobjectœ],œdataTypeœ:œMemoryComponentœ,œidœ:œMemoryComponent-cdA1Jœ}",
"target": "TextOutput-vrs6T",
"targetHandle": "{œfieldNameœ:œinput_valueœ,œidœ:œTextOutput-vrs6Tœ,œinputTypesœ:[œRecordœ,œTextœ],œtypeœ:œstrœ}",
"data": {
"targetHandle": {
"fieldName": "input_value",
"id": "TextOutput-vrs6T",
"inputTypes": [
"Record",
"Text"
],
"type": "str"
},
"sourceHandle": {
"baseClasses": [
"str",
"Text",
"object"
],
"dataType": "MemoryComponent",
"id": "MemoryComponent-cdA1J"
} }
}, },
"style": { "style": {
"stroke": "#555" "stroke": "#555"
}, },
"className": "stroke-foreground stroke-connection", "className": "stroke-foreground stroke-connection",
"id": "reactflow__edge-OpenAIModel-OwSm5{œbaseClassesœ:[œstrœ,œobjectœ,œTextœ],œdataTypeœ:œOpenAIModelœ,œidœ:œOpenAIModel-OwSm5œ}-ChatOutput-65FlE{œfieldNameœ:œinput_valueœ,œidœ:œChatOutput-65FlEœ,œinputTypesœ:[œTextœ],œtypeœ:œstrœ}" "id": "reactflow__edge-MemoryComponent-cdA1J{œbaseClassesœ:[œstrœ,œTextœ,œobjectœ],œdataTypeœ:œMemoryComponentœ,œidœ:œMemoryComponent-cdA1Jœ}-TextOutput-vrs6T{œfieldNameœ:œinput_valueœ,œidœ:œTextOutput-vrs6Tœ,œinputTypesœ:[œRecordœ,œTextœ],œtypeœ:œstrœ}"
} }
], ],
"viewport": { "viewport": {
"x": -391.0433294674358, "x": -569.862554459756,
"y": -105.08951818254411, "y": -42.08339711050985,
"zoom": 0.5948708289887507 "zoom": 0.4868590524514978
} }
}, },
"description": "This project can be used as a starting point for building a Chat experience with user specific memory. You can set a different Session ID to start a new message history.", "description": "This project can be used as a starting point for building a Chat experience with user specific memory. You can set a different Session ID to start a new message history.",
"name": "Memory Chatbot", "name": "Memory Chatbot",
"last_tested_version": "1.0.0a0", "last_tested_version": "1.0.0a0",

View file

@ -1955,13 +1955,13 @@ test = ["Cython (>=0.29.24,<0.30.0)"]
[[package]] [[package]]
name = "httpx" name = "httpx"
version = "0.25.2" version = "0.27.0"
description = "The next generation HTTP client." description = "The next generation HTTP client."
optional = false optional = false
python-versions = ">=3.8" python-versions = ">=3.8"
files = [ files = [
{file = "httpx-0.25.2-py3-none-any.whl", hash = "sha256:a05d3d052d9b2dfce0e3896636467f8a5342fb2b902c819428e1ac65413ca118"}, {file = "httpx-0.27.0-py3-none-any.whl", hash = "sha256:71d5465162c13681bff01ad59b2cc68dd838ea1f10e51574bac27103f00c91a5"},
{file = "httpx-0.25.2.tar.gz", hash = "sha256:8b8fcaa0c8ea7b05edd69a094e63a2094c4efcb48129fb757361bc423c0ad9e8"}, {file = "httpx-0.27.0.tar.gz", hash = "sha256:a0cb88a46f32dc874e04ee956e4c2764aba2aa228f650b06788ba6bda2962ab5"},
] ]
[package.dependencies] [package.dependencies]
@ -6083,4 +6083,4 @@ local = []
[metadata] [metadata]
lock-version = "2.0" lock-version = "2.0"
python-versions = ">=3.10,<3.12" python-versions = ">=3.10,<3.12"
content-hash = "95ecb4112719931edb680b2749b1302f99c76ae15fe6d4be0eed972d73df8aa1" content-hash = "5a06c86bfbf2cc209bcb3f202bd749af1c8146aa08c10fd69152c170f890866d"

View file

@ -28,7 +28,7 @@ langflow-base = "langflow.__main__:main"
[tool.poetry.dependencies] [tool.poetry.dependencies]
python = ">=3.10,<3.12" python = ">=3.10,<3.12"
fastapi = "^0.109.0" fastapi = "^0.109.0"
httpx = "^0.25" httpx = "*"
uvicorn = "^0.27.0" uvicorn = "^0.27.0"
gunicorn = "^21.2.0" gunicorn = "^21.2.0"
langchain = "~0.1.0" langchain = "~0.1.0"

View file

@ -205,10 +205,7 @@ export default function CodeTabsComponent({
<div className="api-modal-according-display"> <div className="api-modal-according-display">
<div <div
className={classNames( className={classNames(
"h-[70vh] w-full rounded-lg bg-muted", "h-[70vh] w-full rounded-lg bg-muted overflow-y-auto overflow-x-hidden custom-scroll"
1 == 1
? "overflow-scroll overflow-x-hidden custom-scroll"
: "overflow-hidden"
)} )}
> >
{data?.map((node: any, i) => ( {data?.map((node: any, i) => (

View file

@ -50,14 +50,9 @@ const ApiModal = forwardRef(
const tweaksList = useRef<string[]>([]); const tweaksList = useRef<string[]>([]);
const [getTweak, setTweak] = useState<tweakType>([]); const [getTweak, setTweak] = useState<tweakType>([]);
const flowState = useFlowStore((state) => state.flowState); const flowState = useFlowStore((state) => state.flowState);
const pythonApiCode = getPythonApiCode( const pythonApiCode = getPythonApiCode(flow, autoLogin, tweak.current);
flow, const curl_code = getCurlCode(flow, autoLogin, tweak.current);
autoLogin, const pythonCode = getPythonCode(flow, tweak.current);
tweak.current,
flowState
);
const curl_code = getCurlCode(flow, autoLogin, tweak.current, flowState);
const pythonCode = getPythonCode(flow, tweak.current, flowState);
const widgetCode = getWidgetCode(flow, autoLogin, flowState); const widgetCode = getWidgetCode(flow, autoLogin, flowState);
const tweaksCode = buildTweaks(flow); const tweaksCode = buildTweaks(flow);
const codesArray = [ const codesArray = [
@ -168,14 +163,9 @@ const ApiModal = forwardRef(
tweak.current.push(newTweak); tweak.current.push(newTweak);
} }
const pythonApiCode = getPythonApiCode( const pythonApiCode = getPythonApiCode(flow, autoLogin, tweak.current);
flow, const curl_code = getCurlCode(flow, autoLogin, tweak.current);
autoLogin, const pythonCode = getPythonCode(flow, tweak.current);
tweak.current,
flowState
);
const curl_code = getCurlCode(flow, autoLogin, tweak.current, flowState);
const pythonCode = getPythonCode(flow, tweak.current, flowState);
const widgetCode = getWidgetCode(flow, autoLogin, flowState); const widgetCode = getWidgetCode(flow, autoLogin, flowState);
tabs![0].code = curl_code; tabs![0].code = curl_code;

View file

@ -59,13 +59,11 @@ export default function IOModal({
if (!chatInput && !chatOutput) { if (!chatInput && !chatOutput) {
if (inputs.length > 0) { if (inputs.length > 0) {
return inputs[0]; return inputs[0];
} } else {
else {
return outputs[0]; return outputs[0];
} }
} } else {
else { return undefined;
return undefined
} }
} }
@ -116,12 +114,12 @@ export default function IOModal({
} }
useEffect(() => { useEffect(() => {
if(selectedTab!==2) setSelectedTab(inputs.length > 0 ? 1 : outputs.length > 0 ? 2 : 0); setSelectedTab(inputs.length > 0 ? 1 : outputs.length > 0 ? 2 : 0);
}, [allNodes]); }, [allNodes.length]);
useEffect(() => { useEffect(() => {
setSelectedViewField(startView()); setSelectedViewField(startView());
},[open]) }, [open]);
return ( return (
<BaseModal <BaseModal
@ -144,7 +142,7 @@ export default function IOModal({
</BaseModal.Header> </BaseModal.Header>
<BaseModal.Content> <BaseModal.Content>
<div className="flex h-full flex-col "> <div className="flex h-full flex-col ">
<div className="flex-max-width mt-2 h-full"> <div className="flex-max-width h-full">
{selectedTab !== 0 && ( {selectedTab !== 0 && (
<div <div
className={cn( className={cn(
@ -320,12 +318,14 @@ export default function IOModal({
)} )}
> >
<div className="font-xl flex items-center justify-center gap-3 font-semibold"> <div className="font-xl flex items-center justify-center gap-3 font-semibold">
{(haveChat && <button onClick={() => setSelectedViewField(undefined)}> {haveChat && (
<button onClick={() => setSelectedViewField(undefined)}>
<IconComponent <IconComponent
name={"ArrowLeft"} name={"ArrowLeft"}
className="h-6 w-6" className="h-6 w-6"
></IconComponent> ></IconComponent>
</button>)} </button>
)}
{ {
nodes.find((node) => node.id === selectedViewField.id) nodes.find((node) => node.id === selectedViewField.id)
?.data.node.display_name ?.data.node.display_name
@ -376,8 +376,8 @@ export default function IOModal({
</div> </div>
</div> </div>
</BaseModal.Content> </BaseModal.Content>
{!haveChat ? (
<BaseModal.Footer> <BaseModal.Footer>
{!haveChat && (
<div className="flex w-full justify-end pt-2"> <div className="flex w-full justify-end pt-2">
<Button <Button
variant={"outline"} variant={"outline"}
@ -396,8 +396,10 @@ export default function IOModal({
Run Flow Run Flow
</Button> </Button>
</div> </div>
)}
</BaseModal.Footer> </BaseModal.Footer>
) : (
<></>
)}
</BaseModal> </BaseModal>
); );
} }

View file

@ -456,21 +456,12 @@ export function getWidgetCode(
const inputs = buildInputs(); const inputs = buildInputs();
let chat_input_field = getChatInputField(flowState); let chat_input_field = getChatInputField(flowState);
return `<script src="https://cdn.jsdelivr.net/gh/logspace-ai/langflow-embedded-chat@main/dist/build/static/js/bundle.min.js"></script> return `<script src="https://cdn.jsdelivr.net/gh/logspace-ai/langflow-embedded-chat@1.0_alpha/dist/build/static/js/bundle.min.js"></script>
<!-- chat_inputs: Stringified JSON with all the input keys and its values. The value of the key that is defined
as chat_input_field will be overwritten by the chat message.
chat_input_field: Input key that you want the chat to send the user message with. -->
<langflow-chat <langflow-chat
window_title="${flowName}" window_title="${flowName}"
flow_id="${flowId}" flow_id="${flowId}"
${ host_url="http://localhost:7860"${
flowState
? `chat_inputs='${inputs}'
chat_input_field="${chat_input_field}"
`
: ""
}host_url="http://localhost:7860"${
!isAuth !isAuth
? ` ? `
api_key="..."` api_key="..."`