Skip to main content

Create 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.

tip

What’s the main difference between Quick Comman 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 50 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 50 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 limit of 1,000 uses.

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, and proceed by clicking next.

Step 3. You can create a prompt or web request. Fill out the fields with information on your Quick Command.

  1. Prompt
  • 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. Web Request
  • 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 'End' and fill out the Quick Command Utilization. Add:

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

It represents the expected result displayed in the service.

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