Function Calling - How Does It Modify The Prompt?

That’s exactly what I did in a project where I had to implement the NASA Open API for getting imagery.

For context: You can’t simply query the API for imagery on a particular date. The process requires two steps:

  1. Request data from the Earth Assets API to find the closest satellite pass for a given location and date.
  2. Use that data to query the Earth Imagery API with the exact date-time and location.

Initially, when users asked for imagery, the model would use their exact date-time to call the Imagery API directly, resulting in errors.

I solved this by adding instructions to the system message, directing it to first query the Earth Assets API for the closest pass data, then use that information to fetch the correct imagery.