Use /search/stream as the single entry for both fast and deep modes via request params, suppress COT events in fast mode while keeping deep COT, and return 410 for deprecated /search. Made-with: Cursor
21 lines
654 B
Python
21 lines
654 B
Python
from __future__ import annotations
|
|
|
|
import azure.functions as func
|
|
from starlette.applications import Starlette
|
|
from starlette.routing import Mount
|
|
|
|
from ai_search_agent.api import create_app
|
|
|
|
_fastapi = create_app()
|
|
|
|
# Azure Functions delivers the full path including /api/ prefix to the ASGI app.
|
|
# Mount FastAPI under /api so that /api/health -> FastAPI /health, etc.
|
|
_root = Starlette(routes=[Mount("/api", app=_fastapi)])
|
|
|
|
app = func.FunctionApp(http_auth_level=func.AuthLevel.ANONYMOUS)
|
|
|
|
|
|
@app.route(route="{*route}")
|
|
async def asgi_handler(req: func.HttpRequest) -> func.HttpResponse:
|
|
return await func.AsgiMiddleware(_root).handle_async(req)
|