def test_update_tool_calls_empty_list():
    """Test updating an empty tool_calls list with a new delta."""
    tool_calls = []
    delta = ChatCompletionDeltaToolCall(
        index=0,
        id="call_123",
        type="function",
        function={"name": "test_function", "arguments": ""},
    )

    # Update and verify a new tool call is added
    result = update_tool_calls(tool_calls, [delta])
    assert len(result) == 1
    assert result[0]["id"] == "call_123"
    assert result[0]["type"] == "function"
    assert result[0]["function"]["name"] == "test_function"
Test updating an empty tool_calls list with a new delta.
llama-index-integrations/llms/llama-index-llms-litellm/tests/test_utils.py