test_parsed_dict_schema_async() — langchain Function Reference
Architecture documentation for the test_parsed_dict_schema_async() function in test_responses_api.py from the langchain codebase.
Entity Profile
Dependency Diagram
graph TD ce39d095_9b59_ff0d_8661_b97ab8c7d2dc["test_parsed_dict_schema_async()"] 992496d5_b7d4_139f_00cf_3e585d851f81["test_responses_api.py"] ce39d095_9b59_ff0d_8661_b97ab8c7d2dc -->|defined in| 992496d5_b7d4_139f_00cf_3e585d851f81 style ce39d095_9b59_ff0d_8661_b97ab8c7d2dc fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
libs/partners/openai/tests/integration_tests/chat_models/test_responses_api.py lines 301–318
async def test_parsed_dict_schema_async(schema: Any) -> None:
llm = ChatOpenAI(model=MODEL_NAME, use_responses_api=True)
response = await llm.ainvoke("how are ya", response_format=schema)
parsed = json.loads(response.text)
assert parsed == response.additional_kwargs["parsed"]
assert parsed["response"]
assert isinstance(parsed["response"], str)
# Test stream
full: BaseMessageChunk | None = None
async for chunk in llm.astream("how are ya", response_format=schema):
assert isinstance(chunk, AIMessageChunk)
full = chunk if full is None else full + chunk
assert isinstance(full, AIMessageChunk)
parsed = json.loads(full.text)
assert parsed == full.additional_kwargs["parsed"]
assert parsed["response"]
assert isinstance(parsed["response"], str)
Domain
Subdomains
Source
Frequently Asked Questions
What does test_parsed_dict_schema_async() do?
test_parsed_dict_schema_async() is a function in the langchain codebase, defined in libs/partners/openai/tests/integration_tests/chat_models/test_responses_api.py.
Where is test_parsed_dict_schema_async() defined?
test_parsed_dict_schema_async() is defined in libs/partners/openai/tests/integration_tests/chat_models/test_responses_api.py at line 301.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free