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

View file

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