🔧 fix(field_typing): import Object class in __init__.py to fix missing import error

🔧 fix(constants.py): add Object class to CUSTOM_COMPONENT_SUPPORTED_TYPES to support object type in field typing
This commit is contained in:
Gabriel Luiz Freitas Almeida 2023-11-14 21:00:43 -03:00
commit c88d63546f
2 changed files with 9 additions and 1 deletions

View file

@ -31,6 +31,7 @@ from .constants import (
AgentExecutor,
NestedDict,
Data,
Object,
)
__all__ = [
@ -50,4 +51,5 @@ __all__ = [
"TextSplitter",
"Document",
"AgentExecutor",
"Object",
]

View file

@ -1,3 +1,5 @@
from typing import Dict, Union
from langchain.agents.agent import AgentExecutor
from langchain.chains.base import Chain
from langchain.document_loaders.base import BaseLoader
@ -10,12 +12,15 @@ from langchain.schema.memory import BaseMemory
from langchain.text_splitter import TextSplitter
from langchain.tools import Tool
from langchain.vectorstores.base import VectorStore
from typing import Union, Dict
# Type alias for more complex dicts
NestedDict = Dict[str, Union[str, Dict]]
class Object:
pass
class Data:
pass
@ -47,4 +52,5 @@ CUSTOM_COMPONENT_SUPPORTED_TYPES = {
"dict": dict,
"NestedDict": NestedDict,
"Data": Data,
"Object": Object,
}