2023-12-11 21:53:30 +00:00
|
|
|
"""**Utilities** are the integrations with third-part systems and packages.
|
|
|
|
|
|
|
|
Other LangChain classes use **Utilities** to interact with third-part systems
|
|
|
|
and packages.
|
|
|
|
"""
|
2024-03-12 22:18:54 +00:00
|
|
|
import importlib
|
2024-04-10 17:01:19 +00:00
|
|
|
from typing import TYPE_CHECKING, Any
|
|
|
|
|
|
|
|
if TYPE_CHECKING:
|
|
|
|
from langchain_community.utilities.alpha_vantage import (
|
2024-04-30 17:13:48 +00:00
|
|
|
AlphaVantageAPIWrapper,
|
2024-04-10 17:01:19 +00:00
|
|
|
)
|
|
|
|
from langchain_community.utilities.apify import (
|
2024-04-30 17:13:48 +00:00
|
|
|
ApifyWrapper,
|
2024-04-10 17:01:19 +00:00
|
|
|
)
|
|
|
|
from langchain_community.utilities.arcee import (
|
2024-04-30 17:13:48 +00:00
|
|
|
ArceeWrapper,
|
2024-04-10 17:01:19 +00:00
|
|
|
)
|
|
|
|
from langchain_community.utilities.arxiv import (
|
2024-04-30 17:13:48 +00:00
|
|
|
ArxivAPIWrapper,
|
2024-04-10 17:01:19 +00:00
|
|
|
)
|
|
|
|
from langchain_community.utilities.awslambda import (
|
2024-04-30 17:13:48 +00:00
|
|
|
LambdaWrapper,
|
2024-04-10 17:01:19 +00:00
|
|
|
)
|
|
|
|
from langchain_community.utilities.bibtex import (
|
2024-04-30 17:13:48 +00:00
|
|
|
BibtexparserWrapper,
|
2024-04-10 17:01:19 +00:00
|
|
|
)
|
|
|
|
from langchain_community.utilities.bing_search import (
|
2024-04-30 17:13:48 +00:00
|
|
|
BingSearchAPIWrapper,
|
2024-04-10 17:01:19 +00:00
|
|
|
)
|
|
|
|
from langchain_community.utilities.brave_search import (
|
2024-04-30 17:13:48 +00:00
|
|
|
BraveSearchWrapper,
|
2024-04-10 17:01:19 +00:00
|
|
|
)
|
|
|
|
from langchain_community.utilities.dria_index import (
|
2024-04-30 17:13:48 +00:00
|
|
|
DriaAPIWrapper,
|
2024-04-10 17:01:19 +00:00
|
|
|
)
|
|
|
|
from langchain_community.utilities.duckduckgo_search import (
|
2024-04-30 17:13:48 +00:00
|
|
|
DuckDuckGoSearchAPIWrapper,
|
2024-04-10 17:01:19 +00:00
|
|
|
)
|
|
|
|
from langchain_community.utilities.golden_query import (
|
2024-04-30 17:13:48 +00:00
|
|
|
GoldenQueryAPIWrapper,
|
2024-04-10 17:01:19 +00:00
|
|
|
)
|
|
|
|
from langchain_community.utilities.google_finance import (
|
2024-04-30 17:13:48 +00:00
|
|
|
GoogleFinanceAPIWrapper,
|
2024-04-10 17:01:19 +00:00
|
|
|
)
|
|
|
|
from langchain_community.utilities.google_jobs import (
|
2024-04-30 17:13:48 +00:00
|
|
|
GoogleJobsAPIWrapper,
|
2024-04-10 17:01:19 +00:00
|
|
|
)
|
|
|
|
from langchain_community.utilities.google_lens import (
|
2024-04-30 17:13:48 +00:00
|
|
|
GoogleLensAPIWrapper,
|
2024-04-10 17:01:19 +00:00
|
|
|
)
|
|
|
|
from langchain_community.utilities.google_places_api import (
|
2024-04-30 17:13:48 +00:00
|
|
|
GooglePlacesAPIWrapper,
|
2024-04-10 17:01:19 +00:00
|
|
|
)
|
|
|
|
from langchain_community.utilities.google_scholar import (
|
2024-04-30 17:13:48 +00:00
|
|
|
GoogleScholarAPIWrapper,
|
2024-04-10 17:01:19 +00:00
|
|
|
)
|
|
|
|
from langchain_community.utilities.google_search import (
|
2024-04-30 17:13:48 +00:00
|
|
|
GoogleSearchAPIWrapper,
|
2024-04-10 17:01:19 +00:00
|
|
|
)
|
|
|
|
from langchain_community.utilities.google_serper import (
|
2024-04-30 17:13:48 +00:00
|
|
|
GoogleSerperAPIWrapper,
|
2024-04-10 17:01:19 +00:00
|
|
|
)
|
|
|
|
from langchain_community.utilities.google_trends import (
|
2024-04-30 17:13:48 +00:00
|
|
|
GoogleTrendsAPIWrapper,
|
2024-04-10 17:01:19 +00:00
|
|
|
)
|
|
|
|
from langchain_community.utilities.graphql import (
|
2024-04-30 17:13:48 +00:00
|
|
|
GraphQLAPIWrapper,
|
2024-04-10 17:01:19 +00:00
|
|
|
)
|
|
|
|
from langchain_community.utilities.infobip import (
|
2024-04-30 17:13:48 +00:00
|
|
|
InfobipAPIWrapper,
|
2024-04-10 17:01:19 +00:00
|
|
|
)
|
|
|
|
from langchain_community.utilities.jira import (
|
2024-04-30 17:13:48 +00:00
|
|
|
JiraAPIWrapper,
|
2024-04-10 17:01:19 +00:00
|
|
|
)
|
|
|
|
from langchain_community.utilities.max_compute import (
|
2024-04-30 17:13:48 +00:00
|
|
|
MaxComputeAPIWrapper,
|
2024-04-10 17:01:19 +00:00
|
|
|
)
|
|
|
|
from langchain_community.utilities.merriam_webster import (
|
2024-04-30 17:13:48 +00:00
|
|
|
MerriamWebsterAPIWrapper,
|
2024-04-10 17:01:19 +00:00
|
|
|
)
|
|
|
|
from langchain_community.utilities.metaphor_search import (
|
2024-04-30 17:13:48 +00:00
|
|
|
MetaphorSearchAPIWrapper,
|
2024-04-10 17:01:19 +00:00
|
|
|
)
|
2024-04-29 15:49:53 +00:00
|
|
|
from langchain_community.utilities.mojeek_search import (
|
2024-04-30 17:13:48 +00:00
|
|
|
MojeekSearchAPIWrapper,
|
2024-04-29 15:49:53 +00:00
|
|
|
)
|
2024-04-10 17:01:19 +00:00
|
|
|
from langchain_community.utilities.nasa import (
|
2024-04-30 17:13:48 +00:00
|
|
|
NasaAPIWrapper,
|
2024-04-10 17:01:19 +00:00
|
|
|
)
|
|
|
|
from langchain_community.utilities.nvidia_riva import (
|
2024-04-30 17:13:48 +00:00
|
|
|
AudioStream,
|
|
|
|
NVIDIARivaASR,
|
|
|
|
NVIDIARivaStream,
|
|
|
|
NVIDIARivaTTS,
|
|
|
|
RivaASR,
|
|
|
|
RivaTTS,
|
2024-04-10 17:01:19 +00:00
|
|
|
)
|
|
|
|
from langchain_community.utilities.openweathermap import (
|
2024-04-30 17:13:48 +00:00
|
|
|
OpenWeatherMapAPIWrapper,
|
2024-04-10 17:01:19 +00:00
|
|
|
)
|
|
|
|
from langchain_community.utilities.outline import (
|
2024-04-30 17:13:48 +00:00
|
|
|
OutlineAPIWrapper,
|
2024-04-10 17:01:19 +00:00
|
|
|
)
|
|
|
|
from langchain_community.utilities.passio_nutrition_ai import (
|
2024-04-30 17:13:48 +00:00
|
|
|
NutritionAIAPI,
|
2024-04-10 17:01:19 +00:00
|
|
|
)
|
|
|
|
from langchain_community.utilities.portkey import (
|
2024-04-30 17:13:48 +00:00
|
|
|
Portkey,
|
2024-04-10 17:01:19 +00:00
|
|
|
)
|
|
|
|
from langchain_community.utilities.powerbi import (
|
2024-04-30 17:13:48 +00:00
|
|
|
PowerBIDataset,
|
2024-04-10 17:01:19 +00:00
|
|
|
)
|
|
|
|
from langchain_community.utilities.pubmed import (
|
2024-04-30 17:13:48 +00:00
|
|
|
PubMedAPIWrapper,
|
2024-04-10 17:01:19 +00:00
|
|
|
)
|
|
|
|
from langchain_community.utilities.python import (
|
2024-04-30 17:13:48 +00:00
|
|
|
PythonREPL,
|
2024-04-10 17:01:19 +00:00
|
|
|
)
|
|
|
|
from langchain_community.utilities.requests import (
|
2024-04-30 17:13:48 +00:00
|
|
|
Requests,
|
|
|
|
RequestsWrapper,
|
|
|
|
TextRequestsWrapper,
|
2024-04-10 17:01:19 +00:00
|
|
|
)
|
|
|
|
from langchain_community.utilities.scenexplain import (
|
2024-04-30 17:13:48 +00:00
|
|
|
SceneXplainAPIWrapper,
|
2024-04-10 17:01:19 +00:00
|
|
|
)
|
|
|
|
from langchain_community.utilities.searchapi import (
|
2024-04-30 17:13:48 +00:00
|
|
|
SearchApiAPIWrapper,
|
2024-04-10 17:01:19 +00:00
|
|
|
)
|
|
|
|
from langchain_community.utilities.searx_search import (
|
2024-04-30 17:13:48 +00:00
|
|
|
SearxSearchWrapper,
|
2024-04-10 17:01:19 +00:00
|
|
|
)
|
|
|
|
from langchain_community.utilities.serpapi import (
|
2024-04-30 17:13:48 +00:00
|
|
|
SerpAPIWrapper,
|
2024-04-10 17:01:19 +00:00
|
|
|
)
|
|
|
|
from langchain_community.utilities.spark_sql import (
|
2024-04-30 17:13:48 +00:00
|
|
|
SparkSQL,
|
2024-04-10 17:01:19 +00:00
|
|
|
)
|
|
|
|
from langchain_community.utilities.sql_database import (
|
2024-04-30 17:13:48 +00:00
|
|
|
SQLDatabase,
|
2024-04-10 17:01:19 +00:00
|
|
|
)
|
|
|
|
from langchain_community.utilities.stackexchange import (
|
2024-04-30 17:13:48 +00:00
|
|
|
StackExchangeAPIWrapper,
|
2024-04-10 17:01:19 +00:00
|
|
|
)
|
|
|
|
from langchain_community.utilities.steam import (
|
2024-04-30 17:13:48 +00:00
|
|
|
SteamWebAPIWrapper,
|
2024-04-10 17:01:19 +00:00
|
|
|
)
|
|
|
|
from langchain_community.utilities.tensorflow_datasets import (
|
2024-04-30 17:13:48 +00:00
|
|
|
TensorflowDatasets,
|
2024-04-10 17:01:19 +00:00
|
|
|
)
|
|
|
|
from langchain_community.utilities.twilio import (
|
2024-04-30 17:13:48 +00:00
|
|
|
TwilioAPIWrapper,
|
2024-04-10 17:01:19 +00:00
|
|
|
)
|
|
|
|
from langchain_community.utilities.wikipedia import (
|
2024-04-30 17:13:48 +00:00
|
|
|
WikipediaAPIWrapper,
|
2024-04-10 17:01:19 +00:00
|
|
|
)
|
|
|
|
from langchain_community.utilities.wolfram_alpha import (
|
2024-04-30 17:13:48 +00:00
|
|
|
WolframAlphaAPIWrapper,
|
2024-04-10 17:01:19 +00:00
|
|
|
)
|
|
|
|
from langchain_community.utilities.you import (
|
2024-04-30 17:13:48 +00:00
|
|
|
YouSearchAPIWrapper,
|
2024-04-10 17:01:19 +00:00
|
|
|
)
|
|
|
|
from langchain_community.utilities.zapier import (
|
2024-04-30 17:13:48 +00:00
|
|
|
ZapierNLAWrapper,
|
2024-04-10 17:01:19 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
__all__ = [
|
|
|
|
"AlphaVantageAPIWrapper",
|
|
|
|
"ApifyWrapper",
|
|
|
|
"ArceeWrapper",
|
|
|
|
"ArxivAPIWrapper",
|
|
|
|
"AudioStream",
|
|
|
|
"BibtexparserWrapper",
|
|
|
|
"BingSearchAPIWrapper",
|
|
|
|
"BraveSearchWrapper",
|
|
|
|
"DriaAPIWrapper",
|
|
|
|
"DuckDuckGoSearchAPIWrapper",
|
|
|
|
"GoldenQueryAPIWrapper",
|
|
|
|
"GoogleFinanceAPIWrapper",
|
|
|
|
"GoogleJobsAPIWrapper",
|
|
|
|
"GoogleLensAPIWrapper",
|
|
|
|
"GooglePlacesAPIWrapper",
|
|
|
|
"GoogleScholarAPIWrapper",
|
|
|
|
"GoogleSearchAPIWrapper",
|
|
|
|
"GoogleSerperAPIWrapper",
|
|
|
|
"GoogleTrendsAPIWrapper",
|
|
|
|
"GraphQLAPIWrapper",
|
|
|
|
"InfobipAPIWrapper",
|
|
|
|
"JiraAPIWrapper",
|
|
|
|
"LambdaWrapper",
|
|
|
|
"MaxComputeAPIWrapper",
|
|
|
|
"MerriamWebsterAPIWrapper",
|
|
|
|
"MetaphorSearchAPIWrapper",
|
2024-04-29 15:49:53 +00:00
|
|
|
"MojeekSearchAPIWrapper",
|
2024-04-10 17:01:19 +00:00
|
|
|
"NVIDIARivaASR",
|
|
|
|
"NVIDIARivaStream",
|
|
|
|
"NVIDIARivaTTS",
|
|
|
|
"NasaAPIWrapper",
|
|
|
|
"NutritionAIAPI",
|
|
|
|
"OpenWeatherMapAPIWrapper",
|
|
|
|
"OutlineAPIWrapper",
|
|
|
|
"Portkey",
|
|
|
|
"PowerBIDataset",
|
|
|
|
"PubMedAPIWrapper",
|
|
|
|
"PythonREPL",
|
|
|
|
"Requests",
|
|
|
|
"RequestsWrapper",
|
|
|
|
"RivaASR",
|
|
|
|
"RivaTTS",
|
|
|
|
"SQLDatabase",
|
|
|
|
"SceneXplainAPIWrapper",
|
|
|
|
"SearchApiAPIWrapper",
|
|
|
|
"SearxSearchWrapper",
|
|
|
|
"SerpAPIWrapper",
|
|
|
|
"SparkSQL",
|
|
|
|
"StackExchangeAPIWrapper",
|
|
|
|
"SteamWebAPIWrapper",
|
|
|
|
"TensorflowDatasets",
|
|
|
|
"TextRequestsWrapper",
|
|
|
|
"TwilioAPIWrapper",
|
|
|
|
"WikipediaAPIWrapper",
|
|
|
|
"WolframAlphaAPIWrapper",
|
|
|
|
"YouSearchAPIWrapper",
|
|
|
|
"ZapierNLAWrapper",
|
|
|
|
]
|
2023-12-11 21:53:30 +00:00
|
|
|
|
2024-03-12 22:18:54 +00:00
|
|
|
_module_lookup = {
|
|
|
|
"AlphaVantageAPIWrapper": "langchain_community.utilities.alpha_vantage",
|
|
|
|
"ApifyWrapper": "langchain_community.utilities.apify",
|
|
|
|
"ArceeWrapper": "langchain_community.utilities.arcee",
|
|
|
|
"ArxivAPIWrapper": "langchain_community.utilities.arxiv",
|
|
|
|
"AudioStream": "langchain_community.utilities.nvidia_riva",
|
|
|
|
"BibtexparserWrapper": "langchain_community.utilities.bibtex",
|
|
|
|
"BingSearchAPIWrapper": "langchain_community.utilities.bing_search",
|
|
|
|
"BraveSearchWrapper": "langchain_community.utilities.brave_search",
|
2024-04-13 23:27:16 +00:00
|
|
|
"DataheraldAPIWrapper": "langchain_community.utilities.dataherald",
|
2024-04-01 19:04:19 +00:00
|
|
|
"DriaAPIWrapper": "langchain_community.utilities.dria_index",
|
2024-03-12 22:18:54 +00:00
|
|
|
"DuckDuckGoSearchAPIWrapper": "langchain_community.utilities.duckduckgo_search",
|
|
|
|
"GoldenQueryAPIWrapper": "langchain_community.utilities.golden_query",
|
|
|
|
"GoogleFinanceAPIWrapper": "langchain_community.utilities.google_finance",
|
|
|
|
"GoogleJobsAPIWrapper": "langchain_community.utilities.google_jobs",
|
|
|
|
"GoogleLensAPIWrapper": "langchain_community.utilities.google_lens",
|
|
|
|
"GooglePlacesAPIWrapper": "langchain_community.utilities.google_places_api",
|
|
|
|
"GoogleScholarAPIWrapper": "langchain_community.utilities.google_scholar",
|
|
|
|
"GoogleSearchAPIWrapper": "langchain_community.utilities.google_search",
|
|
|
|
"GoogleSerperAPIWrapper": "langchain_community.utilities.google_serper",
|
|
|
|
"GoogleTrendsAPIWrapper": "langchain_community.utilities.google_trends",
|
|
|
|
"GraphQLAPIWrapper": "langchain_community.utilities.graphql",
|
2024-03-29 19:01:27 +00:00
|
|
|
"InfobipAPIWrapper": "langchain_community.utilities.infobip",
|
2024-03-12 22:18:54 +00:00
|
|
|
"JiraAPIWrapper": "langchain_community.utilities.jira",
|
|
|
|
"LambdaWrapper": "langchain_community.utilities.awslambda",
|
|
|
|
"MaxComputeAPIWrapper": "langchain_community.utilities.max_compute",
|
|
|
|
"MerriamWebsterAPIWrapper": "langchain_community.utilities.merriam_webster",
|
|
|
|
"MetaphorSearchAPIWrapper": "langchain_community.utilities.metaphor_search",
|
2024-04-29 15:49:53 +00:00
|
|
|
"MojeekSearchAPIWrapper": "langchain_community.utilities.mojeek_search",
|
2024-03-12 22:18:54 +00:00
|
|
|
"NVIDIARivaASR": "langchain_community.utilities.nvidia_riva",
|
|
|
|
"NVIDIARivaStream": "langchain_community.utilities.nvidia_riva",
|
|
|
|
"NVIDIARivaTTS": "langchain_community.utilities.nvidia_riva",
|
|
|
|
"NasaAPIWrapper": "langchain_community.utilities.nasa",
|
|
|
|
"NutritionAIAPI": "langchain_community.utilities.passio_nutrition_ai",
|
|
|
|
"OpenWeatherMapAPIWrapper": "langchain_community.utilities.openweathermap",
|
|
|
|
"OutlineAPIWrapper": "langchain_community.utilities.outline",
|
|
|
|
"Portkey": "langchain_community.utilities.portkey",
|
|
|
|
"PowerBIDataset": "langchain_community.utilities.powerbi",
|
|
|
|
"PubMedAPIWrapper": "langchain_community.utilities.pubmed",
|
|
|
|
"PythonREPL": "langchain_community.utilities.python",
|
2024-05-01 14:41:44 +00:00
|
|
|
"RememberizerAPIWrapper": "langchain_community.utilities.rememberizer",
|
2024-03-12 22:18:54 +00:00
|
|
|
"Requests": "langchain_community.utilities.requests",
|
|
|
|
"RequestsWrapper": "langchain_community.utilities.requests",
|
|
|
|
"RivaASR": "langchain_community.utilities.nvidia_riva",
|
|
|
|
"RivaTTS": "langchain_community.utilities.nvidia_riva",
|
|
|
|
"SQLDatabase": "langchain_community.utilities.sql_database",
|
|
|
|
"SceneXplainAPIWrapper": "langchain_community.utilities.scenexplain",
|
|
|
|
"SearchApiAPIWrapper": "langchain_community.utilities.searchapi",
|
|
|
|
"SearxSearchWrapper": "langchain_community.utilities.searx_search",
|
|
|
|
"SerpAPIWrapper": "langchain_community.utilities.serpapi",
|
|
|
|
"SparkSQL": "langchain_community.utilities.spark_sql",
|
|
|
|
"StackExchangeAPIWrapper": "langchain_community.utilities.stackexchange",
|
|
|
|
"SteamWebAPIWrapper": "langchain_community.utilities.steam",
|
|
|
|
"TensorflowDatasets": "langchain_community.utilities.tensorflow_datasets",
|
|
|
|
"TextRequestsWrapper": "langchain_community.utilities.requests",
|
|
|
|
"TwilioAPIWrapper": "langchain_community.utilities.twilio",
|
|
|
|
"WikipediaAPIWrapper": "langchain_community.utilities.wikipedia",
|
|
|
|
"WolframAlphaAPIWrapper": "langchain_community.utilities.wolfram_alpha",
|
|
|
|
"YouSearchAPIWrapper": "langchain_community.utilities.you",
|
|
|
|
"ZapierNLAWrapper": "langchain_community.utilities.zapier",
|
|
|
|
}
|
community: Added new Utility runnables for NVIDIA Riva. (#15966)
**Please tag this issue with `nvidia_genai`**
- **Description:** Added new Runnables for integration NVIDIA Riva into
LCEL chains for Automatic Speech Recognition (ASR) and Text To Speech
(TTS).
- **Issue:** N/A
- **Dependencies:** To use these runnables, the NVIDIA Riva client
libraries are required. It they are not installed, an error will be
raised instructing how to install them. The Runnables can be safely
imported without the riva client libraries.
- **Twitter handle:** N/A
All of the Riva Runnables are inside a single folder in the Utilities
module. In this folder are four files:
- common.py - Contains all code that is common to both TTS and ASR
- stream.py - Contains a class representing an audio stream that allows
the end user to put data into the stream like a queue.
- asr.py - Contains the RivaASR runnable
- tts.py - Contains the RivaTTS runnable
The following Python function is an example of creating a chain that
makes use of both of these Runnables:
```python
def create(
config: Configuration,
audio_encoding: RivaAudioEncoding,
sample_rate: int,
audio_channels: int = 1,
) -> Runnable[ASRInputType, TTSOutputType]:
"""Create a new instance of the chain."""
_LOGGER.info("Instantiating the chain.")
# create the riva asr client
riva_asr = RivaASR(
url=str(config.riva_asr.service.url),
ssl_cert=config.riva_asr.service.ssl_cert,
encoding=audio_encoding,
audio_channel_count=audio_channels,
sample_rate_hertz=sample_rate,
profanity_filter=config.riva_asr.profanity_filter,
enable_automatic_punctuation=config.riva_asr.enable_automatic_punctuation,
language_code=config.riva_asr.language_code,
)
# create the prompt template
prompt = PromptTemplate.from_template("{user_input}")
# model = ChatOpenAI()
model = ChatNVIDIA(model="mixtral_8x7b") # type: ignore
# create the riva tts client
riva_tts = RivaTTS(
url=str(config.riva_asr.service.url),
ssl_cert=config.riva_asr.service.ssl_cert,
output_directory=config.riva_tts.output_directory,
language_code=config.riva_tts.language_code,
voice_name=config.riva_tts.voice_name,
)
# construct and return the chain
return {"user_input": riva_asr} | prompt | model | riva_tts # type: ignore
```
The following code is an example of creating a new audio stream for
Riva:
```python
input_stream = AudioStream(maxsize=1000)
# Send bytes into the stream
for chunk in audio_chunks:
await input_stream.aput(chunk)
input_stream.close()
```
The following code is an example of how to execute the chain with
RivaASR and RivaTTS
```python
output_stream = asyncio.Queue()
while not input_stream.complete:
async for chunk in chain.astream(input_stream):
output_stream.put(chunk)
```
Everything should be async safe and thread safe. Audio data can be put
into the input stream while the chain is running without interruptions.
---------
Co-authored-by: Hayden Wolff <hwolff@nvidia.com>
Co-authored-by: Hayden Wolff <hwolff@Haydens-Laptop.local>
Co-authored-by: Hayden Wolff <haydenwolff99@gmail.com>
Co-authored-by: Erick Friis <erick@langchain.dev>
2024-02-06 03:50:50 +00:00
|
|
|
|
|
|
|
|
2023-12-11 21:53:30 +00:00
|
|
|
def __getattr__(name: str) -> Any:
|
2024-03-12 22:18:54 +00:00
|
|
|
if name in _module_lookup:
|
|
|
|
module = importlib.import_module(_module_lookup[name])
|
|
|
|
return getattr(module, name)
|
|
|
|
raise AttributeError(f"module {__name__} has no attribute {name}")
|
2023-12-11 21:53:30 +00:00
|
|
|
|
|
|
|
|
2024-03-12 22:18:54 +00:00
|
|
|
__all__ = list(_module_lookup.keys())
|