Home / File/ test_base_standard.py — langchain Source File

test_base_standard.py — langchain Source File

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

File python CoreAbstractions MessageSchema 9 imports 2 functions 2 classes

Entity Profile

Dependency Diagram

graph LR
  2b842419_0065_4f83_a358_908517775dea["test_base_standard.py"]
  66c6348c_7716_027c_42d7_71449bc64eeb["base64"]
  2b842419_0065_4f83_a358_908517775dea --> 66c6348c_7716_027c_42d7_71449bc64eeb
  b6ee5de5_719a_eeb5_1e11_e9c63bc22ef8["pathlib"]
  2b842419_0065_4f83_a358_908517775dea --> b6ee5de5_719a_eeb5_1e11_e9c63bc22ef8
  8e2034b7_ceb8_963f_29fc_2ea6b50ef9b3["typing"]
  2b842419_0065_4f83_a358_908517775dea --> 8e2034b7_ceb8_963f_29fc_2ea6b50ef9b3
  1803c8c1_a347_1256_1454_9f04c3553d93["httpx"]
  2b842419_0065_4f83_a358_908517775dea --> 1803c8c1_a347_1256_1454_9f04c3553d93
  120e2591_3e15_b895_72b6_cb26195e40a6["pytest"]
  2b842419_0065_4f83_a358_908517775dea --> 120e2591_3e15_b895_72b6_cb26195e40a6
  ba43b74d_3099_7e1c_aac3_cf594720469e["langchain_core.language_models"]
  2b842419_0065_4f83_a358_908517775dea --> ba43b74d_3099_7e1c_aac3_cf594720469e
  d758344f_537f_649e_f467_b9d7442e86df["langchain_core.messages"]
  2b842419_0065_4f83_a358_908517775dea --> d758344f_537f_649e_f467_b9d7442e86df
  8f882798_3f47_fa1f_5253_3b7193f357a9["langchain_tests.integration_tests"]
  2b842419_0065_4f83_a358_908517775dea --> 8f882798_3f47_fa1f_5253_3b7193f357a9
  0b28cff6_d823_1571_d2bb_ec61508cc89c["langchain_openai"]
  2b842419_0065_4f83_a358_908517775dea --> 0b28cff6_d823_1571_d2bb_ec61508cc89c
  style 2b842419_0065_4f83_a358_908517775dea fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

"""Standard LangChain interface tests"""

import base64
from pathlib import Path
from typing import Literal, cast

import httpx
import pytest
from langchain_core.language_models import BaseChatModel
from langchain_core.messages import AIMessage, HumanMessage
from langchain_tests.integration_tests import ChatModelIntegrationTests

from langchain_openai import ChatOpenAI

REPO_ROOT_DIR = Path(__file__).parents[6]


class TestOpenAIStandard(ChatModelIntegrationTests):
    @property
    def chat_model_class(self) -> type[BaseChatModel]:
        return ChatOpenAI

    @property
    def chat_model_params(self) -> dict:
        return {"model": "gpt-4o-mini"}

    @property
    def supports_image_inputs(self) -> bool:
        return True

    @property
    def supports_image_urls(self) -> bool:
        return True

    @property
    def supports_json_mode(self) -> bool:
        return True

    @property
    def supports_anthropic_inputs(self) -> bool:
        return True

    @property
    def supported_usage_metadata_details(
        self,
    ) -> dict[
        Literal["invoke", "stream"],
        list[
            Literal[
                "audio_input",
                "audio_output",
                "reasoning_output",
                "cache_read_input",
                "cache_creation_input",
            ]
        ],
    ]:
        return {"invoke": ["reasoning_output", "cache_read_input"], "stream": []}

    @property
// ... (100 more lines)

Subdomains

Dependencies

  • base64
  • httpx
  • langchain_core.language_models
  • langchain_core.messages
  • langchain_openai
  • langchain_tests.integration_tests
  • pathlib
  • pytest
  • typing

Frequently Asked Questions

What does test_base_standard.py do?
test_base_standard.py is a source file in the langchain codebase, written in python. It belongs to the CoreAbstractions domain, MessageSchema subdomain.
What functions are defined in test_base_standard.py?
test_base_standard.py defines 2 function(s): _invoke, test_audio_model.
What does test_base_standard.py depend on?
test_base_standard.py imports 9 module(s): base64, httpx, langchain_core.language_models, langchain_core.messages, langchain_openai, langchain_tests.integration_tests, pathlib, pytest, and 1 more.
Where is test_base_standard.py in the architecture?
test_base_standard.py is located at libs/partners/openai/tests/integration_tests/chat_models/test_base_standard.py (domain: CoreAbstractions, subdomain: MessageSchema, directory: libs/partners/openai/tests/integration_tests/chat_models).

Analyze Your Own Codebase

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

Try Supermodel Free