prompts.py — langchain Source File
Architecture documentation for prompts.py, a python file in the langchain codebase. 3 imports, 0 dependents.
Entity Profile
Dependency Diagram
graph LR 328702eb_17e4_fbf9_7438_532602d08e88["prompts.py"] feec1ec4_6917_867b_d228_b134d0ff8099["typing"] 328702eb_17e4_fbf9_7438_532602d08e88 --> feec1ec4_6917_867b_d228_b134d0ff8099 e4596b95_ed91_0e47_96dd_7e987bc14a69["langchain_classic._api"] 328702eb_17e4_fbf9_7438_532602d08e88 --> e4596b95_ed91_0e47_96dd_7e987bc14a69 52b96ffd_98ca_017a_6691_81c9c1337dc1["langchain_community.chains.graph_qa.prompts"] 328702eb_17e4_fbf9_7438_532602d08e88 --> 52b96ffd_98ca_017a_6691_81c9c1337dc1 style 328702eb_17e4_fbf9_7438_532602d08e88 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
from typing import TYPE_CHECKING, Any
from langchain_classic._api import create_importer
if TYPE_CHECKING:
from langchain_community.chains.graph_qa.prompts import (
AQL_FIX_TEMPLATE,
AQL_GENERATION_TEMPLATE,
AQL_QA_TEMPLATE,
CYPHER_GENERATION_PROMPT,
CYPHER_GENERATION_TEMPLATE,
CYPHER_QA_PROMPT,
CYPHER_QA_TEMPLATE,
GRAPHDB_QA_TEMPLATE,
GRAPHDB_SPARQL_FIX_TEMPLATE,
GRAPHDB_SPARQL_GENERATION_TEMPLATE,
GREMLIN_GENERATION_TEMPLATE,
KUZU_EXTRA_INSTRUCTIONS,
KUZU_GENERATION_TEMPLATE,
NEBULAGRAPH_EXTRA_INSTRUCTIONS,
NEPTUNE_OPENCYPHER_EXTRA_INSTRUCTIONS,
NEPTUNE_OPENCYPHER_GENERATION_SIMPLE_TEMPLATE,
NEPTUNE_OPENCYPHER_GENERATION_TEMPLATE,
NGQL_GENERATION_TEMPLATE,
SPARQL_GENERATION_SELECT_TEMPLATE,
SPARQL_GENERATION_UPDATE_TEMPLATE,
SPARQL_INTENT_TEMPLATE,
SPARQL_QA_TEMPLATE,
)
# Create a way to dynamically look up deprecated imports.
# Used to consolidate logic for raising deprecation warnings and
# handling optional imports.
DEPRECATED_LOOKUP = {
"AQL_FIX_TEMPLATE": "langchain_community.chains.graph_qa.prompts",
"AQL_GENERATION_TEMPLATE": "langchain_community.chains.graph_qa.prompts",
"AQL_QA_TEMPLATE": "langchain_community.chains.graph_qa.prompts",
"CYPHER_GENERATION_TEMPLATE": "langchain_community.chains.graph_qa.prompts",
"CYPHER_QA_TEMPLATE": "langchain_community.chains.graph_qa.prompts",
"CYPHER_QA_PROMPT": "langchain_community.chains.graph_qa.prompts",
"CYPHER_GENERATION_PROMPT": "langchain_community.chains.graph_qa.prompts",
"GRAPHDB_QA_TEMPLATE": "langchain_community.chains.graph_qa.prompts",
"GRAPHDB_SPARQL_FIX_TEMPLATE": "langchain_community.chains.graph_qa.prompts",
"GRAPHDB_SPARQL_GENERATION_TEMPLATE": "langchain_community.chains.graph_qa.prompts",
"GREMLIN_GENERATION_TEMPLATE": "langchain_community.chains.graph_qa.prompts",
"KUZU_EXTRA_INSTRUCTIONS": "langchain_community.chains.graph_qa.prompts",
"KUZU_GENERATION_TEMPLATE": "langchain_community.chains.graph_qa.prompts",
"NEBULAGRAPH_EXTRA_INSTRUCTIONS": "langchain_community.chains.graph_qa.prompts",
"NEPTUNE_OPENCYPHER_EXTRA_INSTRUCTIONS": (
"langchain_community.chains.graph_qa.prompts"
),
"NEPTUNE_OPENCYPHER_GENERATION_SIMPLE_TEMPLATE": (
"langchain_community.chains.graph_qa.prompts"
),
"NEPTUNE_OPENCYPHER_GENERATION_TEMPLATE": (
"langchain_community.chains.graph_qa.prompts"
),
"NGQL_GENERATION_TEMPLATE": "langchain_community.chains.graph_qa.prompts",
"SPARQL_GENERATION_SELECT_TEMPLATE": "langchain_community.chains.graph_qa.prompts",
"SPARQL_GENERATION_UPDATE_TEMPLATE": "langchain_community.chains.graph_qa.prompts",
"SPARQL_INTENT_TEMPLATE": "langchain_community.chains.graph_qa.prompts",
"SPARQL_QA_TEMPLATE": "langchain_community.chains.graph_qa.prompts",
}
_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
def __getattr__(name: str) -> Any:
"""Look up attributes dynamically."""
return _import_attribute(name)
__all__ = [
"AQL_FIX_TEMPLATE",
"AQL_GENERATION_TEMPLATE",
"AQL_QA_TEMPLATE",
"CYPHER_GENERATION_PROMPT",
"CYPHER_GENERATION_TEMPLATE",
"CYPHER_QA_PROMPT",
"CYPHER_QA_TEMPLATE",
"GRAPHDB_QA_TEMPLATE",
"GRAPHDB_SPARQL_FIX_TEMPLATE",
"GRAPHDB_SPARQL_GENERATION_TEMPLATE",
"GREMLIN_GENERATION_TEMPLATE",
"KUZU_EXTRA_INSTRUCTIONS",
"KUZU_GENERATION_TEMPLATE",
"NEBULAGRAPH_EXTRA_INSTRUCTIONS",
"NEPTUNE_OPENCYPHER_EXTRA_INSTRUCTIONS",
"NEPTUNE_OPENCYPHER_GENERATION_SIMPLE_TEMPLATE",
"NEPTUNE_OPENCYPHER_GENERATION_TEMPLATE",
"NGQL_GENERATION_TEMPLATE",
"SPARQL_GENERATION_SELECT_TEMPLATE",
"SPARQL_GENERATION_UPDATE_TEMPLATE",
"SPARQL_INTENT_TEMPLATE",
"SPARQL_QA_TEMPLATE",
]
Domain
Subdomains
Functions
Dependencies
- langchain_classic._api
- langchain_community.chains.graph_qa.prompts
- typing
Source
Frequently Asked Questions
What does prompts.py do?
prompts.py is a source file in the langchain codebase, written in python. It belongs to the AgentOrchestration domain, ClassicChains subdomain.
What functions are defined in prompts.py?
prompts.py defines 2 function(s): __getattr__, langchain_community.
What does prompts.py depend on?
prompts.py imports 3 module(s): langchain_classic._api, langchain_community.chains.graph_qa.prompts, typing.
Where is prompts.py in the architecture?
prompts.py is located at libs/langchain/langchain_classic/chains/graph_qa/prompts.py (domain: AgentOrchestration, subdomain: ClassicChains, directory: libs/langchain/langchain_classic/chains/graph_qa).
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free