import wandb
from eliciting_contexts.fluent_dreaming.system_prompt_experiments.simple_stories import (
    Config,
)


def init_wandb(config: Config):
    """Initialize Weights & Biases with config parameters"""
    wandb.init(
        project=config.wandb_project,
        entity=config.wandb_entity,
        mode=config.wandb_mode,
    )
    config_dict = {
        attr: getattr(config, attr)
        for attr in dir(config)
        if not attr.startswith("__") and not callable(getattr(config, attr))
    }
    wandb.config.update(config_dict)
