def assemble_sql_body(
    catalog: str,
    schema: str,
    func_name: str,
    sql_params: list[str],
    sql_return_type: str,
    func_comment: str,
    indented_body: str,
    replace: bool,
    dependencies: Optional[list[str]] = None,
    environment_version: str = "None",
) -> str:
    """
    Assembles the final SQL function body.

    Constructs the SQL statement for creating or replacing a function in Unity Catalog.

    Args:
        catalog: The catalog name.
        schema: The schema name.
        func_name: The name of the function.
        sql_params: List of SQL parameter definitions.
        sql_return_type: The SQL return type of the function.
        func_comment: Comment describing the function.
        indented_body: The indented body of the Python function.
        replace: Whether to include the 'OR REPLACE' clause.
        dependencies: An optional list of PyPI dependencies for the function to utilize in the execution environment
        environment_version: The version of the environment to use for the function. Defaults to "None".

    Returns:
        The assembled SQL function creation statement.
    """

    replace_command = "CREATE OR REPLACE" if replace else "CREATE"
    """Assembles the final SQL function body."""
    sql_params_str = ", ".join(sql_params)
    environment_str = construct_dependency_statement(dependencies, environment_version)
    sql_body = f"""
{replace_command} FUNCTION `{catalog}`.`{schema}`.`{func_name}`({sql_params_str})
RETURNS {sql_return_type}
LANGUAGE PYTHON{environment_str}
COMMENT '{func_comment}'
AS $$
{indented_body}
$$;
    """
    return sql_body

    Assembles the final SQL function body.

    Constructs the SQL statement for creating or replacing a function in Unity Catalog.

    Args:
        catalog: The catalog name.
        schema: The schema name.
        func_name: The name of the function.
        sql_params: List of SQL parameter definitions.
        sql_return_type: The SQL return type of the function.
        func_comment: Comment describing the function.
        indented_body: The indented body of the Python function.
        replace: Whether to include the 'OR REPLACE' clause.
        dependencies: An optional list of PyPI dependencies for the function to utilize in the execution environment
        environment_version: The version of the environment to use for the function. Defaults to "None".

    Returns:
        The assembled SQL function creation statement.
    
ai/core/src/unitycatalog/ai/core/utils/callable_utils.py