Calling APIs and Webhooks

Call any API or Webhook from Ask Steve

This is only available on the Premium Plan.


Why Call an API or Webhook?

  • This gives you the ability to call your own APIs that can do pre- and post-processing.
  • As an example, you could configure your own internal API that Steve calls with an account number that he pulls from a page. Your API can use that account number to pull relevant data about that account from internal systems, directly make an LLM call with the new augmented data, and then pass the result back to Steve.
  • Or you could send the input to an LLM for processing, and then write it out to a Google Sheet or to Salesforce.
  • Or you could proxy all requests so that you can log them, or filter any sensitive information out.
  • You can do this with your own code running on a server somewhere, or with any visual workflow builder like n8n, Pipedream, Activepieces, Make, Zapier, Gumloop etc. that supports Webhooks.
  • This enables you to do a lot more than just call an LLM!

Check out this Blog Post for a detailed walkthrough showing how to connect Ask Steve to a Make.com API

How to Call an API or Webhook

Ask Steve can interface with any API or Webhook on the back-end.

  • To point a Skill to an API/Webhook instead of an LLM, follow the instructions here when setting up your Skill.
  • API/Webhook Skills behave as follows:
  1. All requests are made via POST
  2. In the Skill configuration, the default header is to set the Content-Type to "application/json", but you can add anything else to the header that you need, including an API key or Authentication key.
  3. The body of the POST request contains a property for every Page Variable and User Variable. All other text in the "Instructions for Steve" area are ignored. You can also include additional static variables in the body in the Skill configuration.
  4. The default behavior is that your API/Webhook should return an object with a "message" property (string) if it was successful, and an "error" property (string) if it was not. This is what will be shown to the user. You can change this if desired in the Skill configuration.
  5. You can include simple HTML formatting in the return values. URLs will be hyperlinked automatically, and text can be hyperlinked by using Markdown formatting.

System Variables

The following System Variables can optionally be sent to your API or Webhook if you include them in your instructions in single brackets, e.g. [_url], [_html], [_timestamp].

  1. _html: has a stripped down version of the HTML of the current page. Most non-text nodes are removed. This is helpful if you need to do some analysis of the page structure.
  2. _language: has the language of the browser making the API call, as returned by navigator.language
  3. _os: has the operating system of the computer making the API call, as returned by chrome.runtime.getPlatformInfo
  4. _preferences: has the user's Preferences.
  5. _prompt: has the full prompt - so all the text in the Skill with all the variables replaced, as if you were sending a single prompt to an LLM. All page and user-input variables will be replaced, and all System Variables will be removed.
  6. _skillName: has the name of the Skill being called.
  7. _timestamp: has the timestamp of the API call. This is a numeric value (integer) representing the number of milliseconds since the Unix epoch, as returned by the Javascript Date.now() function.
  8. _title: has the title of the current page.
  9. _url: has the URL of the current page.
  10. _userAgent: has the user agent of the browser making the API call, as returned by navigator.userAgent

Example Instructions: This Skill captures [[leads]] and sends them to a Webhook. [_url][_title]

The POST body will have the specified property "leads" with the selected text or current page. The system variables "_url" and "_title" will also be added. All other text is ignored and not sent to the API/Webhook.

Example Instructions: This Skill captures a [[headline]], [[author]] and [[article]] then asks the user for {{what do you want to do with this}} and then sends them to a Webhook

The POST body will have the three specified page variables, "headline", "author", "article" and the user-input variable "what do you want to do with this". All other text is ignored and not sent to the API/Webhook.