✨ (field_typing): introduce BaseChatModel to field_typing module for better organization and structure

📝 (constants): add BaseChatModel to LANGCHAIN_BASE_TYPES dictionary for consistency and completeness
This commit is contained in:
Gabriel Luiz Freitas Almeida 2024-06-19 20:23:15 -03:00
commit 23763f8795
2 changed files with 4 additions and 1 deletions

View file

@ -7,6 +7,7 @@ from .constants import (
BaseLLM, BaseLLM,
BaseLoader, BaseLoader,
BaseMemory, BaseMemory,
BaseChatModel,
BaseOutputParser, BaseOutputParser,
BasePromptTemplate, BasePromptTemplate,
BaseRetriever, BaseRetriever,
@ -80,4 +81,5 @@ __all__ = [
"TextSplitter", "TextSplitter",
"Tool", "Tool",
"VectorStore", "VectorStore",
"BaseChatModel",
] ]

View file

@ -1,5 +1,5 @@
from typing import Callable, Dict, Text, Union from typing import Callable, Dict, Text, Union
from langchain_core.language_models.chat_models import BaseChatModel
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.memory.chat_memory import BaseChatMemory from langchain.memory.chat_memory import BaseChatMemory
@ -48,6 +48,7 @@ LANGCHAIN_BASE_TYPES = {
"BaseOutputParser": BaseOutputParser, "BaseOutputParser": BaseOutputParser,
"BaseMemory": BaseMemory, "BaseMemory": BaseMemory,
"BaseChatMemory": BaseChatMemory, "BaseChatMemory": BaseChatMemory,
"BaseChatModel": BaseChatModel,
} }
# Langchain base types plus Python base types # Langchain base types plus Python base types
CUSTOM_COMPONENT_SUPPORTED_TYPES = { CUSTOM_COMPONENT_SUPPORTED_TYPES = {