test_prompt_cache_key_parameter_exclusion() — langchain Function Reference
Architecture documentation for the test_prompt_cache_key_parameter_exclusion() function in test_prompt_cache_key.py from the langchain codebase.
Entity Profile
Dependency Diagram
graph TD 0a17b104_7c48_4a4b_1400_793e296fd265["test_prompt_cache_key_parameter_exclusion()"] adfe4542_d9fc_113e_aad7_23a86789157a["test_prompt_cache_key.py"] 0a17b104_7c48_4a4b_1400_793e296fd265 -->|defined in| adfe4542_d9fc_113e_aad7_23a86789157a style 0a17b104_7c48_4a4b_1400_793e296fd265 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
libs/partners/openai/tests/unit_tests/chat_models/test_prompt_cache_key.py lines 18–26
def test_prompt_cache_key_parameter_exclusion() -> None:
"""Test that prompt_cache_key parameter behavior matches OpenAI API."""
chat = ChatOpenAI(model="gpt-4o-mini", max_completion_tokens=10)
messages = [HumanMessage("Hello")]
# Test with explicit None (OpenAI should accept None values (marked Optional))
payload = chat._get_request_payload(messages, prompt_cache_key=None)
assert "prompt_cache_key" in payload
assert payload["prompt_cache_key"] is None
Domain
Subdomains
Source
Frequently Asked Questions
What does test_prompt_cache_key_parameter_exclusion() do?
test_prompt_cache_key_parameter_exclusion() is a function in the langchain codebase, defined in libs/partners/openai/tests/unit_tests/chat_models/test_prompt_cache_key.py.
Where is test_prompt_cache_key_parameter_exclusion() defined?
test_prompt_cache_key_parameter_exclusion() is defined in libs/partners/openai/tests/unit_tests/chat_models/test_prompt_cache_key.py at line 18.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free