Skip to main content

Create and Execute Remote Quick Commands

You can use the quick commands you’ve created in the StackSpot AI Portal beyond IDEs. These commands can help you use the StackSpot infrastructure, such as Workspaces, Stack AI, and Knowledge Sources, to accelerate GenAI use cases via API.

When used remotely, the Quick Commands should seamlessly leverage the StackSpot infrastructure, including Stack AI and Knowledge Sources. Additionally, remote quick commands support the handling of parameters, allowing you to input variables or arguments to customize the behavior of the commands.

The purpose of the Remote Quick Command is its use and integration with third-party software.

tip

What’s the main difference between Quick Command IDE and Remote Quick Command?

Quick Command is a custom feature that works only on your IDE. You can use it by right-clicking your mouse. On the other hand, you can execute Remote Quick Command via API and generate payloads for external services through the internet. It is perfect for integrations and processing beyond the local environment.

Create a Remote Quick Command

Requirements

info
  • Remote Quick Command Rate Limit

There is a limit on the number of times you can use the Remote Quick Command within a 24-hour period. The limit varies based on the type of token you are using.

  1. Personal Access Token (PAT)

If you have already used it more than 100 times in the last 24 hours, you won't be able to use it again until the time limit has expired. In this case, you will receive an HTTP status 429 error. See an example below:

{
"type": "TooManyRequests",
"code": "CODEBUDDY_1044_QUICK_COMMAND_RATE_LIMIT_EXCEEDED",
"details": "Maximum number of requests reached. Your limit is 100 requests in the last 1440 minutes"
}

Please wait until the time limit has expired before using the Remote Quick Command again.

  1. Service Credential: If you use a Service Credential for the account, you have a a limit of 10 requests per minute and up to 3,000 requests per day.

Only Account Holders can create Service Credentials and the limit is for the whole Account.

Creating a Remote Quick Command follows the same process as creating a Custom one. Here's how:

Step 1. Log in to your StackSpot AI Account;

Step 2. Navigate to the ‘Quick Command’ in the left-side menu. Click ‘Create Quick Command’, select the ‘Remote’ option. Fill out the fields:

  • Quick Command Name: Add a name for your Command

  • Command: Add a name you will use it later; it should follow the slug pattern. For more information about Slugs, see the slug pattern.

  • Description: Add a description of what your Command can do.

Step 3. You can create a RQC using an available template or create one from scratch. It can be prompt or web request.

  1. Prompt

Click on the Prompt box, drag it to the 'Start' box, and connect it using the line.

On the Prompt box, fill out the fields:

  • Prompt name: Add a slug identifier following the slug pattern.
  • Insert your prompt: Write down what you want your command to do. Include the {{input_data}}.
  • Select a Knowledge Source
  1. HTTP Request

Click on the HTTP Request box, drag it to the 'Start' box, and connect it using the line.

On the HTTP Request box, fill out the fields:

  • Web request name: Add a request name following the slug pattern.
  • HTTP Method: Choose a HTTP method.
  • URL Endpoint: Add the Endpoint URL.
  • Headers
  • Request Body

Connectivity is limited to StackSpot AI, and your service is available online. When using a Quick Command in the IDE extension, the Web Request operates within it, enabling functionality on private networks. If this is your requirement, opt for the Quick Command IDE.

Step 4. Click 'Finish' and fill out the Quick Command Utilization. Add:

{{the-name-of-yourQC.answer}}

It represents the expected result displayed in the service.

Share Quick Command

You can share the Quick Command you created with other users. This will enable direct use within the IDEs in the Account.

  • On the 'Quick Commands' screen, click the share button on the left side of the StackSpot AI Portal to share.

How to use it?

You will execute the Quick Command via API on the ‘How to use’ tab. Follow these steps:

Step 1. Generate your Access Token by clicking the ’Generate client key’ button in the upper menu tab..

For more details, see the Service Credential guide on the StackSpot EDP documentation.

Step 2. In the Create (POST) section, obtain the endpoint to create an execution of the Quick Command. The URL must contain your Quick Command name, and you can use {{input_data}} as a parameter found in the request body of the same page. It will send a service request with the specific data you require.

The input data can be either a string or a JSON.

Step 3. The endpoint retrieves the answer for the service request (callback (GET)). Include the execution_id as a path parameter.

Step 4. Monitor the response on the page for progress status, start and end times, duration, execution percentage, and status.

You will receive updates on the status at each step, including the final result, which you can use anywhere.

Next Steps