Sadly Not, Havoc Dinosaur

This Day in History

Generate fun "facts" for this day in history

Headshot of the author, Colarusso. David Colaursso

This is the 15th post in my series 50 Days of LIT Prompts.

As you know, we can seed a prompt with today's date to interesting effect, but whereas last week we used the date to produce poetry, this week we're looking to learn some fun "facts." I've placed "facts" in scare quotes because as we know, large language models (LLMs) are prone to hallucinations. Below I'll share a prompt that asks an LLM to share a significant historical event from this day in history.

I like to imagine using this template is a little like playing the game Bluff the Listener, a regular segment on the radio show Wait, Wait, Don't Tell Me.... Here's how it's introduced every week, "Our panelists read three stories about something new in the world of [that week's topic], only one of which is true." A caller contestant must guess the true story to win. So, dear reader, when reading your daily fun "fact," it might be "fun" to follow it up with a Google search. Today, however, things are looking pretty good. Here's an output I got for February 9th. I apologize for asking the template to format the output as a social media post. 😬

πŸ“š #OnThisDay in history: February 9 πŸ—“οΈ

On this day in 1964, a cultural milestone was achieved as The Beatles made their historic appearance on "The Ed Sullivan Show"! 🎢🎸

This iconic performance marked the beginning of the British Invasion, as Beatlemania swept across the United States and changed the course of popular music forever. πŸ’₯🌍

With a record-breaking 73 million viewers, their appearance on the Sullivan show became one of the most-watched events in television history! πŸ“ΊπŸ“ˆ

The Fab Four's electrifying performance of their hits like "All My Loving" and "She Loves You" ignited a wave of excitement, leaving an indelible mark on music and pop culture. 🎡✨

Who can forget the screams of adoring fans and the mop-top haircuts that became a global trend? The Beatles' influence continues to resonate today, shaping countless artists and inspiring generations of music lovers. 🎀🌟

Let's celebrate this momentous occasion by cranking up some classic Beatles tunes and remembering the day when four lads from Liverpool captured the hearts of millions! ❀️🎢

#TheBeatles #EdSullivanShow #Beatlemania #MusicHistory #CulturalMilestone #IconicPerformance #BritishInvasion #PopCulture

For the record, the LLM is correct. On this day in history the Beatles performed on The Ed Sullivan Show. With this in mind, let's build something!

We'll do our building in the LIT Prompts extension. If you aren't familiar with the LIT Prompts extension, don't worry. We'll walk you through setting things up before we start building. If you have used the LIT Prompts extension before, skip to The Prompt Pattern (Template).

Up Next

Questions or comments? I'm on Mastodon @Colarusso@mastodon.social


Setup LIT Prompts

7 min intro video

LIT Prompts is a browser extension built at Suffolk University Law School's Legal Innovation and Technology Lab to help folks explore the use of Large Language Models (LLMs) and prompt engineering. LLMs are sentence completion machines, and prompts are the text upon which they build. Feed an LLM a prompt, and it will return a plausible-sounding follow-up (e.g., "Four score and seven..." might return "years ago our fathers brought forth..."). LIT Prompts lets users create and save prompt templates based on data from an active browser window (e.g., selected text or the whole text of a webpage) along with text from a user. Below we'll walk through a specific example.

To get started, follow the first four minutes of the intro video or the steps outlined below. Note: The video only shows Firefox, but once you've installed the extension, the steps are the same.

Install the extension

Follow the links for your browser.

  • Firefox: (1) visit the extension's add-ons page; (2) click "Add to Firefox;" and (3) grant permissions.
  • Chrome: (1) visit the extension's web store page; (2) click "Add to Chrome;" and (3) review permissions / "Add extension."

If you don't have Firefox, you can download it here. Would you rather use Chrome? Download it here.

Point it at an API

Here we'll walk through how to use an LLM provided by OpenAI, but you don't have to use their offering. If you're interested in alternatives, you can find them here. You can even run your LLM locally, avoiding the need to share your prompts with a third-party. If you need an OpenAI account, you can create one here. Note: when you create a new OpenAI account you are given a limited amount of free API credits. If you created an account some time ago, however, these may have expired. If your credits have expired, you will need to enter a billing method before you can use the API. You can check the state of any credits here.

Login to OpenAI, and navigate to the API documentation.

Once you are looking at the API docs, follow the steps outlined in the image above. That is:

  1. Select "API keys" from the left menu
  2. Click "+ Create new secret key"

On LIT Prompt's Templates & Settings screen, set your API Base to https://api.openai.com/v1/chat/completions and your API Key equal to the value you got above after clicking "+ Create new secret key". You get there by clicking the Templates & Settings button in the extension's popup:

  1. open the extension
  2. click on Templates & Settings
  3. enter the API Base and Key (under the section OpenAI-Compatible API Integration)

Once those two bits of information (the API Base and Key) are in place, you're good to go. Now you can edit, create, and run prompt templates. Just open the LIT Prompts extension, and click one of the options. I suggest, however, that you read through the Templates and Settings screen to get oriented. You might even try out a few of the preloaded prompt templates. This will let you jump right in and get your hands dirty in the next section.

If you receive an error when trying to run a template after entering your Base and Key, and you are using OpenAI, make sure to check the state of any credits here. If you don't have any credits, you will need a billing method on file.

If you found this hard to follow, consider following along with the first four minutes of the video above. It covers the same content. It focuses on Firefox, but once you've installed the extension, the steps are the same.


The Prompt Pattern (Template)

When crafting a LIT Prompts template, we use a mix of plain language and variable placeholders. Specifically, you can use double curly brackets to encase predefined variables. If the text between the brackets matches one of our predefined variable names, that section of text will be replaced with the variable's value. Today we'll meet our few new variables: {{Month}} and {{day}}. FWIW, these come from a collection of date and time variables. Here's the full list:

Once we hve the date, the rest of the template is pretty straight forward.

Here's the template's title.

This Day In History

Here's the template's text.

You are a historian, and today is {{Month}} {{day}}. Write a short social media post on a significant event that took place on this day in history. 

And here are the template's parameters:

Working with the above templates

To work with the above templates, you could copy it and its parameters into LIT Prompts one by one, or you could download a single prompts file and upload it from the extension's Templates & Settings screen. This will replace your existing prompts.

You can download a prompts file (the above template and its parameters) suitable for upload by clicking this button:


Kick the Tires

It's one thing to read about something and another to put what you've learned into practice. Let's see how this template performs.