AIEngineering_01 / utils /state_utils.py
suh4s
Clean up repository, update docs & Dockerfile, ready for publish
3c2e3e7
raw
history blame contribute delete
422 Bytes
# Utility functions for InsightFlow AI state management
from typing import Dict, Any
def toggle_direct_mode(state: Dict[str, Any]) -> None:
"""Toggles the 'direct_mode' boolean in the given state dictionary."""
if 'direct_mode' not in state:
state['direct_mode'] = True # Initialize if not present, defaulting to True after first toggle
else:
state['direct_mode'] = not state['direct_mode']