I must admit, I have been somewhat circumspect to what impact applications like ChatGPT would have on my work and life. I am not going to deny the potential, but there are too many stories that make me wonder, such as John Johnston’s chat with Bing. Really, I have had enough trouble handing over some of my work to colleagues, I therefore cannot see my work disappearing anytime soon, even if I were to somehow hand it over to a chatbox.
However, one area that I have found it interesting to explore is the ability to learn with the support of a chatbot. This is a use that I have seen come up in my feed. For example, Ben Collins talks about using AI tools to create formulas:
The AI tools can create formulas for you too.
ChatGPT and Bard generally give correct answers for simple formulas but it’s hit-and-miss with more complex formula asks.
Again, it pays to be as specific as possible with your prompt.
Source: What AI Can Do For You As A Google Sheets User. Is The Hype Justified? by Ben Collins
While Doug Belshaw has reflected on using AI tools to improve code:
I’ll not go into too much detail, but I wanted to replicate the style of my main archives page which is generated using the Simple Yearly Archive plugin. I duplicated archive.php in my themes folder, renamed it category.php and then tinkered around with it. ChatGPT was excellent at giving me the code I needed to do the things I wanted, including for the category RSS feed.
Source: Tinkering with WordPress category archive pages by Doug Belshaw
Through my work Microsoft account, I discovered I have access to Bing’s Co-Pilot chatbot based on OpenAI’s GPT-4. I have therefore been tinkering with this a bit. In particular, I have been using this when I have a question about creating a formula or script. For example, today I asked for a PowerShell script to change the naming format of a group of files. I began by asking:
How do I use PowerShell to swap around parts of multiple file names each split with an “”? For example, the current format is 12343_FirstName_Surname.pdf but I want it to be 12343_Surname_FirstName.pdf
Bing came back with a formula that spoke about moving around the different parts split into an array and move the elements around, however it did not account for the ‘.pdf’ ending. So I asked the following:
Using PowerShell, How do I split a file name into an array using _, but exclude the ending .pdf
It then added the missing lines associated with removing the .pdf ending at the start of the process and then adding it back at the end.
See the final script below.
# Set the current directory
$directory = "xxx"
# Get all files in the directory
$files = Get-ChildItem -Path $directory
# Loop through each file
foreach ($file in $files) {
# Remove the .pdf extension from the file name
$fileNameWithoutExtension = $file.Name.Substring(0, $file.Name.Length - 4)
# Split the file name into an array using the underscore as a delimiter
$fileParts = $fileNameWithoutExtension.Split("_")
# Swap the first and last elements of the array
$fileParts[0], $fileParts[1], $fileParts[2] = $fileParts[2], $fileParts[0], $fileParts[1]
# Join the array back into a string using the underscore as a delimiter
$newFileName = $fileParts -join "_"
# Add the file extension to the new file name
$newFileName = "$newFileName.pdf"
# Rename the file with the new file name
Rename-Item -Path $file.FullName -NewName $newFileName
}
What I have found is that although I often get an answer, it is not always the final answer or correct for that matter. This was the case when after I recently exported all my links from Diigo and asked Bing for a Google Sheets formula to check which URLs sent back a 404 and which didn’t. Co-Pilot gave me back the following formula:
=IF(HTTPResponse(A1)=404,"404 Error","No Error")
I tried this in Google Sheets only to get the error:
Unknown function: ‘HTTPResponse’.
I then asked Bing, “What is the HTTPResponse function in Google Sheets?” To which Bing responded that there was no function ‘HTTPResponse’ built-in, but that I could use UrlFetchApp.fetch
in Google Apps Script to create a custom function. It then also provided links to a number of sources which I followed, finding Adham El Banhawy’s guide the most helpful. Ironically, I then got an error in trying to run the custom script, which I raised in Co-Pilot, and was given a fix.
function getStatusCode(url) {
if (url === undefined || url === null) {
return null;
}
var url_trimmed = url.trim();
// Check if script cache has a cached status code for the given url
var cache = CacheService.getScriptCache();
var result = cache.get(url_trimmed);
// If value is not in cache/or cache is expired fetch a new request to the url
if (!result) {
var options = {
'muteHttpExceptions': true,
'followRedirects': false
};
var response = UrlFetchApp.fetch(url_trimmed, options);
var responseCode = response.getResponseCode();
// Store the response code for the url in script cache for subsequent retrievals
cache.put(url_trimmed, responseCode, 21600); // cache maximum storage duration is 6 hours
result = responseCode;
}
return result;
}
In each of my experiences of CoPilot, I have had to make adjustments to the code provided. A part of this is actually learning what is happening. However, this may well be the questions that I asked:
Source: How to write better ChatGPT prompts for the best generative AI results – David Gewirtz, ZDNet, Oct 12, 2023 Commentary by Stephen Downes
- talk to it as if it were a person
- set the stage and provide context
- have the AI assume an identity or profession
- iterate with multiple attempts
- keep it on track
- specify output format
- explicit constraints on responses
Or it may well be the trial and error
. The thought that I am left with is a comment a few months back that questioned if we have to learn what prompts to use with AI tools, how intelligent are they? I With this in mind, for me I feel that AI tools are useful as an aide, but I am circumspect about using them as the answer. I guess time will tell.As always, comments and webmentions welcome.
Aide or Answer – Learning with Artificial Intelligence by Aaron Davis is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.
I really enjoyed how you broke down the different uses for AI in this post Ben. Personally, I have found myself using Co-Pilot to come up with formulas as this is what I currently have access to. For me, I often have an idea of what is possible, but do not always have the time or mental space to dig into the formulas to find the right solution. I have found it useful then to just ask Bing. I am now finding myself teaching colleagues how to use prompts to not only find a solution, but have it explained for them.
Helen Beetham follows up here keynote to the Association for Learning Technologies (ALT) winter summit on AI and ethics, unpacking a few questions that were raised. The two points that stood out to me were that rather than teaching ‘prompt engineering‘, we need to update search skills in a part-AI world:
Source: Whose Ethics? Whose AI? by Helen Beetham
And that rather than inviting cynicism regarding the use of various tools to write essays, opportunities need to be found to talk to students about what agency they have to shape their own futures.
ᔥ “Stephen Downes” in Downes.ca ~ Stephen’s Web ~ Whose ethics? Whose AI? ()
Losing the Imitation Game/ by Jennifer Moore
—
Jennifer Moore goes beyond the hype around so-called artificial intelligence to explain why LLMs are not the answer when it comes to developing software. The particular problem is that although they maybe able to provide snippets of code, they do not necessarily know, or understand, or comprehend anything about that data. They cannot do the heavy lifting associated with mental models. This can only be done by doing.
Losing the Imitation Game by Jennifer Moore
For me, this takes me back to a post from Richard Olsen, in which he explains why coding is so important in schools.
A Response to @Richardolsen on Coding by Aaron Davis
Olsen’s post is one of those gifts of learning that comes up for me again and again, and is a reminder of the opportunities associated with connected learning.
This all has me wondering about the debate around prompt engineering and how that may miss the point.
ᔥ “Doug Belshaw” in Language is probably less than you think it is | Thought Shrapnel (03/09/2024 06:38:53)
I do not use Highlights with Pocket as I was not sure how they would fit with my workflow. However, after finding this bookmarklet from Phil Newton, I am thinking that maybe I could.
to_clipboard = "#+TITLE: " + document.getElementsByTagName('h1')[0].innerHTML + "nn";
all_highlights = document.getElementsByClassName('highlight');
for (highlight in all_highlights) {
highlight_text = all_highlights[highlight].innerHTML;
if (typeof highlight_text !== 'undefined' && highlight_text.trim() != '') {
to_clipboard += "#+begin_quoten";
to_clipboard += highlight_text.trim() + "n";
to_clipboard += "#+end_quotenn";
}
}
to_clipboard += "*Source*: " + document.getElementById('reader.external-link.view-original').href;
navigator.clipboard.writeText(to_clipboard);
I worked with CoPilot to change the structure to how I wanted it:
javascript:(function(){
for(i in o="",h=document.getElementsByClassName("highlight"),h){
t=h[i].innerHTML,
"undefined"!=typeof t&&""!=t.trim()&&(o+="> "+t.trim().replace(/n/g, "n> ")+"nn");
}
var url = document.getElementById("reader.external-link.view-original").href;
url = url.replace("?utm_source=pocket_saves", "");
o+="Source: ["+document.getElementsByTagName("h1")[0].innerHTML+"]("+url+")"
+document.getElementsByClassName("css-1ba1zfw")[0].innerText;
navigator.clipboard.writeText(o);
})()
It was an interesting process where I tried some things and was corrected. This was much quicker than learning it from scratch.
I recently discovered that Awesome Tables’ Filing Cabinet Add-on has been deprecated, this broke the catalogue I had created with Google Sheets.
I searched online for any further explanation on the change, but was simply sent to Awesome Tables support page.
I started exploring other options online and short of paying for API connectors, I could not really find anything. I subsequently turned to CoPilot, wondering what it might give me. Surprisingly, it gave me a basic script for everything that I needed.
function listFilesInFoldersGEN() {
var folders = [
{folderId: 'URL', sheetName: 'General'},
// Add more folders as needed
];
var spreadsheet = SpreadsheetApp.getActiveSpreadsheet();
for (var i = 0; i < folders.length; i++) {
var folderId = folders[i].folderId;
var sheetName = folders[i].sheetName;
var folder = DriveApp.getFolderById(folderId);
var sheet = spreadsheet.getSheetByName(sheetName);
if (!sheet) {
sheet = spreadsheet.insertSheet(sheetName);
}
// Save the existing data
var range = sheet.getDataRange();
var values = range.getValues();
try {
sheet.clear();
sheet.appendRow(["Name", "Date", "Size", "URL", "Folder"]);
listFilesInFolderRecursiveGEN(folder, sheet, folder.getName());
} catch (e) {
// If an error occurs, revert to the saved data
range.setValues(values);
// Log the error
var errorMessage = 'Error: ' + e.toString();
Logger.log(errorMessage);
// Send an email
var emailAddresses = ['[email protected]', '[email protected]'];
// Enter your email address here
var subject = 'Error in Support Catalogue - General script';
var body = errorMessage;
MailApp.sendEmail(emailAddress, subject, body);
}
}
}
function listFilesInFolderRecursiveGEN(folder, sheet, path) {
var files = folder.getFiles();
while (files.hasNext()) {
var file = files.next();
sheet.appendRow([file.getName(), file.getDateCreated(), file.getSize(), file.getUrl(), path]);
}
var subfolders = folder.getFolders();
while (subfolders.hasNext()) {
var subfolder = subfolders.next();
listFilesInFolderRecursiveGEN(subfolder, sheet, path + '/' + subfolder.getName());
}
}
After a bit of back and forward, I had a new working catalogue which I provided to the team to provide feedback on.
Source: [FBT] on Acorns and Authorship by Laura Hilliger
I have sat with this for a few weeks Laura, thinking about my use of artificial intelligence. Personally, I often find it completing tasks that I know an LLM could do more efficiently. This is where I know a solution is possible, I just do not have the time and patience to work through it. For example, after having a conversation recently with a colleague about creating a form and presenting the information, I spent some time to create a script associated with a spreadsheet that helped streamline the process. Every time I do this, I find myself learning more about code and programming, but maybe I am just lazy?
I agree with you about thinking, skimming and summarising. I feel that what is overlooked is not just that an LLM cannot think, but the importance of the labour associated with reading. In particular, I have been left wondering about something Hannah Arendt said in The Human Condition about the tangibility of thinking:
Source: The Human Condition by Hannah Arendt
If all we are doing is asking the LLM, I am not sure what work this even is?
On a side note, I am not yet comfortable sharing content with an LLM as Doug recently shared:
Source: When in doubt, go see a doc! by Doug Belshaw
Although I respect that this maybe an improvement on Dr. Google, I am still circumspect.