YAML Configuration¶
YAML files provide a clean, readable way to configure Sentimatrix.
Basic Structure¶
sentimatrix.yaml
# LLM Provider
llm:
provider: groq
model: llama-3.3-70b-versatile
temperature: 0.7
# Scraping
scrapers:
provider: playwright
headless: true
# ML Models
models:
sentiment_model: cardiffnlp/twitter-roberta-base-sentiment-latest
device: auto
# Caching
cache:
enabled: true
backend: memory
Loading YAML¶
from sentimatrix.config import SentimatrixConfig
# From specific file
config = SentimatrixConfig.from_file("config.yaml")
# With overrides
config = SentimatrixConfig.from_file("config.yaml", debug=True)
File Locations¶
Sentimatrix searches for config files in order:
- Explicit path provided
sentimatrix.yamlin current directoryconfig/sentimatrix.yaml~/.sentimatrix/config.yaml
JSON Support¶
JSON files also supported: