Managing Prompts via Confident AI SDK
Every Prompts method in the Confident AI Python and TypeScript SDKs.
Overview
The Confident AI SDK exposes every Prompt method on the platform. This page documents how to call these methods in all supported languages. See the introduction to install the SDK and set your API key.
Prompt
client.prompt() returns a Prompt object that stands for one prompt. This object stores the fields listed below, and passes the prompt's id to every method called on it, so you don't need to pass the id nor the stored fields as arguments.
push is the exception, because it sends the stored fields rather than calling a route that names the id. Open the object with alias to call it.
from confident_ai import ConfidentAI
client = ConfidentAI()
prompt = client.prompt(prompt_id="<PROMPT-ID>")Properties
These are the fields a Prompt stores. A method that loads the prompt fills them in, and a method that saves it sends whichever of them you have set, so set them before you save and read them after you load.
| Parameter | Type | Description |
|---|---|---|
prompt_id | Optional[str] | The unique id of the prompt. |
text | Optional[str] | This is the text content of the prompt. |
alias | Optional[str] | This is the alias of the prompt, which is unique within your project. |
id | Optional[str] | This is the id of the commit pulled, generated by Confident AI, not to be confused with the prompt id, the version number, or the commit hash. |
hash | Optional[str] | This is the commit hash of the prompt pulled. |
version | Optional[str] | The version number of the prompt, present when the commit pulled has been released as a version. |
label | Optional[str] | The user-defined label of the version pulled, present when the version carries one. |
type | Optional[PromptType] | See PromptType. |
interpolation_type | Optional[PromptInterpolationType] | See PromptInterpolationType. |
model_settings | Optional[ModelSettings] | See ModelSettings. |
output_type | Optional[PromptOutputType] | See PromptOutputType. |
output_schema | Optional[Dict[str, Any]] | The JSON Schema the prompt's output must match, used when outputType is SCHEMA. It can describe objects (properties and required), arrays (items), and string, integer, number, boolean and null values. title names it, additionalProperties can only be false, and any other keyword is rejected. |
tools | Optional[List[Tool]] | The tools available to the prompt, at the versions this commit pinned. See Tool. |
messages | Optional[List[PromptMessage]] | This is the list of messages that make up the prompt. See PromptMessage. |
images_mapping | Optional[Dict[str, MLLMImageInput]] | — |
import { ConfidentAI } from "confident-ai";
const client = new ConfidentAI();
const prompt = client.prompt("<PROMPT-ID>");Properties
These are the fields a Prompt stores. A method that loads the prompt fills them in, and a method that saves it sends whichever of them you have set, so set them before you save and read them after you load.
| Parameter | Type | Description |
|---|---|---|
promptId | string | The unique id of the prompt. |
text | string | This is the text content of the prompt. |
alias | string | This is the alias of the prompt, which is unique within your project. |
id | string | This is the id of the commit pulled, generated by Confident AI, not to be confused with the prompt id, the version number, or the commit hash. |
hash | string | This is the commit hash of the prompt pulled. |
version | string | The version number of the prompt, present when the commit pulled has been released as a version. |
label | string | The user-defined label of the version pulled, present when the version carries one. |
type | PromptType | See PromptType. |
interpolationType | PromptInterpolationType | See PromptInterpolationType. |
modelSettings | ModelSettings | See ModelSettings. |
outputType | PromptOutputType | See PromptOutputType. |
outputSchema | Record<string, unknown> | The JSON Schema the prompt's output must match, used when outputType is SCHEMA. It can describe objects (properties and required), arrays (items), and string, integer, number, boolean and null values. title names it, additionalProperties can only be false, and any other keyword is rejected. |
tools | Tool[] | The tools available to the prompt, at the versions this commit pinned. See Tool. |
messages | PromptMessage[] | This is the list of messages that make up the prompt. See PromptMessage. |
imagesMapping | Record<string, MLLMImageInput> | — |
Methods
Push Prompt
Creates a new commit for the prompt with the given alias, creating the prompt first when it does not exist. Send text for a text prompt or messages for a messages prompt, not both.
from confident_ai import ConfidentAI
client = ConfidentAI()
prompt = client.prompt(alias="greeting")
prompt.text = "Hello, {{name}}! How can I help you today?"
result = prompt.push(branch="main")For async mode, call a_push and await it as shown below:
result = await prompt.a_push(...)Parameters
| Parameter | Type | Description |
|---|---|---|
branch | Optional[str] | The name of the branch to push the new commit to. The branch is created from main when it does not exist yet. |
import { ConfidentAI } from "confident-ai";
const client = new ConfidentAI();
const prompt = client.prompt(undefined, { alias: "greeting" });
prompt.text = "Hello, {{name}}! How can I help you today?";
const result = await prompt.push({ branch: "main" });Parameters
| Parameter | Type | Description |
|---|---|---|
branch | string | The name of the branch to push the new commit to. The branch is created from main when it does not exist yet. |
Returns
This method returns an object of type PushPromptResult.
Pull Prompt
Pull the prompt from Confident AI, and keep it current.
Pass at most one of commit, version, label. The commit that comes back is cached on disk and re-pulled in the background every refresh seconds, so editing the prompt on Confident AI reaches a running process without a deploy.
from confident_ai import ConfidentAI
client = ConfidentAI()
prompt = client.prompt(prompt_id="<PROMPT-ID>")
result = prompt.pull(
commit="<COMMIT>",
branch="main",
refresh=60,
fallback_to_cache=True,
write_to_cache=True,
default_to_cache=True,
)For async mode, call a_pull and await it as shown below:
result = await prompt.a_pull(...)Parameters
| Parameter | Type | Description |
|---|---|---|
commit | Optional[str] | The hash of the commit to pull. Defaults to latest. |
version | Optional[str] | The version number of the prompt to pull. |
label | Optional[str] | The label of the version to pull. |
branch | Optional[str] | The name of the branch to read from. Defaults to main when omitted. Only valid with commit. |
refresh | Optional[int] | How often, in seconds, to re-pull the prompt in the background. 0 turns off the refresh and the cache together, so that every pull calls the API — which is what you want while you are still editing the prompt. Defaults to 60. |
fallback_to_cache | bool | Serve the cached commit when the API cannot be reached, instead of raising. Defaults to True. |
write_to_cache | bool | Write the pulled commit to the cache. The background refresh writes it either way. Defaults to True. |
default_to_cache | bool | Return the cached commit when there is one, rather than waiting for the API. Defaults to True. |
import { ConfidentAI } from "confident-ai";
const client = new ConfidentAI();
const prompt = client.prompt("<PROMPT-ID>");
const result = await prompt.pull(
{
commit: "<COMMIT>",
branch: "main",
refresh: 60,
fallbackToCache: true,
writeToCache: true,
defaultToCache: true
},
);Parameters
| Parameter | Type | Description |
|---|---|---|
commit | string | The hash of the commit to pull. Defaults to latest. |
version | string | The version number of the prompt to pull. |
label | string | The label of the version to pull. |
branch | string | The name of the branch to read from. Defaults to main when omitted. Only valid with commit. |
refresh | number | How often, in seconds, to re-pull the prompt in the background. 0 turns off the refresh and the cache together, so that every pull calls the API — which is what you want while you are still editing the prompt. Defaults to 60. |
fallbackToCache | boolean | Serve the cached commit when the API cannot be reached, instead of raising. Defaults to true. |
writeToCache | boolean | Write the pulled commit to the cache. The background refresh writes it either way. Defaults to true. |
defaultToCache | boolean | Return the cached commit when there is one, rather than waiting for the API. Defaults to true. |
Returns
This method returns an object of type Prompt.
Interpolate Prompt
Render the prompt's template with values, without calling the API.
Returns the interpolated text for a text prompt, and the interpolated messages for a messages prompt.
from confident_ai import ConfidentAI
client = ConfidentAI()
prompt = client.prompt(prompt_id="<PROMPT-ID>")
prompt.pull()
result = prompt.interpolate()Parameters
| Parameter | Type | Description |
|---|---|---|
**values | Any | — |
import { ConfidentAI } from "confident-ai";
const client = new ConfidentAI();
const prompt = client.prompt("<PROMPT-ID>");
await prompt.pull();
const result = await prompt.interpolate();Parameters
| Parameter | Type | Description |
|---|---|---|
values | Record<string, unknown> | — |
Returns
This method returns an object of type InterpolatedPrompt.
Methods (Stateless)
These methods take every argument themselves, so a caller reaches them through client.prompts without opening a Prompt first.
List Prompts
Lists all the prompts in your Confident AI project.
from confident_ai import ConfidentAI
client = ConfidentAI()
result = client.prompts.list()For async mode, call a_list and await it as shown below:
result = await client.prompts.a_list(...)import { ConfidentAI } from "confident-ai";
const client = new ConfidentAI();
const result = await client.prompts.list();Returns
This method returns an object of type PromptList.
Text Prompt Input
Creates a new commit for the prompt with the given alias, creating the prompt first when it does not exist. Send text for a text prompt or messages for a messages prompt, not both.
Pushes a commit to a text prompt. interpolationType defaults to FSTRING when omitted.
from confident_ai import ConfidentAI
from confident_ai.common import ModelProvider
from confident_ai.prompts import (
ModelSettings,
PromptInterpolationType,
PromptOutputType,
ReasoningEffort,
TextPromptInput,
ToolInput,
Verbosity,
)
client = ConfidentAI()
result = client.prompts.push(
prompt=TextPromptInput(
text="Hello, {{name}}! How can I help you today?",
alias="greeting",
interpolation_type=PromptInterpolationType.MUSTACHE,
model_settings=ModelSettings(
provider=ModelProvider.OPEN_AI,
name="gpt-4o",
temperature=0.7,
max_tokens=1024,
top_p=1,
top_k=40,
frequency_penalty=0,
presence_penalty=0,
stop_sequence=["\n\nHuman:", "###"],
reasoning_effort=ReasoningEffort.MINIMAL,
verbosity=Verbosity.LOW
),
output_type=PromptOutputType.TEXT,
output_schema={
"title": "Greeting",
"type": "object",
"properties": {"greeting": {"type": "string"}},
"required": ["greeting"],
"additionalProperties": False
},
tools=[
ToolInput(
id="<TOOL-ID>",
version="00.00.01"
)
],
branch="main",
images_mapping={}
),
)For async mode, call a_push and await it as shown below:
result = await client.prompts.a_push(...)Parameters
| Parameter | Type | Description |
|---|---|---|
prompt | PromptInput | Required. The commit to push. Send text for a text prompt or messages for a messages prompt, never both. The kind must match the existing prompt's type. Pass a TextPromptInput or a MessagesPromptInput. See PromptInput. |
import { ConfidentAI } from "confident-ai";
import { ModelProvider } from "confident-ai/common";
import {
PromptInterpolationType,
PromptOutputType,
ReasoningEffort,
Verbosity,
} from "confident-ai/prompts";
const client = new ConfidentAI();
const result = await client.prompts.push(
{
text: "Hello, {{name}}! How can I help you today?",
alias: "greeting",
interpolationType: PromptInterpolationType.MUSTACHE,
modelSettings: {
provider: ModelProvider.OPEN_AI,
name: "gpt-4o",
temperature: 0.7,
maxTokens: 1024,
topP: 1,
topK: 40,
frequencyPenalty: 0,
presencePenalty: 0,
stopSequence: ["\n\nHuman:", "###"],
reasoningEffort: ReasoningEffort.MINIMAL,
verbosity: Verbosity.LOW
},
outputType: PromptOutputType.TEXT,
outputSchema: {
title: "Greeting",
type: "object",
properties: { greeting: { type: "string" } },
required: ["greeting"],
additionalProperties: false
},
tools: [
{
id: "<TOOL-ID>",
version: "00.00.01"
}
],
branch: "main",
imagesMapping: {}
},
);Parameters
| Parameter | Type | Description |
|---|---|---|
prompt | PromptInput | Required. The commit to push. Send text for a text prompt or messages for a messages prompt, never both. The kind must match the existing prompt's type. Pass a TextPromptInput or a MessagesPromptInput. See PromptInput. |
Returns
This method returns an object of type PushPromptResult.
Messages Prompt Input
Creates a new commit for the prompt with the given alias, creating the prompt first when it does not exist. Send text for a text prompt or messages for a messages prompt, not both.
Pushes a commit to a messages prompt. interpolationType defaults to FSTRING when omitted.
from confident_ai import ConfidentAI
from confident_ai.common import ModelProvider
from confident_ai.prompts import (
MessagesPromptInput,
ModelSettings,
PromptInterpolationType,
PromptMessage,
PromptOutputType,
ReasoningEffort,
ToolInput,
Verbosity,
)
client = ConfidentAI()
result = client.prompts.push(
prompt=MessagesPromptInput(
messages=[
PromptMessage(
role="system",
content="You are a helpful assistant."
),
PromptMessage(
role="user",
content="Hello, {{name}}! How can I help you today?"
)
],
alias="greeting",
interpolation_type=PromptInterpolationType.MUSTACHE,
model_settings=ModelSettings(
provider=ModelProvider.OPEN_AI,
name="gpt-4o",
temperature=0.7,
max_tokens=1024,
top_p=1,
top_k=40,
frequency_penalty=0,
presence_penalty=0,
stop_sequence=["\n\nHuman:", "###"],
reasoning_effort=ReasoningEffort.MINIMAL,
verbosity=Verbosity.LOW
),
output_type=PromptOutputType.TEXT,
output_schema={
"title": "Greeting",
"type": "object",
"properties": {"greeting": {"type": "string"}},
"required": ["greeting"],
"additionalProperties": False
},
tools=[
ToolInput(
id="<TOOL-ID>",
version="00.00.01"
)
],
branch="main",
images_mapping={}
),
)For async mode, call a_push and await it as shown below:
result = await client.prompts.a_push(...)Parameters
| Parameter | Type | Description |
|---|---|---|
prompt | PromptInput | Required. The commit to push. Send text for a text prompt or messages for a messages prompt, never both. The kind must match the existing prompt's type. Pass a TextPromptInput or a MessagesPromptInput. See PromptInput. |
import { ConfidentAI } from "confident-ai";
import { ModelProvider } from "confident-ai/common";
import {
PromptInterpolationType,
PromptOutputType,
ReasoningEffort,
Verbosity,
} from "confident-ai/prompts";
const client = new ConfidentAI();
const result = await client.prompts.push(
{
messages: [
{
role: "system",
content: "You are a helpful assistant."
},
{
role: "user",
content: "Hello, {{name}}! How can I help you today?"
}
],
alias: "greeting",
interpolationType: PromptInterpolationType.MUSTACHE,
modelSettings: {
provider: ModelProvider.OPEN_AI,
name: "gpt-4o",
temperature: 0.7,
maxTokens: 1024,
topP: 1,
topK: 40,
frequencyPenalty: 0,
presencePenalty: 0,
stopSequence: ["\n\nHuman:", "###"],
reasoningEffort: ReasoningEffort.MINIMAL,
verbosity: Verbosity.LOW
},
outputType: PromptOutputType.TEXT,
outputSchema: {
title: "Greeting",
type: "object",
properties: { greeting: { type: "string" } },
required: ["greeting"],
additionalProperties: false
},
tools: [
{
id: "<TOOL-ID>",
version: "00.00.01"
}
],
branch: "main",
imagesMapping: {}
},
);Parameters
| Parameter | Type | Description |
|---|---|---|
prompt | PromptInput | Required. The commit to push. Send text for a text prompt or messages for a messages prompt, never both. The kind must match the existing prompt's type. Pass a TextPromptInput or a MessagesPromptInput. See PromptInput. |
Returns
This method returns an object of type PushPromptResult.
Get By Label
Retrieves the prompt version carrying label.
from confident_ai import ConfidentAI
client = ConfidentAI()
result = client.prompts.get_by_label(
prompt_id="<PROMPT-ID>",
label="production",
)For async mode, call a_get_by_label and await it as shown below:
result = await client.prompts.a_get_by_label(...)Parameters
| Parameter | Type | Description |
|---|---|---|
prompt_id | str | Required. The unique id of the prompt. |
label | str | Required. The label of the version to pull. |
import { ConfidentAI } from "confident-ai";
const client = new ConfidentAI();
const result = await client.prompts.getByLabel("<PROMPT-ID>", "production");Parameters
| Parameter | Type | Description |
|---|---|---|
promptId | string | Required. The unique id of the prompt. |
label | string | Required. The label of the version to pull. |
Returns
This method returns an object of type Prompt.
Get By Commit
Retrieves the prompt commit with the given hash. The commit is looked up on main unless a branch is given.
from confident_ai import ConfidentAI
client = ConfidentAI()
result = client.prompts.get_by_commit(
prompt_id="<PROMPT-ID>",
hash="bab04ce",
branch="main",
)For async mode, call a_get_by_commit and await it as shown below:
result = await client.prompts.a_get_by_commit(...)Parameters
| Parameter | Type | Description |
|---|---|---|
prompt_id | str | Required. The unique id of the prompt. |
hash | str | Required. The hash of the commit to pull. |
branch | Optional[str] | The name of the branch to read from. Defaults to main when omitted. |
import { ConfidentAI } from "confident-ai";
const client = new ConfidentAI();
const result = await client.prompts.getByCommit(
"<PROMPT-ID>",
"bab04ce",
"main",
);Parameters
| Parameter | Type | Description |
|---|---|---|
promptId | string | Required. The unique id of the prompt. |
hash | string | Required. The hash of the commit to pull. |
branch | string | The name of the branch to read from. Defaults to main when omitted. |
Returns
This method returns an object of type Prompt.
Get By Version
Retrieves the prompt commit released as version.
from confident_ai import ConfidentAI
client = ConfidentAI()
result = client.prompts.get_by_version(
prompt_id="<PROMPT-ID>",
version="00.00.01",
)For async mode, call a_get_by_version and await it as shown below:
result = await client.prompts.a_get_by_version(...)Parameters
| Parameter | Type | Description |
|---|---|---|
prompt_id | str | Required. The unique id of the prompt. |
version | str | Required. The version number of the prompt to pull. |
import { ConfidentAI } from "confident-ai";
const client = new ConfidentAI();
const result = await client.prompts.getByVersion("<PROMPT-ID>", "00.00.01");Parameters
| Parameter | Type | Description |
|---|---|---|
promptId | string | Required. The unique id of the prompt. |
version | string | Required. The version number of the prompt to pull. |
Returns
This method returns an object of type Prompt.
Types
MLLMImageInput
An image referenced from a text field by a [DEEPEVAL:IMAGE:<key>] marker. Send either a public url or the bytes in base64.
class MLLMImageInput:
url: str
local: bool
base64: Optional[str] = None
filename: Optional[str] = None
mime_type: Optional[str] = Field(default=None, alias="mimeType")
data_base64: Optional[str] = Field(default=None, alias="dataBase64")urlstrRequired
This is the URL of the image.
Example: "https://example.com/everest.png"
localboolRequired
This is true when the image is your local file.
Example: false
base64Optional[str]
The base64 data of the image.
Example: "iVBORw0KGgo="
filenameOptional[str]
The original file name.
Example: "everest.png"
mime_typeOptional[str]
The image's MIME type.
Example: "image/png"
data_base64Optional[str]
The image encoded as a base64 data URL.
Example: "data:image/png;base64,iVBORw0KGgo="
interface MLLMImageInput {
url: string;
local: boolean;
base64?: string;
filename?: string;
mimeType?: string;
dataBase64?: string;
}urlstringRequired
This is the URL of the image.
Example: "https://example.com/everest.png"
localbooleanRequired
This is true when the image is your local file.
Example: false
base64string
The base64 data of the image.
Example: "iVBORw0KGgo="
filenamestring
The original file name.
Example: "everest.png"
mimeTypestring
The image's MIME type.
Example: "image/png"
dataBase64string
The image encoded as a base64 data URL.
Example: "data:image/png;base64,iVBORw0KGgo="
ModelProvider
This is the provider of the model.
class ModelProvider(Enum):
OPEN_AI = "OPEN_AI"
CUSTOM = "CUSTOM"
CONFIDENT_AI = "CONFIDENT_AI"
BEDROCK = "BEDROCK"
ANTHROPIC = "ANTHROPIC"
GEMINI = "GEMINI"
X_AI = "X_AI"
DEEPSEEK = "DEEPSEEK"
MOONSHOT_AI = "MOONSHOT_AI"
VERTEX_AI = "VERTEX_AI"
AZURE = "AZURE"
MISTRAL = "MISTRAL"
PERPLEXITY = "PERPLEXITY"
OPEN_ROUTER = "OPEN_ROUTER"
PORTKEY = "PORTKEY"
LITE_LLM = "LITE_LLM"
TRUE_FOUNDRY = "TRUE_FOUNDRY"
HUGGING_FACE = "HUGGING_FACE"
TYPE_SAFE = "TYPE_SAFE"
FAL = "FAL"
Z_AI = "Z_AI"enum ModelProvider {
OPEN_AI = "OPEN_AI",
CUSTOM = "CUSTOM",
CONFIDENT_AI = "CONFIDENT_AI",
BEDROCK = "BEDROCK",
ANTHROPIC = "ANTHROPIC",
GEMINI = "GEMINI",
X_AI = "X_AI",
DEEPSEEK = "DEEPSEEK",
MOONSHOT_AI = "MOONSHOT_AI",
VERTEX_AI = "VERTEX_AI",
AZURE = "AZURE",
MISTRAL = "MISTRAL",
PERPLEXITY = "PERPLEXITY",
OPEN_ROUTER = "OPEN_ROUTER",
PORTKEY = "PORTKEY",
LITE_LLM = "LITE_LLM",
TRUE_FOUNDRY = "TRUE_FOUNDRY",
HUGGING_FACE = "HUGGING_FACE",
TYPE_SAFE = "TYPE_SAFE",
FAL = "FAL",
Z_AI = "Z_AI",
}OPEN_AI · CUSTOM · CONFIDENT_AI · BEDROCK · ANTHROPIC · GEMINI · X_AI · DEEPSEEK · MOONSHOT_AI · VERTEX_AI · AZURE · MISTRAL · PERPLEXITY · OPEN_ROUTER · PORTKEY · LITE_LLM · TRUE_FOUNDRY · HUGGING_FACE · TYPE_SAFE · FAL · Z_AI
ModelSettings
This is the model settings the prompt was authored for.
class ModelSettings:
provider: Optional[ModelProvider] = None
name: Optional[str] = None
temperature: Optional[float] = None
max_tokens: Optional[float] = Field(default=None, alias="maxTokens")
top_p: Optional[float] = Field(default=None, alias="topP")
top_k: Optional[float] = Field(default=None, alias="topK")
frequency_penalty: Optional[float] = Field(default=None, alias="frequencyPenalty")
presence_penalty: Optional[float] = Field(default=None, alias="presencePenalty")
stop_sequence: Optional[List[str]] = Field(default=None, alias="stopSequence")
reasoning_effort: Optional[ReasoningEffort] = Field(default=None, alias="reasoningEffort")
verbosity: Optional[Verbosity] = NoneproviderOptional[ModelProvider]
See ModelProvider.
nameOptional[str]
This is the name of the model.
Example: "gpt-4o"
temperatureOptional[float]
This controls randomness in the model's output. Higher values make output more random.
Example: 0.7
max_tokensOptional[float]
This is the maximum number of tokens to generate.
Example: 1024
top_pOptional[float]
This controls diversity via nucleus sampling. Lower values focus on more likely tokens.
Example: 1
top_kOptional[float]
This limits sampling to the K most likely tokens at each step.
Example: 40
frequency_penaltyOptional[float]
This is the penalty for tokens based on their frequency in the text so far.
Example: 0
presence_penaltyOptional[float]
This is the penalty for tokens based on whether they appear in the text so far.
Example: 0
stop_sequenceOptional[List[str]]
This is the sequences where the model will stop generating further tokens.
Example: ["\n\nHuman:","###"]
reasoning_effortOptional[ReasoningEffort]
See ReasoningEffort.
verbosityOptional[Verbosity]
See Verbosity.
interface ModelSettings {
provider?: ModelProvider;
name?: string;
temperature?: number;
maxTokens?: number;
topP?: number;
topK?: number;
frequencyPenalty?: number;
presencePenalty?: number;
stopSequence?: string[];
reasoningEffort?: ReasoningEffort;
verbosity?: Verbosity;
}providerModelProvider
See ModelProvider.
namestring
This is the name of the model.
Example: "gpt-4o"
temperaturenumber
This controls randomness in the model's output. Higher values make output more random.
Example: 0.7
maxTokensnumber
This is the maximum number of tokens to generate.
Example: 1024
topPnumber
This controls diversity via nucleus sampling. Lower values focus on more likely tokens.
Example: 1
topKnumber
This limits sampling to the K most likely tokens at each step.
Example: 40
frequencyPenaltynumber
This is the penalty for tokens based on their frequency in the text so far.
Example: 0
presencePenaltynumber
This is the penalty for tokens based on whether they appear in the text so far.
Example: 0
stopSequencestring[]
This is the sequences where the model will stop generating further tokens.
Example: ["\n\nHuman:","###"]
reasoningEffortReasoningEffort
See ReasoningEffort.
verbosityVerbosity
See Verbosity.
Prompt
A single commit of a prompt, as pulled by version, commit hash, or label. It carries text when the prompt is a text prompt and messages when it is a messages prompt, never both.
Prompt = Union[
TextPrompt,
MessagesPrompt,
]type Prompt =
| TextPrompt
| MessagesPrompt;A Prompt is one of the shapes below. Send the fields of one of them, never a mix of both.
A pulled prompt whose content is a single text template.
class TextPrompt:
text: str
alias: str
id: str
hash: str
version: Optional[str] = None
label: Optional[str] = None
type: PromptType
interpolation_type: PromptInterpolationType = Field(alias="interpolationType")
model_settings: Optional[ModelSettings] = Field(default=None, alias="modelSettings")
output_type: PromptOutputType = Field(alias="outputType")
output_schema: Optional[Dict[str, Any]] = Field(default=None, alias="outputSchema")
tools: Optional[List[Tool]] = NonetextstrRequired
This is the text content of the prompt.
Example: "Hello, {{name}}! How can I help you today?"
aliasstrRequired
This is the alias of the prompt, which is unique within your project.
Example: "greeting"
idstrRequired
This is the id of the commit pulled, generated by Confident AI, not to be confused with the prompt id, the version number, or the commit hash.
Example: "<COMMIT-ID>"
hashstrRequired
This is the commit hash of the prompt pulled.
Example: "bab04ce"
versionOptional[str]
The version number of the prompt, present when the commit pulled has been released as a version.
Example: "00.00.01"
labelOptional[str]
The user-defined label of the version pulled, present when the version carries one.
Example: "production"
typePromptTypeRequired
See PromptType.
interpolation_typePromptInterpolationTypeRequired
model_settingsOptional[ModelSettings]
See ModelSettings.
output_typePromptOutputTypeRequired
See PromptOutputType.
output_schemaOptional[Dict[str, Any]]
The JSON Schema the prompt's output must match, used when outputType is SCHEMA. It can describe objects (properties and required), arrays (items), and string, integer, number, boolean and null values. title names it, additionalProperties can only be false, and any other keyword is rejected.
Example: {"title":"Greeting","type":"object","properties":{"greeting":{"type":"string"}},"required":["greeting"],"additionalProperties":false}
toolsOptional[List[Tool]]
The tools available to the prompt, at the versions this commit pinned.
See Tool.
interface TextPrompt {
text: string;
alias: string;
id: string;
hash: string;
version?: string;
label?: string;
type: PromptType;
interpolationType: PromptInterpolationType;
modelSettings?: ModelSettings;
outputType: PromptOutputType;
outputSchema?: Record<string, unknown>;
tools?: Tool[];
}textstringRequired
This is the text content of the prompt.
Example: "Hello, {{name}}! How can I help you today?"
aliasstringRequired
This is the alias of the prompt, which is unique within your project.
Example: "greeting"
idstringRequired
This is the id of the commit pulled, generated by Confident AI, not to be confused with the prompt id, the version number, or the commit hash.
Example: "<COMMIT-ID>"
hashstringRequired
This is the commit hash of the prompt pulled.
Example: "bab04ce"
versionstring
The version number of the prompt, present when the commit pulled has been released as a version.
Example: "00.00.01"
labelstring
The user-defined label of the version pulled, present when the version carries one.
Example: "production"
typePromptTypeRequired
See PromptType.
interpolationTypePromptInterpolationTypeRequired
modelSettingsModelSettings
See ModelSettings.
outputTypePromptOutputTypeRequired
See PromptOutputType.
outputSchemaRecord<string, unknown>
The JSON Schema the prompt's output must match, used when outputType is SCHEMA. It can describe objects (properties and required), arrays (items), and string, integer, number, boolean and null values. title names it, additionalProperties can only be false, and any other keyword is rejected.
Example: {"title":"Greeting","type":"object","properties":{"greeting":{"type":"string"}},"required":["greeting"],"additionalProperties":false}
toolsTool[]
The tools available to the prompt, at the versions this commit pinned.
See Tool.
A pulled prompt whose content is a list of messages.
class MessagesPrompt:
messages: List[PromptMessage]
alias: str
id: str
hash: str
version: Optional[str] = None
label: Optional[str] = None
type: PromptType
interpolation_type: PromptInterpolationType = Field(alias="interpolationType")
model_settings: Optional[ModelSettings] = Field(default=None, alias="modelSettings")
output_type: PromptOutputType = Field(alias="outputType")
output_schema: Optional[Dict[str, Any]] = Field(default=None, alias="outputSchema")
tools: Optional[List[Tool]] = NonemessagesList[PromptMessage]Required
This is the list of messages that make up the prompt.
See PromptMessage.
Example: [{"role":"system","content":"You are a helpful assistant."},{"role":"user","content":"Hello, {{name}}! How can I help you today?"}]
aliasstrRequired
This is the alias of the prompt, which is unique within your project.
Example: "greeting"
idstrRequired
This is the id of the commit pulled, generated by Confident AI, not to be confused with the prompt id, the version number, or the commit hash.
Example: "<COMMIT-ID>"
hashstrRequired
This is the commit hash of the prompt pulled.
Example: "bab04ce"
versionOptional[str]
The version number of the prompt, present when the commit pulled has been released as a version.
Example: "00.00.01"
labelOptional[str]
The user-defined label of the version pulled, present when the version carries one.
Example: "production"
typePromptTypeRequired
See PromptType.
interpolation_typePromptInterpolationTypeRequired
model_settingsOptional[ModelSettings]
See ModelSettings.
output_typePromptOutputTypeRequired
See PromptOutputType.
output_schemaOptional[Dict[str, Any]]
The JSON Schema the prompt's output must match, used when outputType is SCHEMA. It can describe objects (properties and required), arrays (items), and string, integer, number, boolean and null values. title names it, additionalProperties can only be false, and any other keyword is rejected.
Example: {"title":"Greeting","type":"object","properties":{"greeting":{"type":"string"}},"required":["greeting"],"additionalProperties":false}
toolsOptional[List[Tool]]
The tools available to the prompt, at the versions this commit pinned.
See Tool.
interface MessagesPrompt {
messages: PromptMessage[];
alias: string;
id: string;
hash: string;
version?: string;
label?: string;
type: PromptType;
interpolationType: PromptInterpolationType;
modelSettings?: ModelSettings;
outputType: PromptOutputType;
outputSchema?: Record<string, unknown>;
tools?: Tool[];
}messagesPromptMessage[]Required
This is the list of messages that make up the prompt.
See PromptMessage.
Example: [{"role":"system","content":"You are a helpful assistant."},{"role":"user","content":"Hello, {{name}}! How can I help you today?"}]
aliasstringRequired
This is the alias of the prompt, which is unique within your project.
Example: "greeting"
idstringRequired
This is the id of the commit pulled, generated by Confident AI, not to be confused with the prompt id, the version number, or the commit hash.
Example: "<COMMIT-ID>"
hashstringRequired
This is the commit hash of the prompt pulled.
Example: "bab04ce"
versionstring
The version number of the prompt, present when the commit pulled has been released as a version.
Example: "00.00.01"
labelstring
The user-defined label of the version pulled, present when the version carries one.
Example: "production"
typePromptTypeRequired
See PromptType.
interpolationTypePromptInterpolationTypeRequired
modelSettingsModelSettings
See ModelSettings.
outputTypePromptOutputTypeRequired
See PromptOutputType.
outputSchemaRecord<string, unknown>
The JSON Schema the prompt's output must match, used when outputType is SCHEMA. It can describe objects (properties and required), arrays (items), and string, integer, number, boolean and null values. title names it, additionalProperties can only be false, and any other keyword is rejected.
Example: {"title":"Greeting","type":"object","properties":{"greeting":{"type":"string"}},"required":["greeting"],"additionalProperties":false}
toolsTool[]
The tools available to the prompt, at the versions this commit pinned.
See Tool.
PromptInput
The commit to push. Send text for a text prompt or messages for a messages prompt, never both. The kind must match the existing prompt's type.
PromptInput = Union[
TextPromptInput,
MessagesPromptInput,
]type PromptInput =
| TextPromptInput
| MessagesPromptInput;A PromptInput is one of the shapes below. Send the fields of one of them, never a mix of both.
Pushes a commit to a text prompt. interpolationType defaults to FSTRING when omitted.
class TextPromptInput:
text: str
alias: str
interpolation_type: Optional[PromptInterpolationType] = Field(default=None, alias="interpolationType")
model_settings: Optional[ModelSettings] = Field(default=None, alias="modelSettings")
output_type: Optional[PromptOutputType] = Field(default=None, alias="outputType")
output_schema: Optional[Dict[str, Any]] = Field(default=None, alias="outputSchema")
tools: Optional[List[ToolInput]] = None
branch: Optional[str] = None
images_mapping: Optional[Dict[str, MLLMImageInput]] = Field(default=None, alias="imagesMapping")textstrRequired
The text content of the prompt.
Example: "Hello, {{name}}! How can I help you today?"
aliasstrRequired
The alias of the prompt, unique within your project. A new prompt is created when no prompt with this alias exists.
Example: "greeting"
interpolation_typeOptional[PromptInterpolationType]
model_settingsOptional[ModelSettings]
See ModelSettings.
output_typeOptional[PromptOutputType]
See PromptOutputType.
output_schemaOptional[Dict[str, Any]]
The JSON Schema the prompt's output must match, used when outputType is SCHEMA. It can describe objects (properties and required), arrays (items), and string, integer, number, boolean and null values. title names it, additionalProperties can only be false, and any other keyword is rejected.
Example: {"title":"Greeting","type":"object","properties":{"greeting":{"type":"string"}},"required":["greeting"],"additionalProperties":false}
toolsOptional[List[ToolInput]]
The tools available to the prompt. The commit pins each one at a version.
See ToolInput.
Example: [{"id":"<TOOL-ID>","version":"00.00.01"}]
branchOptional[str]
The name of the branch to push the new commit to. The branch is created from main when it does not exist yet.
Example: "main"
images_mappingOptional[Dict[str, MLLMImageInput]]
Images placed in the prompt's text or message contents with [CONFIDENT:IMAGE:<key>] markers, keyed by each marker's <key>. When you send it, Confident AI stores its own copy of every image the prompt contains; without it, the prompt is stored as sent.
See MLLMImageInput.
interface TextPromptInput {
text: string;
alias: string;
interpolationType?: PromptInterpolationType;
modelSettings?: ModelSettings;
outputType?: PromptOutputType;
outputSchema?: Record<string, unknown>;
tools?: ToolInput[];
branch?: string;
imagesMapping?: Record<string, MLLMImageInput>;
}textstringRequired
The text content of the prompt.
Example: "Hello, {{name}}! How can I help you today?"
aliasstringRequired
The alias of the prompt, unique within your project. A new prompt is created when no prompt with this alias exists.
Example: "greeting"
interpolationTypePromptInterpolationType
modelSettingsModelSettings
See ModelSettings.
outputTypePromptOutputType
See PromptOutputType.
outputSchemaRecord<string, unknown>
The JSON Schema the prompt's output must match, used when outputType is SCHEMA. It can describe objects (properties and required), arrays (items), and string, integer, number, boolean and null values. title names it, additionalProperties can only be false, and any other keyword is rejected.
Example: {"title":"Greeting","type":"object","properties":{"greeting":{"type":"string"}},"required":["greeting"],"additionalProperties":false}
toolsToolInput[]
The tools available to the prompt. The commit pins each one at a version.
See ToolInput.
Example: [{"id":"<TOOL-ID>","version":"00.00.01"}]
branchstring
The name of the branch to push the new commit to. The branch is created from main when it does not exist yet.
Example: "main"
imagesMappingRecord<string, MLLMImageInput>
Images placed in the prompt's text or message contents with [CONFIDENT:IMAGE:<key>] markers, keyed by each marker's <key>. When you send it, Confident AI stores its own copy of every image the prompt contains; without it, the prompt is stored as sent.
See MLLMImageInput.
Pushes a commit to a messages prompt. interpolationType defaults to FSTRING when omitted.
class MessagesPromptInput:
messages: List[PromptMessage]
alias: str
interpolation_type: Optional[PromptInterpolationType] = Field(default=None, alias="interpolationType")
model_settings: Optional[ModelSettings] = Field(default=None, alias="modelSettings")
output_type: Optional[PromptOutputType] = Field(default=None, alias="outputType")
output_schema: Optional[Dict[str, Any]] = Field(default=None, alias="outputSchema")
tools: Optional[List[ToolInput]] = None
branch: Optional[str] = None
images_mapping: Optional[Dict[str, MLLMImageInput]] = Field(default=None, alias="imagesMapping")messagesList[PromptMessage]Required
The list of messages that make up the prompt.
See PromptMessage.
Example: [{"role":"system","content":"You are a helpful assistant."},{"role":"user","content":"Hello, {{name}}! How can I help you today?"}]
aliasstrRequired
The alias of the prompt, unique within your project. A new prompt is created when no prompt with this alias exists.
Example: "greeting"
interpolation_typeOptional[PromptInterpolationType]
model_settingsOptional[ModelSettings]
See ModelSettings.
output_typeOptional[PromptOutputType]
See PromptOutputType.
output_schemaOptional[Dict[str, Any]]
The JSON Schema the prompt's output must match, used when outputType is SCHEMA. It can describe objects (properties and required), arrays (items), and string, integer, number, boolean and null values. title names it, additionalProperties can only be false, and any other keyword is rejected.
Example: {"title":"Greeting","type":"object","properties":{"greeting":{"type":"string"}},"required":["greeting"],"additionalProperties":false}
toolsOptional[List[ToolInput]]
The tools available to the prompt. The commit pins each one at a version.
See ToolInput.
Example: [{"id":"<TOOL-ID>","version":"00.00.01"}]
branchOptional[str]
The name of the branch to push the new commit to. The branch is created from main when it does not exist yet.
Example: "main"
images_mappingOptional[Dict[str, MLLMImageInput]]
Images placed in the prompt's text or message contents with [CONFIDENT:IMAGE:<key>] markers, keyed by each marker's <key>. When you send it, Confident AI stores its own copy of every image the prompt contains; without it, the prompt is stored as sent.
See MLLMImageInput.
interface MessagesPromptInput {
messages: PromptMessage[];
alias: string;
interpolationType?: PromptInterpolationType;
modelSettings?: ModelSettings;
outputType?: PromptOutputType;
outputSchema?: Record<string, unknown>;
tools?: ToolInput[];
branch?: string;
imagesMapping?: Record<string, MLLMImageInput>;
}messagesPromptMessage[]Required
The list of messages that make up the prompt.
See PromptMessage.
Example: [{"role":"system","content":"You are a helpful assistant."},{"role":"user","content":"Hello, {{name}}! How can I help you today?"}]
aliasstringRequired
The alias of the prompt, unique within your project. A new prompt is created when no prompt with this alias exists.
Example: "greeting"
interpolationTypePromptInterpolationType
modelSettingsModelSettings
See ModelSettings.
outputTypePromptOutputType
See PromptOutputType.
outputSchemaRecord<string, unknown>
The JSON Schema the prompt's output must match, used when outputType is SCHEMA. It can describe objects (properties and required), arrays (items), and string, integer, number, boolean and null values. title names it, additionalProperties can only be false, and any other keyword is rejected.
Example: {"title":"Greeting","type":"object","properties":{"greeting":{"type":"string"}},"required":["greeting"],"additionalProperties":false}
toolsToolInput[]
The tools available to the prompt. The commit pins each one at a version.
See ToolInput.
Example: [{"id":"<TOOL-ID>","version":"00.00.01"}]
branchstring
The name of the branch to push the new commit to. The branch is created from main when it does not exist yet.
Example: "main"
imagesMappingRecord<string, MLLMImageInput>
Images placed in the prompt's text or message contents with [CONFIDENT:IMAGE:<key>] markers, keyed by each marker's <key>. When you send it, Confident AI stores its own copy of every image the prompt contains; without it, the prompt is stored as sent.
See MLLMImageInput.
PromptInterpolationType
The type of interpolation format used in the prompt to insert dynamic variables.
class PromptInterpolationType(Enum):
MUSTACHE = "MUSTACHE"
MUSTACHE_WITH_SPACE = "MUSTACHE_WITH_SPACE"
FSTRING = "FSTRING"
DOLLAR_BRACKETS = "DOLLAR_BRACKETS"
JINJA = "JINJA"enum PromptInterpolationType {
MUSTACHE = "MUSTACHE",
MUSTACHE_WITH_SPACE = "MUSTACHE_WITH_SPACE",
FSTRING = "FSTRING",
DOLLAR_BRACKETS = "DOLLAR_BRACKETS",
JINJA = "JINJA",
}MUSTACHE · MUSTACHE_WITH_SPACE · FSTRING · DOLLAR_BRACKETS · JINJA
PromptList
class PromptList:
prompts: List[PromptSummary]promptsList[PromptSummary]Required
This is the list of prompts in your project.
See PromptSummary.
interface PromptList {
prompts: PromptSummary[];
}promptsPromptSummary[]Required
This is the list of prompts in your project.
See PromptSummary.
PromptMessage
class PromptMessage:
role: str
content: str
tool_calls: Optional[List[PromptMessageToolCall]] = None
tool_call_id: Optional[str] = NonerolestrRequired
This is the role of the message, which can be user, assistant, system, or developer.
Example: "user"
contentstrRequired
This is the text content of the message.
Example: "Hello, {{name}}! How can I help you today?"
tool_callsOptional[List[PromptMessageToolCall]]
Tool calls made by an assistant message, in the OpenAI chat format.
tool_call_idOptional[str]
For tool messages, the id of the assistant tool call this result answers.
Example: "call_abc123"
interface PromptMessage {
role: string;
content: string;
tool_calls?: PromptMessageToolCall[];
tool_call_id?: string;
}rolestringRequired
This is the role of the message, which can be user, assistant, system, or developer.
Example: "user"
contentstringRequired
This is the text content of the message.
Example: "Hello, {{name}}! How can I help you today?"
tool_callsPromptMessageToolCall[]
Tool calls made by an assistant message, in the OpenAI chat format.
tool_call_idstring
For tool messages, the id of the assistant tool call this result answers.
Example: "call_abc123"
PromptMessageToolCall
class PromptMessageToolCall:
id: str
type: Literal["function"]
function: PromptMessageToolCallFunctionidstrRequired
Example: "call_abc123"
typeLiteral["function"]Required
functionPromptMessageToolCallFunctionRequired
interface PromptMessageToolCall {
id: string;
type: "function";
function: PromptMessageToolCallFunction;
}idstringRequired
Example: "call_abc123"
type"function"Required
functionPromptMessageToolCallFunctionRequired
PromptOutputType
The type of output expected from the prompt.
class PromptOutputType(Enum):
TEXT = "TEXT"
JSON = "JSON"
SCHEMA = "SCHEMA"enum PromptOutputType {
TEXT = "TEXT",
JSON = "JSON",
SCHEMA = "SCHEMA",
}TEXT · JSON · SCHEMA
PromptSummary
A prompt as it appears in your project's prompt list, without any version content.
class PromptSummary:
id: str
alias: str
type: PromptTypeidstrRequired
This is the unique id of the prompt.
Example: "<PROMPT-ID>"
aliasstrRequired
This is the alias of the prompt, which is unique within your project.
Example: "greeting"
typePromptTypeRequired
See PromptType.
interface PromptSummary {
id: string;
alias: string;
type: PromptType;
}idstringRequired
This is the unique id of the prompt.
Example: "<PROMPT-ID>"
aliasstringRequired
This is the alias of the prompt, which is unique within your project.
Example: "greeting"
typePromptTypeRequired
See PromptType.
PromptType
This is the type of the prompt, which can be either a simple text or a list of messages.
class PromptType(Enum):
TEXT = "TEXT"
LIST = "LIST"enum PromptType {
TEXT = "TEXT",
LIST = "LIST",
}TEXT · LIST
PushPromptResult
class PushPromptResult:
prompt_id: str = Field(alias="promptId")
hash: strprompt_idstrRequired
This is the id of the prompt generated by Confident AI, not to be confused with the alias you supplied.
Example: "<PROMPT-ID>"
hashstrRequired
This is the hash of the commit created by this push, not to be confused with a version number.
Example: "bab04ce"
interface PushPromptResult {
promptId: string;
hash: string;
}promptIdstringRequired
This is the id of the prompt generated by Confident AI, not to be confused with the alias you supplied.
Example: "<PROMPT-ID>"
hashstringRequired
This is the hash of the commit created by this push, not to be confused with a version number.
Example: "bab04ce"
ReasoningEffort
This is the level of reasoning effort for the model.
class ReasoningEffort(Enum):
MINIMAL = "MINIMAL"
LOW = "LOW"
MEDIUM = "MEDIUM"
HIGH = "HIGH"enum ReasoningEffort {
MINIMAL = "MINIMAL",
LOW = "LOW",
MEDIUM = "MEDIUM",
HIGH = "HIGH",
}MINIMAL · LOW · MEDIUM · HIGH
Tool
A tool your prompts can call. Changing its mode or schema creates a new version.
class Tool:
id: str
name: str
description: Optional[str]
mode: ToolMode
version: str
schema_: Dict[str, Any] = Field(alias="schema")idstrRequired
The id of the tool, generated by Confident AI.
Example: "<TOOL-ID>"
namestrRequired
The name of the tool, unique within the project.
Example: "get_customer_name"
descriptionOptional[str]Required
What the tool does.
Example: "Looks up the customer's name by id."
modeToolModeRequired
See ToolMode.
versionstrRequired
The version of the tool. A pulled prompt returns the version its commit pinned.
Example: "00.00.01"
schema_Dict[str, Any]Required
The JSON Schema for the tool's input. List each parameter under properties with a type, and name the mandatory ones in required. A parameter can also have a description, an enum of allowed values, or items for an array. Whether extra properties are allowed is set by mode.
Example: {"type":"object","properties":{"customerId":{"type":"string","description":"The id of the customer to look up."},"nameFormat":{"type":"string","enum":["FULL","FIRST"],"description":"Whether to return the full name or only the first name."}},"required":["customerId"]}
interface Tool {
id: string;
name: string;
description: string | null;
mode: ToolMode;
version: string;
schema: Record<string, unknown>;
}idstringRequired
The id of the tool, generated by Confident AI.
Example: "<TOOL-ID>"
namestringRequired
The name of the tool, unique within the project.
Example: "get_customer_name"
descriptionstring | nullRequired
What the tool does.
Example: "Looks up the customer's name by id."
modeToolModeRequired
See ToolMode.
versionstringRequired
The version of the tool. A pulled prompt returns the version its commit pinned.
Example: "00.00.01"
schemaRecord<string, unknown>Required
The JSON Schema for the tool's input. List each parameter under properties with a type, and name the mandatory ones in required. A parameter can also have a description, an enum of allowed values, or items for an array. Whether extra properties are allowed is set by mode.
Example: {"type":"object","properties":{"customerId":{"type":"string","description":"The id of the customer to look up."},"nameFormat":{"type":"string","enum":["FULL","FIRST"],"description":"Whether to return the full name or only the first name."}},"required":["customerId"]}
ToolInput
A tool for the commit to pin. Omitted fields keep the values of the version being pinned, and a changed mode or schema creates a new version.
class ToolInput:
id: Optional[str] = None
version: Optional[str] = None
name: Optional[str] = None
description: Optional[str] = None
mode: Optional[ToolMode] = None
schema_: Optional[Dict[str, Any]] = Field(default=None, alias="schema")idOptional[str]
The id of an existing tool. Omit it to use name instead.
Example: "<TOOL-ID>"
versionOptional[str]
The version to pin. Omit it to use the latest version.
Example: "00.00.01"
nameOptional[str]
The name of the tool. Without id, the tool with this name is used or created; with id, a new name renames it.
Example: "get_customer_name"
descriptionOptional[str]
What the tool does.
Example: "Looks up the customer's name by id."
modeOptional[ToolMode]
See ToolMode.
schema_Optional[Dict[str, Any]]
The JSON Schema for the tool's input. List each parameter under properties with a type, and name the mandatory ones in required. A parameter can also have a description, an enum of allowed values, or items for an array. Whether extra properties are allowed is set by mode.
Example: {"type":"object","properties":{"customerId":{"type":"string","description":"The id of the customer to look up."},"nameFormat":{"type":"string","enum":["FULL","FIRST"],"description":"Whether to return the full name or only the first name."}},"required":["customerId"]}
interface ToolInput {
id?: string;
version?: string;
name?: string;
description?: string | null;
mode?: ToolMode;
schema?: Record<string, unknown>;
}idstring
The id of an existing tool. Omit it to use name instead.
Example: "<TOOL-ID>"
versionstring
The version to pin. Omit it to use the latest version.
Example: "00.00.01"
namestring
The name of the tool. Without id, the tool with this name is used or created; with id, a new name renames it.
Example: "get_customer_name"
descriptionstring | null
What the tool does.
Example: "Looks up the customer's name by id."
modeToolMode
See ToolMode.
schemaRecord<string, unknown>
The JSON Schema for the tool's input. List each parameter under properties with a type, and name the mandatory ones in required. A parameter can also have a description, an enum of allowed values, or items for an array. Whether extra properties are allowed is set by mode.
Example: {"type":"object","properties":{"customerId":{"type":"string","description":"The id of the customer to look up."},"nameFormat":{"type":"string","enum":["FULL","FIRST"],"description":"Whether to return the full name or only the first name."}},"required":["customerId"]}
ToolMode
This is the mode for your tool input fields, which controls whether fields outside the schema are allowed.
class ToolMode(Enum):
ALLOW_ADDITIONAL = "ALLOW_ADDITIONAL"
NO_ADDITIONAL = "NO_ADDITIONAL"
STRICT = "STRICT"enum ToolMode {
ALLOW_ADDITIONAL = "ALLOW_ADDITIONAL",
NO_ADDITIONAL = "NO_ADDITIONAL",
STRICT = "STRICT",
}ALLOW_ADDITIONAL · NO_ADDITIONAL · STRICT
Verbosity
This is the verbosity level for model output.
class Verbosity(Enum):
LOW = "LOW"
MEDIUM = "MEDIUM"
HIGH = "HIGH"enum Verbosity {
LOW = "LOW",
MEDIUM = "MEDIUM",
HIGH = "HIGH",
}LOW · MEDIUM · HIGH
Last updated on