Home / Function/ _check_in_allowed_domain() — langchain Function Reference

_check_in_allowed_domain() — langchain Function Reference

Architecture documentation for the _check_in_allowed_domain() function in base.py from the langchain codebase.

Entity Profile

Dependency Diagram

graph TD
  357f19d8_3422_6a9d_533d_c62f93023ce8["_check_in_allowed_domain()"]
  abf79bd8_0d60_378a_f86d_85282499aced["base.py"]
  357f19d8_3422_6a9d_533d_c62f93023ce8 -->|defined in| abf79bd8_0d60_378a_f86d_85282499aced
  0393cea2_16ff_2ed6_ebe5_2e7f4968843e["langchain_community()"]
  0393cea2_16ff_2ed6_ebe5_2e7f4968843e -->|calls| 357f19d8_3422_6a9d_533d_c62f93023ce8
  1ea4a52c_0867_4fcb_dd5a_6056c78eabd9["_call()"]
  1ea4a52c_0867_4fcb_dd5a_6056c78eabd9 -->|calls| 357f19d8_3422_6a9d_533d_c62f93023ce8
  ccc83700_c56e_645f_a5ce_9e44f26e609a["_acall()"]
  ccc83700_c56e_645f_a5ce_9e44f26e609a -->|calls| 357f19d8_3422_6a9d_533d_c62f93023ce8
  186d5b55_0a55_5297_b56d_913961e32304["_extract_scheme_and_domain()"]
  357f19d8_3422_6a9d_533d_c62f93023ce8 -->|calls| 186d5b55_0a55_5297_b56d_913961e32304
  style 357f19d8_3422_6a9d_533d_c62f93023ce8 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

libs/langchain/langchain_classic/chains/api/base.py lines 37–53

def _check_in_allowed_domain(url: str, limit_to_domains: Sequence[str]) -> bool:
    """Check if a URL is in the allowed domains.

    Args:
        url: The input URL.
        limit_to_domains: The allowed domains.

    Returns:
        `True` if the URL is in the allowed domains, `False` otherwise.
    """
    scheme, domain = _extract_scheme_and_domain(url)

    for allowed_domain in limit_to_domains:
        allowed_scheme, allowed_domain_ = _extract_scheme_and_domain(allowed_domain)
        if scheme == allowed_scheme and domain == allowed_domain_:
            return True
    return False

Subdomains

Frequently Asked Questions

What does _check_in_allowed_domain() do?
_check_in_allowed_domain() is a function in the langchain codebase, defined in libs/langchain/langchain_classic/chains/api/base.py.
Where is _check_in_allowed_domain() defined?
_check_in_allowed_domain() is defined in libs/langchain/langchain_classic/chains/api/base.py at line 37.
What does _check_in_allowed_domain() call?
_check_in_allowed_domain() calls 1 function(s): _extract_scheme_and_domain.
What calls _check_in_allowed_domain()?
_check_in_allowed_domain() is called by 3 function(s): _acall, _call, langchain_community.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free