Home / File/ test_azure_embeddings.py — langchain Source File

test_azure_embeddings.py — langchain Source File

Architecture documentation for test_azure_embeddings.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
  d6c8b849_f702_4d55_ec75_db907b92ae0d["test_azure_embeddings.py"]
  0029f612_c503_ebcf_a452_a0fae8c9f2c3["os"]
  d6c8b849_f702_4d55_ec75_db907b92ae0d --> 0029f612_c503_ebcf_a452_a0fae8c9f2c3
  0b0de9e1_5259_4f11_33ed_8e5834038690["unittest"]
  d6c8b849_f702_4d55_ec75_db907b92ae0d --> 0b0de9e1_5259_4f11_33ed_8e5834038690
  2cad93e6_586a_5d28_a74d_4ec6fd4d2227["langchain_openai"]
  d6c8b849_f702_4d55_ec75_db907b92ae0d --> 2cad93e6_586a_5d28_a74d_4ec6fd4d2227
  style d6c8b849_f702_4d55_ec75_db907b92ae0d fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

import os
from unittest import mock

from langchain_openai import AzureOpenAIEmbeddings


def test_initialize_azure_openai() -> None:
    embeddings = AzureOpenAIEmbeddings(  # type: ignore[call-arg]
        model="text-embedding-large",
        api_key="xyz",  # type: ignore[arg-type]
        azure_endpoint="my-base-url",
        azure_deployment="35-turbo-dev",
        openai_api_version="2023-05-15",
    )
    assert embeddings.model == "text-embedding-large"


def test_initialize_azure_openai_with_base_set() -> None:
    with mock.patch.dict(os.environ, {"OPENAI_API_BASE": "https://api.openai.com"}):
        embeddings = AzureOpenAIEmbeddings(  # type: ignore[call-arg, call-arg]
            model="text-embedding-large",
            api_key="xyz",  # type: ignore[arg-type]
            azure_endpoint="my-base-url",
            azure_deployment="35-turbo-dev",
            openai_api_version="2023-05-15",
            openai_api_base=None,
        )
        assert embeddings.model == "text-embedding-large"

Domain

Subdomains

Dependencies

  • langchain_openai
  • os
  • unittest

Frequently Asked Questions

What does test_azure_embeddings.py do?
test_azure_embeddings.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_azure_embeddings.py?
test_azure_embeddings.py defines 2 function(s): test_initialize_azure_openai, test_initialize_azure_openai_with_base_set.
What does test_azure_embeddings.py depend on?
test_azure_embeddings.py imports 3 module(s): langchain_openai, os, unittest.
Where is test_azure_embeddings.py in the architecture?
test_azure_embeddings.py is located at libs/partners/openai/tests/unit_tests/embeddings/test_azure_embeddings.py (domain: LangChainCore, subdomain: Runnables, directory: libs/partners/openai/tests/unit_tests/embeddings).

Analyze Your Own Codebase

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

Try Supermodel Free