Home / File/ test_custom_chat_model.py — langchain Source File

test_custom_chat_model.py — langchain Source File

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

File python LangChainCore LanguageModelBase 6 imports 1 functions 2 classes

Entity Profile

Dependency Diagram

graph LR
  57394aac_f400_2743_81bf_99d7a4f58d22["test_custom_chat_model.py"]
  feec1ec4_6917_867b_d228_b134d0ff8099["typing"]
  57394aac_f400_2743_81bf_99d7a4f58d22 --> feec1ec4_6917_867b_d228_b134d0ff8099
  f69d6389_263d_68a4_7fbf_f14c0602a9ba["pytest"]
  57394aac_f400_2743_81bf_99d7a4f58d22 --> f69d6389_263d_68a4_7fbf_f14c0602a9ba
  664afa6c_e6cb_4097_de9a_324d8f19a165["langchain_tests.integration_tests"]
  57394aac_f400_2743_81bf_99d7a4f58d22 --> 664afa6c_e6cb_4097_de9a_324d8f19a165
  3a16c96e_2b20_1092_e102_d9bfb77da65e["langchain_tests.unit_tests"]
  57394aac_f400_2743_81bf_99d7a4f58d22 --> 3a16c96e_2b20_1092_e102_d9bfb77da65e
  7ee3d65d_c714_cff3_c07d_a3c483b352c3["tests.unit_tests.custom_chat_model"]
  57394aac_f400_2743_81bf_99d7a4f58d22 --> 7ee3d65d_c714_cff3_c07d_a3c483b352c3
  f77bacd6_1087_c145_d5d5_68e6f3937f9d["langchain_core.language_models.chat_models"]
  57394aac_f400_2743_81bf_99d7a4f58d22 --> f77bacd6_1087_c145_d5d5_68e6f3937f9d
  style 57394aac_f400_2743_81bf_99d7a4f58d22 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

"""Test the standard tests on the custom chat model in the docs."""

from __future__ import annotations

from typing import TYPE_CHECKING, Any

import pytest

from langchain_tests.integration_tests import ChatModelIntegrationTests
from langchain_tests.unit_tests import ChatModelUnitTests
from tests.unit_tests.custom_chat_model import ChatParrotLink

if TYPE_CHECKING:
    from langchain_core.language_models.chat_models import BaseChatModel


class TestChatParrotLinkUnit(ChatModelUnitTests):
    @property
    def chat_model_class(self) -> type[ChatParrotLink]:
        return ChatParrotLink

    @property
    def chat_model_params(self) -> dict[str, Any]:
        return {"model": "bird-brain-001", "temperature": 0, "parrot_buffer_length": 50}


class TestChatParrotLinkIntegration(ChatModelIntegrationTests):
    @property
    def chat_model_class(self) -> type[ChatParrotLink]:
        return ChatParrotLink

    @property
    def chat_model_params(self) -> dict[str, Any]:
        return {"model": "bird-brain-001", "temperature": 0, "parrot_buffer_length": 50}

    @pytest.mark.xfail(reason="ChatParrotLink doesn't implement bind_tools method")
    def test_unicode_tool_call_integration(
        self,
        model: BaseChatModel,
        tool_choice: str | None = None,  # noqa: PT028
        force_tool_call: bool = True,  # noqa: FBT001, FBT002, PT028
    ) -> None:
        """Expected failure as ChatParrotLink doesn't support tool calling yet."""

Domain

Subdomains

Functions

Dependencies

  • langchain_core.language_models.chat_models
  • langchain_tests.integration_tests
  • langchain_tests.unit_tests
  • pytest
  • tests.unit_tests.custom_chat_model
  • typing

Frequently Asked Questions

What does test_custom_chat_model.py do?
test_custom_chat_model.py is a source file in the langchain codebase, written in python. It belongs to the LangChainCore domain, LanguageModelBase subdomain.
What functions are defined in test_custom_chat_model.py?
test_custom_chat_model.py defines 1 function(s): langchain_core.
What does test_custom_chat_model.py depend on?
test_custom_chat_model.py imports 6 module(s): langchain_core.language_models.chat_models, langchain_tests.integration_tests, langchain_tests.unit_tests, pytest, tests.unit_tests.custom_chat_model, typing.
Where is test_custom_chat_model.py in the architecture?
test_custom_chat_model.py is located at libs/standard-tests/tests/unit_tests/test_custom_chat_model.py (domain: LangChainCore, subdomain: LanguageModelBase, directory: libs/standard-tests/tests/unit_tests).

Analyze Your Own Codebase

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

Try Supermodel Free