For AI agents: the complete documentation index is available at /next/llms.txt, the full documentation bundle is available at /next/llms-full.txt, and this page is available as Markdown at /next/api/genui/a2ui/functions/useAction.md.
Lynx
  • English
  • Function: useAction()

    useAction(props: ActionProps): object

    Create a sendAction callback that resolves dynamic action payload values and dispatches user events or function calls through the current processor.

    Parameters

    ParameterType
    propsActionProps

    Returns

    object

    sendAction

    sendAction: (action: { event: { context?: Record<string, string | number | boolean | any[] | { path: string; } | { args: Record<string, any>; call: string; returnType: "string" | "number" | "boolean" | "object" | "array" | "void" | "any"; }>; name: string; }; } | { functionCall: { args: Record<string, any>; call: string; returnType: "string" | "number" | "boolean" | "object" | "array" | "void" | "any"; }; }) => Promise<unknown>

    Parameters

    ParameterType
    action{ event: { context?: Record<string, string | number | boolean | any[] | { path: string; } | { args: Record<string, any>; call: string; returnType: "string" | "number" | "boolean" | "object" | "array" | "void" | "any"; }>; name: string; }; } | { functionCall: { args: Record<string, any>; call: string; returnType: "string" | "number" | "boolean" | "object" | "array" | "void" | "any"; }; }

    Returns

    Promise<unknown>

    Except as otherwise noted, this work is licensed under a Creative Commons Attribution 4.0 International License, and code samples are licensed under the Apache License 2.0.