def force_single_tool_call(response: ChatResponse) -> None:
    """
    Force a single tool call in the response.
    Overrides the tool calls in the response message.
    """
    tool_calls = response.message.additional_kwargs.get("tool_calls", [])
    if len(tool_calls) > 1:
        response.message.additional_kwargs["tool_calls"] = [tool_calls[0]]

    Force a single tool call in the response.
    Overrides the tool calls in the response message.
    
llama-index-integrations/llms/llama-index-llms-deepinfra/llama_index/llms/deepinfra/utils.py