Home / File/ test_hub.py — langchain Source File

test_hub.py — langchain Source File

Architecture documentation for test_hub.py, a python file in the langchain codebase. 3 imports, 0 dependents.

File python LangChainCore Runnables 3 imports 2 functions

Entity Profile

Dependency Diagram

graph LR
  d1bff66a_3240_cace_d900_6aae0c44af3f["test_hub.py"]
  0029f612_c503_ebcf_a452_a0fae8c9f2c3["os"]
  d1bff66a_3240_cace_d900_6aae0c44af3f --> 0029f612_c503_ebcf_a452_a0fae8c9f2c3
  435e49bf_bb2e_2016_ead7_0afb9d57ad71["langchain_core.prompts"]
  d1bff66a_3240_cace_d900_6aae0c44af3f --> 435e49bf_bb2e_2016_ead7_0afb9d57ad71
  b34076bf_889b_c6a2_b5a2_be91e2ba1ed0["langchain_classic"]
  d1bff66a_3240_cace_d900_6aae0c44af3f --> b34076bf_889b_c6a2_b5a2_be91e2ba1ed0
  style d1bff66a_3240_cace_d900_6aae0c44af3f fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

import os

from langchain_core.prompts import ChatPromptTemplate

from langchain_classic import hub


def test_hub_pull_public_prompt() -> None:
    prompt = hub.pull("efriis/my-first-prompt")
    assert isinstance(prompt, ChatPromptTemplate)
    assert prompt.metadata is not None
    assert prompt.metadata["lc_hub_owner"] == "efriis"
    assert prompt.metadata["lc_hub_repo"] == "my-first-prompt"
    assert (
        prompt.metadata["lc_hub_commit_hash"]
        == "56489e79537fc477d8368e6c9902df15b5e9fe8bc0e4f38dc4b15b65e550077c"
    )


def test_hub_pull_private_prompt() -> None:
    private_prompt = hub.pull("integration-test", api_key=os.environ["HUB_API_KEY"])
    assert isinstance(private_prompt, ChatPromptTemplate)
    assert private_prompt.metadata is not None
    assert private_prompt.metadata["lc_hub_owner"] == "-"
    assert private_prompt.metadata["lc_hub_repo"] == "integration-test"

Domain

Subdomains

Dependencies

  • langchain_classic
  • langchain_core.prompts
  • os

Frequently Asked Questions

What does test_hub.py do?
test_hub.py is a source file in the langchain codebase, written in python. It belongs to the LangChainCore domain, Runnables subdomain.
What functions are defined in test_hub.py?
test_hub.py defines 2 function(s): test_hub_pull_private_prompt, test_hub_pull_public_prompt.
What does test_hub.py depend on?
test_hub.py imports 3 module(s): langchain_classic, langchain_core.prompts, os.
Where is test_hub.py in the architecture?
test_hub.py is located at libs/langchain/tests/integration_tests/test_hub.py (domain: LangChainCore, subdomain: Runnables, directory: libs/langchain/tests/integration_tests).

Analyze Your Own Codebase

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

Try Supermodel Free