pages.actions

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

Action discovery and dispatch for _actions.py.

Discovers @action decorated functions and dispatches by _action form field.

Action discovery and dispatch for _actions.py.

Discovers @action decorated functions and dispatches by _action form field.

pages.actions

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

action
function
def action(name: str) -> Callable[[Callable[..., Any]], Callable[..., Any]]

Decorator to register a named action in _actions.py.

The action name is used as the value for the _action form field.

Parameters

Name Type Default Description
name str —
load_actions
function
def load_actions(actions_module: Any) -> tuple[ActionInfo, ...]

Load ActionInfo from a module with @action decorated functions.

Parameters

Name Type Default Description
actions_module Any —
dispatch_action
function async
async def dispatch_action(action_info: ActionInfo, path_params: dict[str, str], cascade_ctx: dict[str, Any], service_providers: dict[type, Any], form_data: dict[str, Any] | None = None, *, request: Request | None = None) -> Any

Invoke an action with path params, context, and services.

Resolves handler kwargs same as context providers. Returns the action's return value (may be Redirect, Fragment, OOB, etc.).

Parameters

Name Type Default Description
action_info ActionInfo —
path_params dict[str, str] —
cascade_ctx dict[str, Any] —
service_providers dict[type, Any] —
form_data dict[str, Any] | None None
request Request | None None
_resolve_action_kwargs
function
def _resolve_action_kwargs(func: Any, path_params: dict[str, str], cascade_ctx: dict[str, Any], service_providers: dict[type, Any], form_data: dict[str, Any], *, request: Request | None = None) -> dict[str, Any]

Resolve kwargs for action function (same pattern as _call_provider).

Parameters

Name Type Default Description
func Any —
path_params dict[str, str] —
cascade_ctx dict[str, Any] —
service_providers dict[type, Any] —
form_data dict[str, Any] —
request Request | None None

View source · /home/runner/work/chirp/chirp/site/../src/chirp/pages/actions.py:1