🔧 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:
parent
cfdc2da77b
commit
c88d63546f
2 changed files with 9 additions and 1 deletions
|
|
@ -31,6 +31,7 @@ from .constants import (
|
||||||
AgentExecutor,
|
AgentExecutor,
|
||||||
NestedDict,
|
NestedDict,
|
||||||
Data,
|
Data,
|
||||||
|
Object,
|
||||||
)
|
)
|
||||||
|
|
||||||
__all__ = [
|
__all__ = [
|
||||||
|
|
@ -50,4 +51,5 @@ __all__ = [
|
||||||
"TextSplitter",
|
"TextSplitter",
|
||||||
"Document",
|
"Document",
|
||||||
"AgentExecutor",
|
"AgentExecutor",
|
||||||
|
"Object",
|
||||||
]
|
]
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,5 @@
|
||||||
|
from typing import Dict, Union
|
||||||
|
|
||||||
from langchain.agents.agent import AgentExecutor
|
from langchain.agents.agent import AgentExecutor
|
||||||
from langchain.chains.base import Chain
|
from langchain.chains.base import Chain
|
||||||
from langchain.document_loaders.base import BaseLoader
|
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.text_splitter import TextSplitter
|
||||||
from langchain.tools import Tool
|
from langchain.tools import Tool
|
||||||
from langchain.vectorstores.base import VectorStore
|
from langchain.vectorstores.base import VectorStore
|
||||||
from typing import Union, Dict
|
|
||||||
|
|
||||||
# Type alias for more complex dicts
|
# Type alias for more complex dicts
|
||||||
NestedDict = Dict[str, Union[str, Dict]]
|
NestedDict = Dict[str, Union[str, Dict]]
|
||||||
|
|
||||||
|
|
||||||
|
class Object:
|
||||||
|
pass
|
||||||
|
|
||||||
|
|
||||||
class Data:
|
class Data:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
@ -47,4 +52,5 @@ CUSTOM_COMPONENT_SUPPORTED_TYPES = {
|
||||||
"dict": dict,
|
"dict": dict,
|
||||||
"NestedDict": NestedDict,
|
"NestedDict": NestedDict,
|
||||||
"Data": Data,
|
"Data": Data,
|
||||||
|
"Object": Object,
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue