Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

community: import flattening fix #20110

Merged
merged 18 commits into from
Apr 10, 2024
124 changes: 123 additions & 1 deletion libs/community/langchain_community/agent_toolkits/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,129 @@
"""

import importlib
from typing import Any
from typing import TYPE_CHECKING, Any

if TYPE_CHECKING:
from langchain_community.agent_toolkits.ainetwork.toolkit import (
AINetworkToolkit, # noqa: F401
)
from langchain_community.agent_toolkits.amadeus.toolkit import (
AmadeusToolkit, # noqa: F401
)
from langchain_community.agent_toolkits.azure_ai_services import (
AzureAiServicesToolkit, # noqa: F401
)
from langchain_community.agent_toolkits.azure_cognitive_services import (
AzureCognitiveServicesToolkit, # noqa: F401
)
from langchain_community.agent_toolkits.cogniswitch.toolkit import (
CogniswitchToolkit, # noqa: F401
)
from langchain_community.agent_toolkits.connery import (
ConneryToolkit, # noqa: F401
)
from langchain_community.agent_toolkits.file_management.toolkit import (
FileManagementToolkit, # noqa: F401
)
from langchain_community.agent_toolkits.gmail.toolkit import (
GmailToolkit, # noqa: F401
)
from langchain_community.agent_toolkits.jira.toolkit import (
JiraToolkit, # noqa: F401
)
from langchain_community.agent_toolkits.json.base import (
create_json_agent, # noqa: F401
)
from langchain_community.agent_toolkits.json.toolkit import (
JsonToolkit, # noqa: F401
)
from langchain_community.agent_toolkits.multion.toolkit import (
MultionToolkit, # noqa: F401
)
from langchain_community.agent_toolkits.nasa.toolkit import (
NasaToolkit, # noqa: F401
)
from langchain_community.agent_toolkits.nla.toolkit import (
NLAToolkit, # noqa: F401
)
from langchain_community.agent_toolkits.office365.toolkit import (
O365Toolkit, # noqa: F401
)
from langchain_community.agent_toolkits.openapi.base import (
create_openapi_agent, # noqa: F401
)
from langchain_community.agent_toolkits.openapi.toolkit import (
OpenAPIToolkit, # noqa: F401
)
from langchain_community.agent_toolkits.playwright.toolkit import (
PlayWrightBrowserToolkit, # noqa: F401
)
from langchain_community.agent_toolkits.polygon.toolkit import (
PolygonToolkit, # noqa: F401
)
from langchain_community.agent_toolkits.powerbi.base import (
create_pbi_agent, # noqa: F401
)
from langchain_community.agent_toolkits.powerbi.chat_base import (
create_pbi_chat_agent, # noqa: F401
)
from langchain_community.agent_toolkits.powerbi.toolkit import (
PowerBIToolkit, # noqa: F401
)
from langchain_community.agent_toolkits.slack.toolkit import (
SlackToolkit, # noqa: F401
)
from langchain_community.agent_toolkits.spark_sql.base import (
create_spark_sql_agent, # noqa: F401
)
from langchain_community.agent_toolkits.spark_sql.toolkit import (
SparkSQLToolkit, # noqa: F401
)
from langchain_community.agent_toolkits.sql.base import (
create_sql_agent, # noqa: F401
)
from langchain_community.agent_toolkits.sql.toolkit import (
SQLDatabaseToolkit, # noqa: F401
)
from langchain_community.agent_toolkits.steam.toolkit import (
SteamToolkit, # noqa: F401
)
from langchain_community.agent_toolkits.zapier.toolkit import (
ZapierToolkit, # noqa: F401
)

__all__ = [
"AINetworkToolkit",
"AmadeusToolkit",
"AzureAiServicesToolkit",
"AzureCognitiveServicesToolkit",
"CogniswitchToolkit",
"ConneryToolkit",
"FileManagementToolkit",
"GmailToolkit",
"JiraToolkit",
"JsonToolkit",
"MultionToolkit",
"NLAToolkit",
"NasaToolkit",
"O365Toolkit",
"OpenAPIToolkit",
"PlayWrightBrowserToolkit",
"PolygonToolkit",
"PowerBIToolkit",
"SQLDatabaseToolkit",
"SlackToolkit",
"SparkSQLToolkit",
"SteamToolkit",
"ZapierToolkit",
"create_json_agent",
"create_openapi_agent",
"create_pbi_agent",
"create_pbi_chat_agent",
"create_spark_sql_agent",
"create_sql_agent",
]


_module_lookup = {
"AINetworkToolkit": "langchain_community.agent_toolkits.ainetwork.toolkit",
Expand Down
2 changes: 1 addition & 1 deletion libs/community/langchain_community/cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -1998,7 +1998,7 @@ def lookup(self, prompt: str, llm_string: str) -> Optional[RETURN_VAL_TYPE]:
k=1,
kind=self.kind,
ef_search=self.ef_search,
score_threshold=self.score_threshold,
score_threshold=self.score_threshold, # type: ignore[arg-type]
)
if results:
for document in results:
Expand Down
43 changes: 42 additions & 1 deletion libs/community/langchain_community/chat_loaders/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,48 @@
""" # noqa: E501

import importlib
from typing import Any
from typing import TYPE_CHECKING, Any

if TYPE_CHECKING:
from langchain_community.chat_loaders.base import (
BaseChatLoader, # noqa: F401
)
from langchain_community.chat_loaders.facebook_messenger import (
FolderFacebookMessengerChatLoader, # noqa: F401
SingleFileFacebookMessengerChatLoader, # noqa: F401
)
from langchain_community.chat_loaders.gmail import (
GMailLoader, # noqa: F401
)
from langchain_community.chat_loaders.imessage import (
IMessageChatLoader, # noqa: F401
)
from langchain_community.chat_loaders.langsmith import (
LangSmithDatasetChatLoader, # noqa: F401
LangSmithRunChatLoader, # noqa: F401
)
from langchain_community.chat_loaders.slack import (
SlackChatLoader, # noqa: F401
)
from langchain_community.chat_loaders.telegram import (
TelegramChatLoader, # noqa: F401
)
from langchain_community.chat_loaders.whatsapp import (
WhatsAppChatLoader, # noqa: F401
)

__all__ = [
"BaseChatLoader",
"FolderFacebookMessengerChatLoader",
"GMailLoader",
"IMessageChatLoader",
"LangSmithDatasetChatLoader",
"LangSmithRunChatLoader",
"SingleFileFacebookMessengerChatLoader",
"SlackChatLoader",
"TelegramChatLoader",
"WhatsAppChatLoader",
]

_module_lookup = {
"BaseChatLoader": "langchain_community.chat_loaders.base",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,96 @@
""" # noqa: E501

import importlib
from typing import Any
from typing import TYPE_CHECKING, Any

if TYPE_CHECKING:
from langchain_community.chat_message_histories.astradb import (
AstraDBChatMessageHistory, # noqa: F401
)
from langchain_community.chat_message_histories.cassandra import (
CassandraChatMessageHistory, # noqa: F401
)
from langchain_community.chat_message_histories.cosmos_db import (
CosmosDBChatMessageHistory, # noqa: F401
)
from langchain_community.chat_message_histories.dynamodb import (
DynamoDBChatMessageHistory, # noqa: F401
)
from langchain_community.chat_message_histories.elasticsearch import (
ElasticsearchChatMessageHistory, # noqa: F401
)
from langchain_community.chat_message_histories.file import (
FileChatMessageHistory, # noqa: F401
)
from langchain_community.chat_message_histories.firestore import (
FirestoreChatMessageHistory, # noqa: F401
)
from langchain_community.chat_message_histories.in_memory import (
ChatMessageHistory, # noqa: F401
)
from langchain_community.chat_message_histories.momento import (
MomentoChatMessageHistory, # noqa: F401
)
from langchain_community.chat_message_histories.mongodb import (
MongoDBChatMessageHistory, # noqa: F401
)
from langchain_community.chat_message_histories.neo4j import (
Neo4jChatMessageHistory, # noqa: F401
)
from langchain_community.chat_message_histories.postgres import (
PostgresChatMessageHistory, # noqa: F401
)
from langchain_community.chat_message_histories.redis import (
RedisChatMessageHistory, # noqa: F401
)
from langchain_community.chat_message_histories.rocksetdb import (
RocksetChatMessageHistory, # noqa: F401
)
from langchain_community.chat_message_histories.singlestoredb import (
SingleStoreDBChatMessageHistory, # noqa: F401
)
from langchain_community.chat_message_histories.sql import (
SQLChatMessageHistory, # noqa: F401
)
from langchain_community.chat_message_histories.streamlit import (
StreamlitChatMessageHistory, # noqa: F401
)
from langchain_community.chat_message_histories.tidb import (
TiDBChatMessageHistory, # noqa: F401
)
from langchain_community.chat_message_histories.upstash_redis import (
UpstashRedisChatMessageHistory, # noqa: F401
)
from langchain_community.chat_message_histories.xata import (
XataChatMessageHistory, # noqa: F401
)
from langchain_community.chat_message_histories.zep import (
ZepChatMessageHistory, # noqa: F401
)

__all__ = [
"AstraDBChatMessageHistory",
"CassandraChatMessageHistory",
"ChatMessageHistory",
"CosmosDBChatMessageHistory",
"DynamoDBChatMessageHistory",
"ElasticsearchChatMessageHistory",
"FileChatMessageHistory",
"FirestoreChatMessageHistory",
"MomentoChatMessageHistory",
"MongoDBChatMessageHistory",
"Neo4jChatMessageHistory",
"PostgresChatMessageHistory",
"RedisChatMessageHistory",
"RocksetChatMessageHistory",
"SQLChatMessageHistory",
"SingleStoreDBChatMessageHistory",
"StreamlitChatMessageHistory",
"TiDBChatMessageHistory",
"UpstashRedisChatMessageHistory",
"XataChatMessageHistory",
"ZepChatMessageHistory",
]

_module_lookup = {
"AstraDBChatMessageHistory": "langchain_community.chat_message_histories.astradb",
Expand Down