test_convert_to_v1_from_responses() — langchain Function Reference
Architecture documentation for the test_convert_to_v1_from_responses() function in test_openai.py from the langchain codebase.
Entity Profile
Dependency Diagram
graph TD 06fece17_256f_3205_abe9_d9ea0c7d2f4b["test_convert_to_v1_from_responses()"] 71a6a26a_d6f8_432f_996a_21e56fcab4ae["test_openai.py"] 06fece17_256f_3205_abe9_d9ea0c7d2f4b -->|defined in| 71a6a26a_d6f8_432f_996a_21e56fcab4ae style 06fece17_256f_3205_abe9_d9ea0c7d2f4b fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
libs/core/tests/unit_tests/messages/block_translators/test_openai.py lines 13–131
def test_convert_to_v1_from_responses() -> None:
message = AIMessage(
[
{"type": "reasoning", "id": "abc123", "summary": []},
{
"type": "reasoning",
"id": "abc234",
"summary": [
{"type": "summary_text", "text": "foo bar"},
{"type": "summary_text", "text": "baz"},
],
},
{
"type": "function_call",
"call_id": "call_123",
"name": "get_weather",
"arguments": '{"location": "San Francisco"}',
},
{
"type": "function_call",
"call_id": "call_234",
"name": "get_weather_2",
"arguments": '{"location": "New York"}',
"id": "fc_123",
},
{"type": "text", "text": "Hello "},
{
"type": "text",
"text": "world",
"annotations": [
{"type": "url_citation", "url": "https://example.com"},
{
"type": "file_citation",
"filename": "my doc",
"index": 1,
"file_id": "file_123",
},
{"bar": "baz"},
],
},
{"type": "image_generation_call", "id": "ig_123", "result": "..."},
{
"type": "file_search_call",
"id": "fs_123",
"queries": ["query for file search"],
"results": [{"file_id": "file-123"}],
"status": "completed",
},
{"type": "something_else", "foo": "bar"},
],
tool_calls=[
{
"type": "tool_call",
"id": "call_123",
"name": "get_weather",
"args": {"location": "San Francisco"},
},
{
"type": "tool_call",
"id": "call_234",
"name": "get_weather_2",
"args": {"location": "New York"},
},
],
response_metadata={"model_provider": "openai"},
)
expected_content: list[types.ContentBlock] = [
{"type": "reasoning", "id": "abc123"},
{"type": "reasoning", "id": "abc234", "reasoning": "foo bar"},
{"type": "reasoning", "id": "abc234", "reasoning": "baz"},
{
"type": "tool_call",
"id": "call_123",
"name": "get_weather",
"args": {"location": "San Francisco"},
},
{
"type": "tool_call",
"id": "call_234",
"name": "get_weather_2",
"args": {"location": "New York"},
Domain
Subdomains
Source
Frequently Asked Questions
What does test_convert_to_v1_from_responses() do?
test_convert_to_v1_from_responses() is a function in the langchain codebase, defined in libs/core/tests/unit_tests/messages/block_translators/test_openai.py.
Where is test_convert_to_v1_from_responses() defined?
test_convert_to_v1_from_responses() is defined in libs/core/tests/unit_tests/messages/block_translators/test_openai.py at line 13.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free