Import langflow.field_typing.constants in

__init__.py
This commit is contained in:
Gabriel Luiz Freitas Almeida 2023-12-10 20:30:22 -03:00
commit 7cfd5171d7
2 changed files with 27 additions and 10 deletions

View file

@ -1,16 +1,35 @@
from typing import Any from typing import Any
from .constants import (AgentExecutor, BaseChatMemory, BaseLanguageModel, from .constants import (
BaseLLM, BaseLoader, BaseMemory, BaseOutputParser, AgentExecutor,
BasePromptTemplate, BaseRetriever, Callable, Chain, BaseChatMemory,
ChatPromptTemplate, Data, Document, Embeddings, BaseLanguageModel,
NestedDict, Object, Prompt, PromptTemplate, BaseLLM,
TextSplitter, Tool, VectorStore) BaseLoader,
BaseMemory,
BaseOutputParser,
BasePromptTemplate,
BaseRetriever,
Callable,
Chain,
ChatPromptTemplate,
Data,
Document,
Embeddings,
NestedDict,
Object,
Prompt,
PromptTemplate,
TextSplitter,
Tool,
VectorStore,
)
from .range_spec import RangeSpec from .range_spec import RangeSpec
def import_template_field(): def import_template_field():
from langflow.template.field.base import TemplateField from langflow.template.field.base import TemplateField
return TemplateField return TemplateField
@ -21,12 +40,11 @@ def __getattr__(name: str) -> Any:
elif name == "RangeSpec": elif name == "RangeSpec":
return RangeSpec return RangeSpec
# The other names should work as if they were imported from constants # The other names should work as if they were imported from constants
import langflow.field_typing.constants as constants
return getattr(constants, name) return getattr(constants, name)
__all__ = [ __all__ = [
"NestedDict", "NestedDict",
"Data", "Data",

View file

@ -1,4 +1,3 @@
from abc import ABC
from typing import Any, Callable, Optional, Union from typing import Any, Callable, Optional, Union
from pydantic import BaseModel, ConfigDict, Field, field_serializer from pydantic import BaseModel, ConfigDict, Field, field_serializer