Setup
State Management
State management in Davia allows you to maintain application state across different tasks and function calls. This documentation explains how to effectively use state in your Davia applications.
Overview
State management in Davia provides a clean way to work with persistent data using Python’s type annotations. By leveraging the Annotated
type and State
class, you can easily access and modify state between different tasks.
Working with State
Initializing State
Initialize state during app creation:
Accessing State
Davia provides two ways to access state:
Method 1: Using Annotated Type
Method 2: Accessing Complete State
Modifying State
State modifications are applied directly to the parameter:
Supported State Types
Davia supports:
- Pandas DataFrames
- Dictionaries
- Lists
- Custom objects
- Primitive types (within a container)