from flask import Blueprint, jsonify

from semantic_models.config import get_app_config

bp = Blueprint("config", __name__, url_prefix="/api")

APP_VERSION = "0.1.0"


@bp.route("/config", methods=["GET"])
def get_config():
    config = get_app_config()
    return jsonify(
        {
            "version": APP_VERSION,
            "project_key": config.dss_project_key,
            "semantic_model_id": config.semantic_model_id,
            "max_rows_per_query": config.max_rows_per_query,
            "agent_recursion_limit": config.agent_recursion_limit,
            "sources_records_limit": config.sources_records_limit,
            "artifacts_records_limit": config.artifacts_records_limit,
        }
    )
