← Back to context

Comment by Spivak

2 years ago

The best part is that you can teach them to use tools and expand what they can do.

    Do not perform any numeric or date calculations yourself.
    Respond to all questions with a JSON object of the form {“rsp”: $RSP$}.
    Question: What is the capital of the United States?
    {“rsp”: “Washington DC”}
    Perform calculations with a Python program and respond with a JSON
    object of the form {”rsp”: $RSP$, “calc”: $CALC$}.
    Question: What is 2 to the 7th power?
    {“rsp”: “2 to the 7th power is {answer}”, 
     “calc”: “import math
      def answer():
        return math.pow(2, 7)”}
    
    Question: What is tomorrow’s date?
    {“rsp”: “Tomorrow’s date is {answer}”,
     “calc”: “import datetime
      def answer():
        return datetime.date.today() +  datetime.timedelta(days=1)”}

    Question: What is the length of a standard football field?
    {“rsp”: “A standard football field is 100 yards long.”}

It's crazy to me that for some definition of "knows" it knows what questions need calculations.

This looks neat, but after trying several ways I can't reproduce it. I don't get to the interesting part. I don't even get as far as the python program in JSON form.

  • To be fair I am using divinci-003 and not chatgpt and the prompt includes the first two examples. So the prompt goes all the way to "Question: What is tomorrow's date?"