Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
344e893
feat: Added support for InOrder and AnyOrder match in ToolTrajectoryA…
ankursharmas Nov 12, 2025
a082159
feat: Add Pydantic v2 compatibility module for OpenAPI/Swagger UI
mmphego Nov 12, 2025
6ece7d5
feat: Integrate Pydantic v2 compatibility patches into ADK web server
mmphego Nov 12, 2025
079d94c
test: Add comprehensive unit tests for Pydantic v2 compatibility module
mmphego Nov 12, 2025
b1c8878
Merge branch 'main' into fix/pydantic-v2-swagger-ui
mmphego Nov 12, 2025
890129f
Fix Pydantic v2 compatibility and address PR review feedback
mmphego Nov 12, 2025
96bd554
Merge branch 'main' into fix/pydantic-v2-swagger-ui
mmphego Nov 12, 2025
7955454
Merge branch 'main' into fix/pydantic-v2-swagger-ui
mmphego Nov 13, 2025
b5b5624
Merge branch 'main' into fix/pydantic-v2-swagger-ui
mmphego Nov 13, 2025
5ba7479
Merge branch 'main' into fix/pydantic-v2-swagger-ui
mmphego Nov 14, 2025
c7d60fb
Refactor tests for Pydantic v2 compatibility to be compartible with P…
mmphego Nov 14, 2025
c149707
Merge branch 'main' into fix/pydantic-v2-swagger-ui
mmphego Nov 14, 2025
cd1320e
Merge branch 'main' into fix/pydantic-v2-swagger-ui
mmphego Nov 15, 2025
5aa8e9f
Merge branch 'main' into fix/pydantic-v2-swagger-ui
mmphego Nov 17, 2025
9b2fd5c
Merge branch 'main' into fix/pydantic-v2-swagger-ui
mmphego Nov 20, 2025
349aae4
Merge branch 'main' into fix/pydantic-v2-swagger-ui
mmphego Nov 23, 2025
0ab8bc0
Merge branch 'main' into fix/pydantic-v2-swagger-ui
mmphego Dec 14, 2025
0de0526
Merge branch 'main' into fix/pydantic-v2-swagger-ui
mmphego Jan 22, 2026
101a92d
Merge branch 'main' into fix/pydantic-v2-swagger-ui
wuliang229 Jan 23, 2026
10da9ce
Merge branch 'main' into fix/pydantic-v2-swagger-ui
wuliang229 Jan 23, 2026
2d96c17
Merge branch 'main' into fix/pydantic-v2-swagger-ui
mmphego Jan 25, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions src/google/adk/cli/adk_web_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,8 @@
from ..sessions.base_session_service import BaseSessionService
from ..sessions.session import Session
from ..utils.context_utils import Aclosing
from ..utils.pydantic_v2_compatibility import create_robust_openapi_function
from ..utils.pydantic_v2_compatibility import patch_types_for_pydantic_v2
from .cli_eval import EVAL_SESSION_ID_PREFIX
from .utils import cleanup
from .utils import common
Expand Down Expand Up @@ -743,6 +745,13 @@ async def internal_lifespan(app: FastAPI):
tracer_provider = trace.get_tracer_provider()
register_processors(tracer_provider)

# Apply Pydantic v2 compatibility patches before creating FastAPI app
patches_applied = patch_types_for_pydantic_v2()
if patches_applied:
logger.info("Pydantic v2 compatibility patches applied successfully")
else:
logger.warning("Pydantic v2 compatibility patches could not be applied")

# Run the FastAPI server.
app = FastAPI(lifespan=internal_lifespan)

Expand All @@ -757,6 +766,12 @@ async def internal_lifespan(app: FastAPI):
allow_headers=["*"],
)

# Replace default OpenAPI function with robust version
app.openapi = create_robust_openapi_function(app)
logger.info(
"Robust OpenAPI generation enabled with Pydantic v2 error handling"
)

@app.get("/list-apps")
async def list_apps(
detailed: bool = Query(
Expand Down
Loading