Usage

Guide on using Vectorshift APIs.

Currently, we have two types of APIs you can use to integrate with your app: Chatbot and Pipelines. Before using the API, you need to create your API Key. Visit Access for more details.

API calls are rate-limited to 250/minute for non-Enterprise subscriptions.

Chatbot

To generate a chatbot API call, you can go to Chatbot -> Export -> API. Here's an example of a generated API call for a Basic Chatbot.

Request

import requests

url = "https://api.vectorshift.ai/api/chatbots/run"

headers = {
    "Api-Key": "your_api_key",
}

body = {
    "input": "What is VectorShift?",
    "chatbot_name": "Basic Chatbot",
    "username": "ekkirinaldi",
    "conversation_id": None
}

response = requests.post(url, headers=headers, data=body)
response = response.json()
Body ParametersDescription

input

The messsage you want to pass to the chatbot

chatbot_name

Name of your chatbot

username

Your username

conversation_id

The identifier of the conversation.

  • To initialize a new conversation, you can keep it empty and you will receive a new ID in the response.

  • To retain the existing conversation history, you can put the id.

Response

{
    "output": "VectorShift is a no-code, drag-and-drop interface that allows you to build, design, prototype, and deploy generative AI workflows. It offers a variety of use cases, including building chatbots, document search, content creation, and analyst replication?",
    "conversation_id": "65ce44fba1bef20f2afe6813"
}

Pipelines

To generate a pipeline API call, you can go to Pipeline -> Click on the 3 vertical dots -> Generate API Calls. Here's an example of a generated API call for the pipeline "Titan-Express AWS".

The generated API calls might differ for each pipeline depending on which pipeline you choose.

import json
import requests

url = "https://api.vectorshift.ai/api/pipelines/run"

headers = {
    "Api-Key": "your_api_key",
}

body = {
    "inputs": json.dumps({"User_Question": "What is VectorShift?"}),
    "pipeline_name": "Chatbot on VectorShift Example",
    "username": "alm3455",
}

response = requests.post(url, headers=headers, data=body)
response = response.json()
Body ParametersDescription

inputs

Input object based on your pipeline input name and format. The number of inputs and the key name depend on how the pipeline is designed.

In this example, the pipeline only has one key "User_Question" and requires one input "value".

pipeline_name

The name of your pipeline.

username

The username of pipeline creator.

Response

{
    "output_1": "VectorShift is a no-code, drag-and-drop interface that allows you to build, design, prototype, and deploy generative AI workflows. It offers a variety of use cases, including building chatbots, document search, content creation, and analyst replication."
}

Last updated