Home / Function/ test_groq_ainvoke() — langchain Function Reference

test_groq_ainvoke() — langchain Function Reference

Architecture documentation for the test_groq_ainvoke() function in test_chat_models.py from the langchain codebase.

Entity Profile

Dependency Diagram

graph TD
  281e4328_49b0_5a68_3c09_4c5753f00e92["test_groq_ainvoke()"]
  5bf2e477_37e0_3e98_4042_bc609f2f7f60["test_chat_models.py"]
  281e4328_49b0_5a68_3c09_4c5753f00e92 -->|defined in| 5bf2e477_37e0_3e98_4042_bc609f2f7f60
  style 281e4328_49b0_5a68_3c09_4c5753f00e92 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

libs/partners/groq/tests/unit_tests/test_chat_models.py lines 191–210

async def test_groq_ainvoke(mock_completion: dict) -> None:
    llm = ChatGroq(model="foo")
    mock_client = AsyncMock()
    completed = False

    async def mock_create(*args: Any, **kwargs: Any) -> Any:
        nonlocal completed
        completed = True
        return mock_completion

    mock_client.create = mock_create
    with patch.object(
        llm,
        "async_client",
        mock_client,
    ):
        res = await llm.ainvoke("bar")
        assert res.content == "Bar Baz"
        assert type(res) is AIMessage
    assert completed

Domain

Subdomains

Frequently Asked Questions

What does test_groq_ainvoke() do?
test_groq_ainvoke() is a function in the langchain codebase, defined in libs/partners/groq/tests/unit_tests/test_chat_models.py.
Where is test_groq_ainvoke() defined?
test_groq_ainvoke() is defined in libs/partners/groq/tests/unit_tests/test_chat_models.py at line 191.

Analyze Your Own Codebase

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

Try Supermodel Free