Sanity Library Reference Docs
    Preparing search index...

    Variable useAgentPromptConst Alpha

    useAgentPrompt: () => (
        options: AgentPromptOptions,
    ) => Promise<AgentPromptResult> = ...

    Prompts the LLM using the same instruction template format as other actions.

    • format: 'string' or 'json' (instruction must contain the word "json" for JSON responses).
    • Optional temperature.

    Returns a stable callback that triggers the action and resolves a Promise with the prompt result.

    Type declaration