Kind of poetic, isn’t it? The act of speaking to an art-AI feels like a communication word-game — like playing Charades or Taboo, where you have to trigger your collaborator to produce the right result by talking around a subject. Except in this case, the goal is to find the correct incantation that awakens the spirits residing within yonder eldritch cauldron of vectors, and summons them to do your bidding. Clive Thompson “The Psychological Weirdness of Prompt Engineering”

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:

  • 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
Source: How to write better ChatGPT prompts for the best generative AI results – David Gewirtz, ZDNet, Oct 12, 2023 Commentary by Stephen Downes

Or it may well be the trial and error nature of coding. 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.


If you enjoy what you read here, feel free to sign up for my monthly newsletter to catch up on all things learning, edtech and storytelling.

Aide or Answer – Learning with Artificial Intelligence by Aaron Davis is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.

3 thoughts on “Aide or Answer – Learning with Artificial Intelligence

  1. 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.

  2. 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:

    What I think we probably should do, working with our colleagues in libraries and study skills centres, is to update our support for search skills. Help students to understand what the algorithms are hiding as well as what they are revealing, how to search when you know what you are looking for as well as when you don’t, the business models as well as the algorithms of search, and how search online is being systematically degraded both by commercial interests and by these new synthetic capabilities. We may conclude that students are better off learning how to use the walled gardens of content that academic libraries and subscriptions provide – which ties in with my arguments about building our own ecosystems. That will also equip them for search ‘in the wild’.

    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? ()

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.