test_parsed_pydantic_schema() — langchain Function Reference
Architecture documentation for the test_parsed_pydantic_schema() function in test_responses_api.py from the langchain codebase.
Entity Profile
Dependency Diagram
graph TD 38ec3ffb_8251_4e42_1f4d_eb090e1cdf84["test_parsed_pydantic_schema()"] 992496d5_b7d4_139f_00cf_3e585d851f81["test_responses_api.py"] 38ec3ffb_8251_4e42_1f4d_eb090e1cdf84 -->|defined in| 992496d5_b7d4_139f_00cf_3e585d851f81 style 38ec3ffb_8251_4e42_1f4d_eb090e1cdf84 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
libs/partners/openai/tests/integration_tests/chat_models/test_responses_api.py lines 206–225
def test_parsed_pydantic_schema(
output_version: Literal["v0", "responses/v1", "v1"],
) -> None:
llm = ChatOpenAI(
model=MODEL_NAME, use_responses_api=True, output_version=output_version
)
response = llm.invoke("how are ya", response_format=Foo)
parsed = Foo(**json.loads(response.text))
assert parsed == response.additional_kwargs["parsed"]
assert parsed.response
# Test stream
full: BaseMessageChunk | None = None
for chunk in llm.stream("how are ya", response_format=Foo):
assert isinstance(chunk, AIMessageChunk)
full = chunk if full is None else full + chunk
assert isinstance(full, AIMessageChunk)
parsed = Foo(**json.loads(full.text))
assert parsed == full.additional_kwargs["parsed"]
assert parsed.response
Domain
Subdomains
Source
Frequently Asked Questions
What does test_parsed_pydantic_schema() do?
test_parsed_pydantic_schema() 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_pydantic_schema() defined?
test_parsed_pydantic_schema() is defined in libs/partners/openai/tests/integration_tests/chat_models/test_responses_api.py at line 206.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free