File size: 487 Bytes
b74c6ae
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
"""Shared helpers for the opt-in live evals (real model calls). conftest blanks every API key in the environment so
the normal tests never call out; these read them from the same .env files the app loads (backend first, then the
repo root)."""

from dotenv import dotenv_values

from app.config import _ROOT_ENV


def env_value(name: str) -> str:
    for path in (".env", _ROOT_ENV):
        value = dotenv_values(path).get(name)
        if value:
            return value
    return ""