Search K
Appearance
Appearance
INFERENCE DEFEND
This article is meant for Inference Defend users.
ROLES AND PERMISSIONS
To complete the task described in this section, make sure you have the required permissions.
When you have several available providers added to CalypsoAI, you may want to choose a specific provider for your prompts. To send a prompt to a specific provider, you just need to provide the provider's name in your request.
In this scenario, we are going to send a prompt to a specific provider using the provider's name.
To send a prompt to a specific provider:
Add your token and provider name values to the following sample:
from calypsoai import CalypsoAI
# Define the URL and token for CalypsoAI
CALYPSOAI_URL = "https://www.us1.calypsoai.app"
CALYPSOAI_TOKEN = "ADD-YOUR-TOKEN-HERE"
# Initialize the CalypsoAI client
cai = CalypsoAI(url=CALYPSOAI_URL, token=CALYPSOAI_TOKEN)
# Send the prompt to the selected provider
prompt = cai.prompts.send("What is your name?", provider="ADD-YOUR-PROVIDER-NAME-HERE")
# Print the response
print(prompt.model_dump_json(indent=2))PROVIDER NAME
Make sure the provider name is the same as the value you specified when adding the provider to CalypsoAI.
Run the script.
Analyze the response.
The following response sample is a simplified version of a successful request, focusing only on the main details relevant to this specific request.
{
"id": "01964381-f1d1-70d9-8916-bc93395df181",
"input": "What is your name?",
"projectId": "01961aca-9df4-70eb-8514-bbb6f72d7032",
"provider": "019639b7-0af8-70ec-8d41-06db530a12f2",
"result": {
"outcome": "cleared",
"response": "I don't have a personal name. I'm an AI, and I exist only as a program designed to assist and communicate with users like you. I don't have a personal identity or consciousness, and I don't have the ability to form opinions or make decisions outside of my programming. I'm simply a tool designed to provide helpful and accurate information, answer questions, and engage in conversation!",
"scannerResults": [
{
"outcome": "passed",
"scanDirection": "request",
"scannerId": "019513f3-45f9-707b-aa90-8584d73229e8",
}
]
}
}The response includes the following key parameters:
input: The contents of the prompt sent to the LLM.projectId: The ID of the project to which the prompt is sent.provider: The ID of the provider to which the prompt is sent.result > outcome: The outcome of the prompt scan request.result > response: The response given by the LLM.result > scannerResults: A list of the scan result information for all scanners used during the scan.result > scannerResults > outcome: The outcome of each individual scanner used during the scan.result > outcome. For example, a scanner may be cleared but the global outcome takes into account the outcome of all scanners used during the scan.result > scannerResults > scanDirection: The scanning direction of each individual scanner used during the scan.result > scannerResults > scannerId: The ID of each individual scanner used during the scan.{
"externalMetadata": null,
"fromTemplate": false,
"id": "01964381-f1d1-70d9-8916-bc93395df181",
"input": "What is your name?",
"memory": null,
"parentId": null,
"preserve": false,
"projectId": "01961aca-9df4-70eb-8514-bbb6f72d7032",
"provider": "019639b7-0af8-70ec-8d41-06db530a12f2",
"receivedAt": "2025-04-17T11:28:31.697871Z",
"result": {
"files": null,
"outcome": "cleared",
"providerResult": {
"data": "I don't have a personal name. I'm an AI, and I exist only as a program designed to assist and communicate with users like you. I don't have a personal identity or consciousness, and I don't have the ability to form opinions or make decisions outside of my programming. I'm simply a tool designed to provide helpful and accurate information, answer questions, and engage in conversation!",
"input": null,
"receivedDate": "2025-04-17T11:28:32.292062Z",
"sentDate": "2025-04-17T11:28:31.836322Z",
"statusCode": 200
},
"response": "I don't have a personal name. I'm an AI, and I exist only as a program designed to assist and communicate with users like you. I don't have a personal identity or consciousness, and I don't have the ability to form opinions or make decisions outside of my programming. I'm simply a tool designed to provide helpful and accurate information, answer questions, and engage in conversation!",
"scannerResults": [
{
"completedDate": "2025-04-17T11:28:31.819486Z",
"customConfig": false,
"outcome": "passed",
"scanDirection": "request",
"scannerId": "019513f3-45f9-707b-aa90-8584d73229e8",
"startedDate": "2025-04-17T11:28:31.700602Z"
}
]
},
"type": "prompt",
"userId": "machine=01964360-af50-703f-b1f4-2a0b5bbf8b7c"
}