Home / Function/ test_no_command() — langchain Function Reference

test_no_command() — langchain Function Reference

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

Entity Profile

Dependency Diagram

graph TD
  2601e4e9_ef96_4d5d_8aa9_c1174c00f9f7["test_no_command()"]
  39f408b3_5c60_c805_79c1_928b75d54186["TestCustomStateField"]
  2601e4e9_ef96_4d5d_8aa9_c1174c00f9f7 -->|defined in| 39f408b3_5c60_c805_79c1_928b75d54186
  style 2601e4e9_ef96_4d5d_8aa9_c1174c00f9f7 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 175–195

    def test_no_command(self) -> None:
        """ExtendedModelResponse with no command works like ModelResponse."""

        class NoCommandMiddleware(AgentMiddleware):
            def wrap_model_call(
                self,
                request: ModelRequest,
                handler: Callable[[ModelRequest], ModelResponse],
            ) -> ExtendedModelResponse:
                response = handler(request)
                return ExtendedModelResponse(
                    model_response=response,
                )

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

        result = agent.invoke({"messages": [HumanMessage("Hi")]})

        assert len(result["messages"]) == 2
        assert result["messages"][1].content == "Hello"

Domain

Subdomains

Frequently Asked Questions

What does test_no_command() do?
test_no_command() 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_no_command() defined?
test_no_command() is defined in libs/langchain_v1/tests/unit_tests/agents/middleware/core/test_wrap_model_call_state_update.py at line 175.

Analyze Your Own Codebase

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

Try Supermodel Free