Home / Function/ test_async_command_graph_raises_not_implemented() — langchain Function Reference

test_async_command_graph_raises_not_implemented() — langchain Function Reference

Architecture documentation for the test_async_command_graph_raises_not_implemented() function in test_wrap_model_call_state_update.py from the langchain codebase.

Entity Profile

Dependency Diagram

graph TD
  978057bc_90cb_f2b7_7aa2_764f7bb38153["test_async_command_graph_raises_not_implemented()"]
  4750c4b0_13f7_74c3_9560_c6bec7226ba5["TestCommandGraphDisallowed"]
  978057bc_90cb_f2b7_7aa2_764f7bb38153 -->|defined in| 4750c4b0_13f7_74c3_9560_c6bec7226ba5
  style 978057bc_90cb_f2b7_7aa2_764f7bb38153 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

libs/langchain_v1/tests/unit_tests/agents/middleware/core/test_wrap_model_call_state_update.py lines 898–917

    async def test_async_command_graph_raises_not_implemented(self) -> None:
        """Async: Command with graph in wrap_model_call raises NotImplementedError."""

        class AsyncGraphMiddleware(AgentMiddleware):
            async def awrap_model_call(
                self,
                request: ModelRequest,
                handler: Callable[[ModelRequest], Awaitable[ModelResponse]],
            ) -> ExtendedModelResponse:
                response = await handler(request)
                return ExtendedModelResponse(
                    model_response=response,
                    command=Command(graph=Command.PARENT, update={"messages": []}),
                )

        model = GenericFakeChatModel(messages=iter([AIMessage(content="Hello!")]))
        agent = create_agent(model=model, middleware=[AsyncGraphMiddleware()])

        with pytest.raises(NotImplementedError, match="Command graph is not yet supported"):
            await agent.ainvoke({"messages": [HumanMessage(content="Hi")]})

Domain

Subdomains

Frequently Asked Questions

What does test_async_command_graph_raises_not_implemented() do?
test_async_command_graph_raises_not_implemented() is a function in the langchain codebase, defined in libs/langchain_v1/tests/unit_tests/agents/middleware/core/test_wrap_model_call_state_update.py.
Where is test_async_command_graph_raises_not_implemented() defined?
test_async_command_graph_raises_not_implemented() is defined in libs/langchain_v1/tests/unit_tests/agents/middleware/core/test_wrap_model_call_state_update.py at line 898.

Analyze Your Own Codebase

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

Try Supermodel Free