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, Callable,
Chain, Chain,
ChatPromptTemplate, ChatPromptTemplate,
Code,
Data, Data,
Document, Document,
Embeddings, Embeddings,
@ -73,4 +74,5 @@ __all__ = [
"Prompt", "Prompt",
"RangeSpec", "RangeSpec",
"TemplateField", "TemplateField",
"Code",
] ]

View file

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

View file

@ -121,7 +121,13 @@ def get_field_properties(extra_field):
def process_type(field_type: str): def process_type(field_type: str):
if field_type.startswith("list") or field_type.startswith("List"): if field_type.startswith("list") or field_type.startswith("List"):
return extract_inner_type(field_type) 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( def add_new_custom_field(

View file

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