Use @app.task to expose Python functions to the frontend.
In Davia, a task is a Python function that becomes available from the frontend.
You define the logic in Python — and Davia takes care of generating the UI: input fields, buttons, and result areas.
This is the main way to let users interact with your backend: they can trigger actions, pass data, and get responses, without you writing a single line of frontend code.
To create a task, use the @app.task
decorator. Davia will generate a UI based on the function’s inputs and output type.
When you run this file, Davia will open the editor at:
Davia is built on top of FastAPI. When you create your app with app = Davia()
, you are actually creating a FastAPI application. This means you can use all FastAPI features and add your own endpoints alongside Davia tasks.
Follow these essential guidelines to ensure your Davia tasks are robust, maintainable, and user-friendly:
action_
for operations that take inputs, and display_
for those that simply show information. This makes your codebase easier to navigate and your UI more intuitive.If you want to extend your app with custom endpoints or advanced features, see the FastAPI documentation.
Use @app.task to expose Python functions to the frontend.
In Davia, a task is a Python function that becomes available from the frontend.
You define the logic in Python — and Davia takes care of generating the UI: input fields, buttons, and result areas.
This is the main way to let users interact with your backend: they can trigger actions, pass data, and get responses, without you writing a single line of frontend code.
To create a task, use the @app.task
decorator. Davia will generate a UI based on the function’s inputs and output type.
When you run this file, Davia will open the editor at:
Davia is built on top of FastAPI. When you create your app with app = Davia()
, you are actually creating a FastAPI application. This means you can use all FastAPI features and add your own endpoints alongside Davia tasks.
Follow these essential guidelines to ensure your Davia tasks are robust, maintainable, and user-friendly:
action_
for operations that take inputs, and display_
for those that simply show information. This makes your codebase easier to navigate and your UI more intuitive.If you want to extend your app with custom endpoints or advanced features, see the FastAPI documentation.