_create_mock_client() — langchain Function Reference
Architecture documentation for the _create_mock_client() function in test_openai_assistant.py from the langchain codebase.
Entity Profile
Dependency Diagram
graph TD 81b2f5ba_63b7_1435_a3d4_96c06a47805c["_create_mock_client()"] d76760d8_a189_0f15_aae7_cb699a67e504["test_openai_assistant.py"] 81b2f5ba_63b7_1435_a3d4_96c06a47805c -->|defined in| d76760d8_a189_0f15_aae7_cb699a67e504 858ed617_d09e_b379_a6db_e444d513e6a4["test_ainvoke_uses_async_response_completed()"] 858ed617_d09e_b379_a6db_e444d513e6a4 -->|calls| 81b2f5ba_63b7_1435_a3d4_96c06a47805c a95f4d8e_5a7c_b8b9_cfaa_37409e3b8edb["test_ainvoke_uses_async_response_requires_action_agent()"] a95f4d8e_5a7c_b8b9_cfaa_37409e3b8edb -->|calls| 81b2f5ba_63b7_1435_a3d4_96c06a47805c c500c2cc_0e04_9b85_0d32_072787f976ef["test_acreate_assistant()"] c500c2cc_0e04_9b85_0d32_072787f976ef -->|calls| 81b2f5ba_63b7_1435_a3d4_96c06a47805c style 81b2f5ba_63b7_1435_a3d4_96c06a47805c fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
libs/langchain/tests/unit_tests/agents/test_openai_assistant.py lines 10–15
def _create_mock_client(*_: Any, use_async: bool = False, **__: Any) -> Any:
client = AsyncMock() if use_async else MagicMock()
mock_assistant = MagicMock()
mock_assistant.id = "abc123"
client.beta.assistants.create.return_value = mock_assistant
return client
Domain
Subdomains
Called By
Source
Frequently Asked Questions
What does _create_mock_client() do?
_create_mock_client() is a function in the langchain codebase, defined in libs/langchain/tests/unit_tests/agents/test_openai_assistant.py.
Where is _create_mock_client() defined?
_create_mock_client() is defined in libs/langchain/tests/unit_tests/agents/test_openai_assistant.py at line 10.
What calls _create_mock_client()?
_create_mock_client() is called by 3 function(s): test_acreate_assistant, test_ainvoke_uses_async_response_completed, test_ainvoke_uses_async_response_requires_action_agent.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free