async def acreate_chat_completion_once(
        messages: list,  # type: ignore
        model: str | None = None,
        temperature: float = CFG.temperature,
        max_tokens: int | None = None,
        deployment_id=None,
        request_timeout=40,
        **kwargs
) -> str:
    """
    Create a chat completion and update the cost.
    Args:
    messages (list): The list of messages to send to the API.
    model (str): The model to use for the API call.
    temperature (float): The temperature to use for the API call.
    max_tokens (int): The maximum number of tokens for the API call.
    Returns:
    str: The AI's response.
    """
    if deployment_id is not None:
        response = await openai.ChatCompletion.acreate(
            deployment_id=deployment_id,
            model=model,
            messages=messages,
            temperature=temperature,
            max_tokens=max_tokens,
            request_timeout=request_timeout,
            **kwargs
        )
    else:
        response = await openai.ChatCompletion.acreate(
            model=model,
            messages=messages,
            temperature=temperature,
            max_tokens=max_tokens,
            request_timeout=request_timeout,
            **kwargs
        )
    if CFG.debug_mode:
        logger.debug(f"Response: {response}")
    # prompt_tokens = response.usage.prompt_tokens
    # completion_tokens = response.usage.completion_tokens
    return response

    Create a chat completion and update the cost.
    Args:
    messages (list): The list of messages to send to the API.
    model (str): The model to use for the API call.
    temperature (float): The temperature to use for the API call.
    max_tokens (int): The maximum number of tokens for the API call.
    Returns:
    str: The AI's response.
    
PoC/agent_jarvis/jarvis/gpt/gpt.py