Merge branch 'zustand/io/migration' of personal:logspace-ai/langflow into zustand/io/migration

This commit is contained in:
anovazzi1 2024-02-22 15:49:35 -03:00
commit 9c125d1c22
4 changed files with 13 additions and 3 deletions

View file

@ -13,6 +13,7 @@ from .constants import (
Callable,
Chain,
ChatPromptTemplate,
Code,
Data,
Document,
Embeddings,
@ -73,4 +74,5 @@ __all__ = [
"Prompt",
"RangeSpec",
"TemplateField",
"Code",
]

View file

@ -34,6 +34,10 @@ class Prompt:
pass
class Code:
pass
LANGCHAIN_BASE_TYPES = {
"Chain": Chain,
"AgentExecutor": AgentExecutor,

View file

@ -121,7 +121,13 @@ def get_field_properties(extra_field):
def process_type(field_type: str):
if field_type.startswith("list") or field_type.startswith("List"):
return extract_inner_type(field_type)
return "prompt" if field_type == "Prompt" else field_type
# field_type is a string can be Prompt or Code too
# so we just need to lower if it is the case
lowercase_type = field_type.lower()
if lowercase_type in ["prompt", "code"]:
return lowercase_type
return field_type
def add_new_custom_field(

View file

@ -1,2 +0,0 @@
class Prompt:
pass