Skip to content

Instantly share code, notes, and snippets.

@Qqwy
Last active May 25, 2023 09:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Qqwy/22195a9576dfac85914011d097b3b97c to your computer and use it in GitHub Desktop.
Save Qqwy/22195a9576dfac85914011d097b3b97c to your computer and use it in GitHub Desktop.
GPT-3.5 input to help with José Valim's "Skynet" / "AItomator" streams.

Good day! I will ask you to perform a task. Your job is to come up with a directed acyclic graph (DAG) of simple subtasks to accomplish the task. The output of the last step of the DAG should be the answer of the task.

To help you, here is a list of tools you can use.

  • date_from_today: Given a number of days (positive or negative) as input, it returns the date of today offset by that amount of days as output.
  • date_diff: Given a yyyy-mm-dd date, a second yyyy-mm-dd date, and days/weeks/months/years (as string) as inputs, it returns an integer representing the difference as output.
  • location_to_gps: Given a city name as input, returns GPS coordinates as output.
  • temperature_api: Given a yyyy-mm-dd date and GPS coordinates as inputs, it returns the forecasted or measured temperature in Celsius as output.
  • fashion_suggestion: Given a temperature in Celius as input, it recommends fashionable clothes to wear based on the temperature as output.
  • summarize_document: Given a document as text as input, it returns a summary of this text as output.
  • fetch_web_url: Given an URL string as input, it returns the contents of fetching this web URL (page, file, etc.) as output.
  • generate_image: Given a description string as input, it returns an image rendition of that description as output.
  • describe_image: Given an image as input, it returns a description of what can be seen on the image as output.
  • speech_to_text: Given a text as input, it returns the text as spoken audio as output.
  • text_to_speech: Given spoken audio as input, it returns the spoken words as a text string as output.
  • string_reverser: Given a string as input, returns the reversed string as output.
  • ask_user: Given a hard-coded string as input, it returns whatever the user entered. Use this tool only if the other tools are not enough to solve a task.

You can use only these tools, and nothing else. If the tools are not enough, please start your answer with "This cannot be solved with the given tools" followed by an explanation what else you would require, if the task is possible at all.

The output format should be a JSON array of objects where later elements in the array can refer to earlier objects but never the other way around (because it is a directed acyclic graph). Output should not contain placeholders or assume any particular location, date, or other property of a user.

Examples:


Prompt: "What date is it today?"

Answer:

[
{"name": "Task", "tool": "date_from_today", "parameters": [{"type": "static", "value": 0}]}
]

Prompt: "Summarize the image at https://en.wikipedia.org/wiki/Duck#/media/File:Bucephala-albeola-010.jpg"

Answer:

[
{"name": "FetchImage", "tool": "fetch_web_url", "parameters": [{"type": "static", "value": "https://en.wikipedia.org/wiki/Duck#/media/File:Bucephala-albeola-010.jpg"}]},
{"name": "FetchImageDescription", "tool": "describe_image", "parameters": [{"type": "dynamic", "step": "FetchImage"}]},
{"name": "Summary", "tool": "summarize_document", "parameters": [{"type": "dynamic", "step": "FetchedImageDescription"}]}
]

Prompt: "Speak the contents of http://example.com"

Answer:

[
{"name": "FetchedContents", "tool": "fetch_web_url", "parameters": [{"type": "static", "value": "http://example.com"}]}
{"name": "SpokenContents", "tool": "text_to_speech", "parameters": [{"type": "dynamic", "step": "FetchedContents"}]}
]

Prompt: "How hot will it be two days in the future?"

Answer:

[
{"name": "Location", "tool": "ask_user", "parameters": [{"type": "static", "value": "What is your location?"}]},
{"name": "TwoDaysFromToday", "tool": "date_from_today", "parameters": [{"type": "static", "value": 2}]},
{"name": "YourFutureTemperature", "tool": "temperature_api", "parameters": [{"type": "dynamic", "step": "TwoDaysFromToday"}, {"type": "dynamic", "step": "Location"}]},
]

Prompt: "What is the temperature right now in Amsterdam?"

Answer:

[
{"name": "Today", "tool": "date_from_today", "parameters": [{"type": "static", "value": 0}]},
{"name": "AmsterdamCoords", "tool": "location_to_gps", "parameters": [{"type": "static", "value": "Amsterdam"}]},
{"name": "Temperature", "tool": "temperature_api", "parameters": [{"type": "dynamic", "step": "Today"}, {"type": "dynamic", "step": "AmsterdamCoords"}]}
]

Prompt: "What was the temperature here at 2022-01-01?"

Answer:

[
{"name": "Location", "tool": "ask_user", "parameters": [{"type": "static", "value": "What is the name of your current city?"}]},
{"name": "Coords", "tool": "location_to_gps", "parameters": [{"type": "dynamic", "step": "Location"}]},
{"name": "Temperature", "tool": "temperature_api", "parameters": [{"type": "static", "value": "2022-01-01"}, {"type": "dynamic", "step": "Coords"}]}
]

Prompt: "What is the reverse of my name?"

Answer:

[
{"name": "YourName", "tool": "ask_user", "parameters": [{"type": "static", "value": "Please provide your name"}]},
{"name": "ReversedName", "tool": "string_reverser", "parameters": [{"type": "dynamic", "step": "YourName"}]},
]

Prompt: "How old am I?"

Answer:

[
{"name": "BirthDate", "tool": "ask_user", "parameters": [{"type": "static", "value": "What is your birth date?"}]},
{"name": "Today", "tool": "date_from_today", "parameters": [{"type": "static", "value": 0}]},
{"name": "Age", "tool": "date_diff", "parameters": [{"type": "dynamic", "step": "BirthDate"}, {"type": "dynamic", "step": "Today"}, {"type": "static", "value": "years"}]},
]

Prompt: "When is the next train from Amsterdam to Berlin?"

Answer:

This cannot be solved with the given tools

To determine the next train from Amsterdam to Berlin, we would need access to a train schedule or a real-time train information service, which is not provided by the tools listed.


Prompt: "What is the last digit of pi?"

Answer:

This cannot be solved with the given tools

Pi is an irrational number, which means it cannot be expressed as a finite decimal or a fraction. Its decimal representation goes on forever without repeating. As such, it doesn't have a "last digit".


Prompt: "What should I wear on my birthday?"

Answer:

@Qqwy
Copy link
Author

Qqwy commented May 24, 2023

Some great prompts that I have had success with on GPT 3.5:

"What should I wear on my birthday?"

(Try this one yourself)

"What is the cheapest flight from London to Atlanta?"

(to which ChatGPT dutifully responds that it needs more tools.)

"Please distill the gist of the podcast episode https://aphid.fireside.fm/d/1437767933/811c9756-babe-40ac-8c25-b3bb24e522e0/75eb4c39-0433-4c96-9e54-1aef7bc135c4.mp3 as an image"

(Try this one yourself and be amazed)

@Qqwy
Copy link
Author

Qqwy commented May 24, 2023

Turned out that after adding some extra tools and examples, GPT 3.5 is no longer able to use it. GPT 4 handles it quite well, but it makes it difficult to recommend this for anything more than 'playground' type software.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment