Home / File/ _utilities.py — langchain Source File

_utilities.py — langchain Source File

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

File python LangChainCore ApiManagement 3 imports 1 functions

Entity Profile

Dependency Diagram

graph LR
  51ba5095_313d_b708_0c1f_e6e7447756e8["_utilities.py"]
  0029f612_c503_ebcf_a452_a0fae8c9f2c3["os"]
  51ba5095_313d_b708_0c1f_e6e7447756e8 --> 0029f612_c503_ebcf_a452_a0fae8c9f2c3
  0344251d_a425_177d_d810_f45aa8de9600["exa_py"]
  51ba5095_313d_b708_0c1f_e6e7447756e8 --> 0344251d_a425_177d_d810_f45aa8de9600
  bd035cf2_5933_bc0f_65e9_0dfe57627ca3["langchain_core.utils"]
  51ba5095_313d_b708_0c1f_e6e7447756e8 --> bd035cf2_5933_bc0f_65e9_0dfe57627ca3
  style 51ba5095_313d_b708_0c1f_e6e7447756e8 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

import os  # type: ignore[import-not-found]

from exa_py import Exa
from langchain_core.utils import convert_to_secret_str


def initialize_client(values: dict) -> dict:
    """Initialize the client."""
    exa_api_key = values.get("exa_api_key") or os.environ.get("EXA_API_KEY") or ""
    values["exa_api_key"] = convert_to_secret_str(exa_api_key)
    args = {
        "api_key": values["exa_api_key"].get_secret_value(),
    }
    if values.get("exa_base_url"):
        args["base_url"] = values["exa_base_url"]
    values["client"] = Exa(**args)
    return values

Domain

Subdomains

Dependencies

  • exa_py
  • langchain_core.utils
  • os

Frequently Asked Questions

What does _utilities.py do?
_utilities.py is a source file in the langchain codebase, written in python. It belongs to the LangChainCore domain, ApiManagement subdomain.
What functions are defined in _utilities.py?
_utilities.py defines 1 function(s): initialize_client.
What does _utilities.py depend on?
_utilities.py imports 3 module(s): exa_py, langchain_core.utils, os.
Where is _utilities.py in the architecture?
_utilities.py is located at libs/partners/exa/langchain_exa/_utilities.py (domain: LangChainCore, subdomain: ApiManagement, directory: libs/partners/exa/langchain_exa).

Analyze Your Own Codebase

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

Try Supermodel Free