test_before_model_jump_on_end_behavior() — langchain Function Reference
Architecture documentation for the test_before_model_jump_on_end_behavior() function in test_openai_moderation_middleware.py from the langchain codebase.
Entity Profile
Dependency Diagram
graph TD 005bea78_20f2_b628_c98a_8909e3afe986["test_before_model_jump_on_end_behavior()"] 8b12907a_ea9d_32e0_a40a_d68cef74e4ab["test_openai_moderation_middleware.py"] 005bea78_20f2_b628_c98a_8909e3afe986 -->|defined in| 8b12907a_ea9d_32e0_a40a_d68cef74e4ab c1fe7511_88b4_fbbd_27e9_1aec3a6c7218["flagged_result()"] 005bea78_20f2_b628_c98a_8909e3afe986 -->|calls| c1fe7511_88b4_fbbd_27e9_1aec3a6c7218 84d5741d_014f_d277_d96b_4ded50bb8f87["make_state()"] 005bea78_20f2_b628_c98a_8909e3afe986 -->|calls| 84d5741d_014f_d277_d96b_4ded50bb8f87 style 005bea78_20f2_b628_c98a_8909e3afe986 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
libs/partners/openai/tests/unit_tests/middleware/test_openai_moderation_middleware.py lines 118–130
def test_before_model_jump_on_end_behavior() -> None:
middleware = StubModerationMiddleware(
{"bad": flagged_result()}, model="test", exit_behavior="end"
)
state = make_state([HumanMessage(content="bad")])
response = middleware.before_model(state, Mock())
assert response is not None
assert response["jump_to"] == "end"
ai_message = response["messages"][0]
assert isinstance(ai_message, AIMessage)
assert "flagged" in ai_message.content
Domain
Subdomains
Source
Frequently Asked Questions
What does test_before_model_jump_on_end_behavior() do?
test_before_model_jump_on_end_behavior() is a function in the langchain codebase, defined in libs/partners/openai/tests/unit_tests/middleware/test_openai_moderation_middleware.py.
Where is test_before_model_jump_on_end_behavior() defined?
test_before_model_jump_on_end_behavior() is defined in libs/partners/openai/tests/unit_tests/middleware/test_openai_moderation_middleware.py at line 118.
What does test_before_model_jump_on_end_behavior() call?
test_before_model_jump_on_end_behavior() calls 2 function(s): flagged_result, make_state.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free