Home / Function/ _bytes_to_b64_str() — langchain Function Reference

_bytes_to_b64_str() — langchain Function Reference

Architecture documentation for the _bytes_to_b64_str() function in google_genai.py from the langchain codebase.

Entity Profile

Dependency Diagram

graph TD
  67c4b453_8508_9252_4f0c_d47520aaf200["_bytes_to_b64_str()"]
  d24bd624_4204_2ea9_e307_7937b89182bc["google_genai.py"]
  67c4b453_8508_9252_4f0c_d47520aaf200 -->|defined in| d24bd624_4204_2ea9_e307_7937b89182bc
  033ef6d5_126f_ff7b_a5d2_07234ffb1322["_convert_to_v1_from_genai_input()"]
  033ef6d5_126f_ff7b_a5d2_07234ffb1322 -->|calls| 67c4b453_8508_9252_4f0c_d47520aaf200
  fd689bd2_1377_f6be_db90_7e66dcadfcce["_convert_to_v1_from_genai()"]
  fd689bd2_1377_f6be_db90_7e66dcadfcce -->|calls| 67c4b453_8508_9252_4f0c_d47520aaf200
  style 67c4b453_8508_9252_4f0c_d47520aaf200 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

libs/core/langchain_core/messages/block_translators/google_genai.py lines 20–22

def _bytes_to_b64_str(bytes_: bytes) -> str:
    """Convert bytes to base64 encoded string."""
    return base64.b64encode(bytes_).decode("utf-8")

Domain

Subdomains

Frequently Asked Questions

What does _bytes_to_b64_str() do?
_bytes_to_b64_str() is a function in the langchain codebase, defined in libs/core/langchain_core/messages/block_translators/google_genai.py.
Where is _bytes_to_b64_str() defined?
_bytes_to_b64_str() is defined in libs/core/langchain_core/messages/block_translators/google_genai.py at line 20.
What calls _bytes_to_b64_str()?
_bytes_to_b64_str() is called by 2 function(s): _convert_to_v1_from_genai, _convert_to_v1_from_genai_input.

Analyze Your Own Codebase

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

Try Supermodel Free