Template Tags

Django template tags for the Prompt Passthrough app.

smarter.apps.dashboard.templatetags.react_prompt_passthrough.prompt_passthrough_react_assets()[source]

Load CSS and JS files for a React app entry point based on its manifest.json.

Example output:

.. code-block:: json

    {
        "js": [
            "assets/index-CZK_Bxxh.js",
            "assets/rolldown-runtime-B3igc2qu.js",
            "assets/xterm-D5XSfLrr.js"
        ],
        "css": [
            "assets/index-58MXwt-L.css",
            "assets/xterm-kHJ-D0s7.css"
        ]
    }
Return type:

AssetDict

smarter.apps.dashboard.templatetags.react_prompt_passthrough.templatetag_manager = <smarter.lib.django.templatetags.smarter_react_templatetag_manager.SmarterReactTemplateTagManager object>

Manages integration of Vite-built React assets into Django templates. Expects to find a Vite-generated manifest.json in the file path static/react/@smarter/prompt-passthrough/.

Example manifest.json structure:

{
    "index.html": {
        "file": "assets/index-D6-GPOR-.js",
        "name": "index",
        "src": "index.html",
        "isEntry": true,
        "css": [
        "assets/index-B011HLqe.css"
        ]
}
    }