test_convert_to_json_schema() — langchain Function Reference
Architecture documentation for the test_convert_to_json_schema() function in test_function_calling.py from the langchain codebase.
Entity Profile
Dependency Diagram
graph TD 1f1e598a_787f_9e59_a77c_b86bed6e5961["test_convert_to_json_schema()"] 6f1e8e6f_d3f9_e590_b17e_1dc8afafdbe0["test_function_calling.py"] 1f1e598a_787f_9e59_a77c_b86bed6e5961 -->|defined in| 6f1e8e6f_d3f9_e590_b17e_1dc8afafdbe0 style 1f1e598a_787f_9e59_a77c_b86bed6e5961 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
libs/core/tests/unit_tests/utils/test_function_calling.py lines 1080–1120
def test_convert_to_json_schema(
pydantic: type[BaseModel],
function: Callable,
function_docstring_annotations: Callable,
dummy_structured_tool: StructuredTool,
dummy_structured_tool_args_schema_dict: StructuredTool,
dummy_tool: BaseTool,
json_schema: dict,
anthropic_tool: dict,
bedrock_converse_tool: dict,
annotated_function: Callable,
dummy_pydantic: type[BaseModel],
dummy_typing_typed_dict: type,
dummy_typing_typed_dict_docstring: type,
dummy_extensions_typed_dict: type,
dummy_extensions_typed_dict_docstring: type,
) -> None:
expected = json_schema
for fn in (
pydantic,
function,
function_docstring_annotations,
dummy_structured_tool,
dummy_structured_tool_args_schema_dict,
dummy_tool,
json_schema,
anthropic_tool,
bedrock_converse_tool,
expected,
Dummy.dummy_function,
DummyWithClassMethod.dummy_function,
annotated_function,
dummy_pydantic,
dummy_typing_typed_dict,
dummy_typing_typed_dict_docstring,
dummy_extensions_typed_dict,
dummy_extensions_typed_dict_docstring,
):
actual = convert_to_json_schema(fn)
assert actual == expected
Domain
Subdomains
Source
Frequently Asked Questions
What does test_convert_to_json_schema() do?
test_convert_to_json_schema() is a function in the langchain codebase, defined in libs/core/tests/unit_tests/utils/test_function_calling.py.
Where is test_convert_to_json_schema() defined?
test_convert_to_json_schema() is defined in libs/core/tests/unit_tests/utils/test_function_calling.py at line 1080.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free