mirror of
https://github.com/affaan-m/ECC.git
synced 2026-10-17 13:45:34 +02:00
12 lines
407 B
Python
12 lines
407 B
Python
"""Model environment parsing shared by the resolver and provider adapters."""
|
|
|
|
import os
|
|
|
|
|
|
def read_model_env(name: str) -> str | None:
|
|
"""Read a model ID, treating surrounding whitespace and quotes as config syntax."""
|
|
value = os.environ.get(name, "").strip()
|
|
if len(value) >= 2 and value[0] == value[-1] and value[0] in {"'", '"'}:
|
|
value = value[1:-1].strip()
|
|
return value or None
|