def _create_azure_openai_client():
    """Helper function to create an Azure OpenAI client."""
    azure_endpoint = Configuration.get("AZURE_OPENAI_ENDPOINT")
    azure_api_version = Configuration.get("AZURE_OPENAI_API_VERSION")
    azure_api_key = Configuration.get("AZURE_OPENAI_API_KEY")

    missing_keys = []
    if not azure_endpoint:
        missing_keys.append("AZURE_OPENAI_ENDPOINT")
    if not azure_api_version:
        missing_keys.append("AZURE_OPENAI_API_VERSION")
    if not azure_api_key:
        missing_keys.append("AZURE_OPENAI_API_KEY")

    if missing_keys:
        return None, {
            "status_code": 401,
            "detail": f"No API key provided. Please set {', '.join(missing_keys)} in your configuration."
        }

    client = AsyncAzureOpenAI(
        api_version=azure_api_version, 
        azure_endpoint=azure_endpoint, 
        api_key=azure_api_key
    )
    return client, None
Helper function to create an Azure OpenAI client.
src/upsonic/server/level_utilized/utility.py