server.handler_kwargs

Page actions AI-ready formats and sharing
Open LLM text
Share with AI
Ask Claude Ask ChatGPT Ask Gemini Ask Copilot

Handler kwargs building — path params, providers, body extraction.

Handler kwargs building — path params, providers, body extraction.

server.handler_kwargs

Name Type Default Description
type
qualified_name
element_type
description
source_file
line_number
is_autodoc
autodoc_element
_autodoc_template
_autodoc_url_path
_autodoc_page_type
title
doc_content_hash

Symbols on this page

build_handler_kwargs
function
def build_handler_kwargs(handler: Callable[..., Any], request: Request, path_params: dict[str, str], providers: dict[type, Callable[..., Any]] | None = None, *, body_data: dict[str, Any] | None = None, invoke_plan: InvokePlan | None = None) -> dict[str, Any]

Build kwargs from request + path params using compiled plan or inspection.

When invoke_plan is present, uses the precomputed plan (no inspect per request). Falls back to _build_handler_kwargs_inspect for routes without a plan.

Parameters

Name Type Default Description
handler Callable[..., Any]
request Request
path_params dict[str, str]
providers dict[type, Callable[..., Any]] | None None
body_data dict[str, Any] | None None
invoke_plan InvokePlan | None None
_build_handler_kwargs_from_plan
function
def _build_handler_kwargs_from_plan(request: Request, path_params: dict[str, str], providers: dict[type, Callable[..., Any]] | None, body_data: dict[str, Any] | None, plan: InvokePlan) -> dict[str, Any]

Build kwargs using compiled InvokePlan — allocation-light fast path.

Parameters

Name Type Default Description
request Request
path_params dict[str, str]
providers dict[type, Callable[..., Any]] | None
body_data dict[str, Any] | None
plan InvokePlan
_build_handler_kwargs_inspect
function
def _build_handler_kwargs_inspect(handler: Callable[..., Any], request: Request, path_params: dict[str, str], providers: dict[type, Callable[..., Any]] | None, body_data: dict[str, Any] | None) -> dict[str, Any]

Fallback: inspect handler signature and build kwargs (used when no plan).

Parameters

Name Type Default Description
handler Callable[..., Any]
request Request
path_params dict[str, str]
providers dict[type, Callable[..., Any]] | None
body_data dict[str, Any] | None

View source · /home/runner/work/chirp/chirp/site/../src/chirp/server/handler_kwargs.py:1