Settings (api/config.py)

agents-universe · packages/api/src/api/config.py · python · Apache-2.0
database

Loads application settings from environment variables using Pydantic for a Python API.

# Source: https://github.com/agents-universe/agents-universe | License: Apache-2.0 | Copyright You must retain, in the Source form of any Derivative Works
# Provided via justclaw.it.com; keep this notice with the code.
"""Application settings loaded from environment variables."""
from __future__ import annotations

from functools import lru_cache
from pathlib import Path
from urllib.parse import quote_plus

from pydantic_settings import BaseSettings, SettingsConfigDict

# config.py is installed at /app/src/api in Docker and lives four levels below
# the repository root during local development. Prefer a directory containing
# the bundled agent definitions, then fall back to the package parent.
def _find_project_root() -> Path:
    here = Path(__file__).resolve()
    for candidate in here.p

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key