Fix import statements and add missing Prompt class

This commit is contained in:
Gabriel Luiz Freitas Almeida 2023-12-01 13:14:17 -03:00
commit ead79e802d
2 changed files with 11 additions and 24 deletions

View file

@ -1,27 +1,9 @@
from .constants import ( from .constants import (AgentExecutor, BaseChatMemory, BaseLanguageModel,
AgentExecutor, BaseLLM, BaseLoader, BaseMemory, BaseOutputParser,
BaseChatMemory, BasePromptTemplate, BaseRetriever, Callable, Chain,
BaseLanguageModel, ChatPromptTemplate, Data, Document, Embeddings,
BaseLLM, NestedDict, Object, Prompt, PromptTemplate,
BaseLoader, TextSplitter, Tool, VectorStore)
BaseMemory,
BaseOutputParser,
BasePromptTemplate,
BaseRetriever,
Callable,
Chain,
ChatPromptTemplate,
Data,
Document,
Embeddings,
NestedDict,
Object,
PromptTemplate,
TextSplitter,
Tool,
VectorStore,
)
__all__ = [ __all__ = [
"NestedDict", "NestedDict",
@ -45,4 +27,5 @@ __all__ = [
"Callable", "Callable",
"BasePromptTemplate", "BasePromptTemplate",
"ChatPromptTemplate", "ChatPromptTemplate",
"Prompt"
] ]

View file

@ -25,6 +25,8 @@ class Object:
class Data: class Data:
pass pass
class Prompt
LANGCHAIN_BASE_TYPES = { LANGCHAIN_BASE_TYPES = {
"Chain": Chain, "Chain": Chain,
@ -44,6 +46,7 @@ LANGCHAIN_BASE_TYPES = {
"BaseOutputParser": BaseOutputParser, "BaseOutputParser": BaseOutputParser,
"BaseMemory": BaseMemory, "BaseMemory": BaseMemory,
"BaseChatMemory": BaseChatMemory, "BaseChatMemory": BaseChatMemory,
} }
# Langchain base types plus Python base types # Langchain base types plus Python base types
CUSTOM_COMPONENT_SUPPORTED_TYPES = { CUSTOM_COMPONENT_SUPPORTED_TYPES = {
@ -58,4 +61,5 @@ CUSTOM_COMPONENT_SUPPORTED_TYPES = {
"Data": Data, "Data": Data,
"Object": Object, "Object": Object,
"Callable": Callable, "Callable": Callable,
"Prompt": Prompt,
} }