Home / Function/ custom_openapi() — langchain Function Reference

custom_openapi() — langchain Function Reference

Architecture documentation for the custom_openapi() function in server.py from the langchain codebase.

Entity Profile

Dependency Diagram

graph TD
  4e324386_686a_0d0d_2a28_ede8ddda0060["custom_openapi()"]
  91e9eb65_99fe_4463_ea22_add75adcc13a["server.py"]
  4e324386_686a_0d0d_2a28_ede8ddda0060 -->|defined in| 91e9eb65_99fe_4463_ea22_add75adcc13a
  style 4e324386_686a_0d0d_2a28_ede8ddda0060 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

libs/langchain/tests/mock_servers/robot/server.py lines 183–198

def custom_openapi() -> dict[str, Any]:
    """Add servers configuration to the OpenAPI schema."""
    if app.openapi_schema:
        return app.openapi_schema

    openapi_schema = get_openapi(
        title="Android Robot API",
        version="1.0.0",
        description="This is an Android Robot API with different"
        " endpoints for robot operations",
        routes=app.routes,
    )
    # Add servers configuration to the OpenAPI schema
    openapi_schema["servers"] = [{"url": f"http://localhost:{PORT}"}]
    app.openapi_schema = openapi_schema
    return app.openapi_schema

Domain

Subdomains

Frequently Asked Questions

What does custom_openapi() do?
custom_openapi() is a function in the langchain codebase, defined in libs/langchain/tests/mock_servers/robot/server.py.
Where is custom_openapi() defined?
custom_openapi() is defined in libs/langchain/tests/mock_servers/robot/server.py at line 183.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free