__init__.py — langchain Source File
Architecture documentation for __init__.py, a python file in the langchain codebase. 6 imports, 0 dependents.
Entity Profile
Dependency Diagram
graph LR 2ca85e9f_f5e1_1357_4cf1_19a0195adb90["__init__.py"] 8e2034b7_ceb8_963f_29fc_2ea6b50ef9b3["typing"] 2ca85e9f_f5e1_1357_4cf1_19a0195adb90 --> 8e2034b7_ceb8_963f_29fc_2ea6b50ef9b3 a4804e3f_4fa3_c9fc_7121_e057c2daa7e3["langchain_core.example_selectors"] 2ca85e9f_f5e1_1357_4cf1_19a0195adb90 --> a4804e3f_4fa3_c9fc_7121_e057c2daa7e3 e6b4f61e_7b98_6666_3641_26b069517d4a["langchain_core.prompts"] 2ca85e9f_f5e1_1357_4cf1_19a0195adb90 --> e6b4f61e_7b98_6666_3641_26b069517d4a 439a4142_6fa6_fe9a_2cba_7c9fb0cdceb7["langchain_classic._api"] 2ca85e9f_f5e1_1357_4cf1_19a0195adb90 --> 439a4142_6fa6_fe9a_2cba_7c9fb0cdceb7 3dce840b_b372_d11b_6617_c0f05c0af199["langchain_classic.prompts.prompt"] 2ca85e9f_f5e1_1357_4cf1_19a0195adb90 --> 3dce840b_b372_d11b_6617_c0f05c0af199 be28ea74_d389_468d_f1d6_906fa6d3ff69["langchain_community.example_selectors.ngram_overlap"] 2ca85e9f_f5e1_1357_4cf1_19a0195adb90 --> be28ea74_d389_468d_f1d6_906fa6d3ff69 style 2ca85e9f_f5e1_1357_4cf1_19a0195adb90 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
"""**Prompt** is the input to the model.
Prompt is often constructed
from multiple components. Prompt classes and functions make constructing and working
with prompts easy.
"""
from typing import TYPE_CHECKING, Any
from langchain_core.example_selectors import (
LengthBasedExampleSelector,
MaxMarginalRelevanceExampleSelector,
SemanticSimilarityExampleSelector,
)
from langchain_core.prompts import (
AIMessagePromptTemplate,
BaseChatPromptTemplate,
BasePromptTemplate,
ChatMessagePromptTemplate,
ChatPromptTemplate,
FewShotChatMessagePromptTemplate,
FewShotPromptTemplate,
FewShotPromptWithTemplates,
HumanMessagePromptTemplate,
MessagesPlaceholder,
PromptTemplate,
StringPromptTemplate,
SystemMessagePromptTemplate,
load_prompt,
)
from langchain_classic._api import create_importer
from langchain_classic.prompts.prompt import Prompt
if TYPE_CHECKING:
from langchain_community.example_selectors.ngram_overlap import (
NGramOverlapExampleSelector,
)
# Create a way to dynamically look up deprecated imports.
# Used to consolidate logic for raising deprecation warnings and
# handling optional imports.
MODULE_LOOKUP = {
"NGramOverlapExampleSelector": (
"langchain_community.example_selectors.ngram_overlap"
),
}
_import_attribute = create_importer(__file__, module_lookup=MODULE_LOOKUP)
def __getattr__(name: str) -> Any:
"""Look up attributes dynamically."""
return _import_attribute(name)
__all__ = [
"AIMessagePromptTemplate",
"BaseChatPromptTemplate",
"BasePromptTemplate",
"ChatMessagePromptTemplate",
"ChatPromptTemplate",
"FewShotChatMessagePromptTemplate",
"FewShotPromptTemplate",
"FewShotPromptWithTemplates",
"HumanMessagePromptTemplate",
"LengthBasedExampleSelector",
"MaxMarginalRelevanceExampleSelector",
"MessagesPlaceholder",
"NGramOverlapExampleSelector",
"Prompt",
"PromptTemplate",
"SemanticSimilarityExampleSelector",
"StringPromptTemplate",
"SystemMessagePromptTemplate",
"load_prompt",
]
Domain
Subdomains
Functions
Dependencies
- langchain_classic._api
- langchain_classic.prompts.prompt
- langchain_community.example_selectors.ngram_overlap
- langchain_core.example_selectors
- langchain_core.prompts
- typing
Source
Frequently Asked Questions
What does __init__.py do?
__init__.py is a source file in the langchain codebase, written in python. It belongs to the PromptManagement domain, ExampleSelection subdomain.
What functions are defined in __init__.py?
__init__.py defines 2 function(s): __getattr__, langchain_community.
What does __init__.py depend on?
__init__.py imports 6 module(s): langchain_classic._api, langchain_classic.prompts.prompt, langchain_community.example_selectors.ngram_overlap, langchain_core.example_selectors, langchain_core.prompts, typing.
Where is __init__.py in the architecture?
__init__.py is located at libs/langchain/langchain_classic/prompts/__init__.py (domain: PromptManagement, subdomain: ExampleSelection, directory: libs/langchain/langchain_classic/prompts).
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free