test_prompt_cache_key_usage_methods_integration() — langchain Function Reference
Architecture documentation for the test_prompt_cache_key_usage_methods_integration() function in test_base.py from the langchain codebase.
Entity Profile
Dependency Diagram
graph TD fe54f13b_7861_8b43_39dd_c500bee6f557["test_prompt_cache_key_usage_methods_integration()"] bd382a4e_442c_13ae_530c_6e34bc43623d["test_base.py"] fe54f13b_7861_8b43_39dd_c500bee6f557 -->|defined in| bd382a4e_442c_13ae_530c_6e34bc43623d style fe54f13b_7861_8b43_39dd_c500bee6f557 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
libs/partners/openai/tests/integration_tests/chat_models/test_base.py lines 1197–1215
def test_prompt_cache_key_usage_methods_integration() -> None:
"""Integration test for `prompt_cache_key` usage methods."""
messages = [HumanMessage("Say hi")]
# Test keyword argument method
chat = ChatOpenAI(model="gpt-5-nano", max_completion_tokens=10)
response = chat.invoke(messages, prompt_cache_key="integration-test-v1")
assert isinstance(response, AIMessage)
assert isinstance(response.content, str)
# Test model-level via model_kwargs
chat_model_level = ChatOpenAI(
model="gpt-5-nano",
max_completion_tokens=10,
model_kwargs={"prompt_cache_key": "integration-model-level-v1"},
)
response_model_level = chat_model_level.invoke(messages)
assert isinstance(response_model_level, AIMessage)
assert isinstance(response_model_level.content, str)
Domain
Subdomains
Source
Frequently Asked Questions
What does test_prompt_cache_key_usage_methods_integration() do?
test_prompt_cache_key_usage_methods_integration() is a function in the langchain codebase, defined in libs/partners/openai/tests/integration_tests/chat_models/test_base.py.
Where is test_prompt_cache_key_usage_methods_integration() defined?
test_prompt_cache_key_usage_methods_integration() is defined in libs/partners/openai/tests/integration_tests/chat_models/test_base.py at line 1197.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free