Skip to main content

Prompts

Prompts

toothfairyai@latest…

Manager for prompt operations.

This manager provides methods to create, update, and manage prompt templates.

Example:

>>> client = ToothFairyClient(api_key="...", workspace_id="...")
>>> prompt = client.prompts.create(
... label="Greeting",
... interpolation_string="Hello {{name}}! Welcome to our service."
... )

Accessed via client.prompts.

Methods

MethodHTTPEndpoint
createPOSTPOST /prompt/create
getGETGET /prompt/get/{prompt_id}
deleteDELETEDELETE /prompt/delete/{prompt_id}
updatePOSTPOST /prompt/update
listGETGET /prompt/list
get_by_typederived
get_by_agentderived
get_by_scopederived
searchderived
clonederived

create

Create a new prompt.

def create(
label: str,
interpolation_string: str,
prompt_type: str = 'custom',
scope: Optional[str] = None,
style: Optional[str] = None,
domain: Optional[str] = None,
prompt_placeholder: Optional[str] = None,
available_to_agents: Optional[List[str]] = None
) -> Prompt

Endpoint: POST /prompt/create · API service

Request fields

FieldTypeRequiredDescription
idstringnoUnique identifier for the prompt
workspaceidstringyesYour workspace ID (UUID v4). Auto-injected by the SDK client from your configuration; you do not need to set it manually.
typestringnoPrompt type classification
scopestringnoOAuth scope
stylestringnoGeneration style: default, short, long, funny, informal, formal, interview, academic, business, creative, scientific, poetry, or news
domainstringnoGeneration domain: editorial, customerService, sales, marketing, hr, finance, legal, medical, science, technology, or default
labelstringyesHuman-readable display name
promptLengthintegeryesLength of the prompt in characters (32-2048)
promptPlaceholderstringnoPrompt placeholder text
interpolationStringstringyesPrompt interpolation string
availableToAgentsstringnoList of agent IDs this prompt is available to
createdBystringnoUser ID who created the prompt
updatedBystringnoUser ID who last updated the prompt

The Python SDK accepts snake_case keyword arguments and converts them to the camelCase wire fields shown above.

Response fields

FieldTypeDescription
idstringUnique identifier for the prompt
typestringPrompt type classification
scopestringOAuth scope
stylestringGeneration style: default, short, long, funny, informal, formal, interview, academic, business, creative, scientific, poetry, or news
domainstringGeneration domain: editorial, customerService, sales, marketing, hr, finance, legal, medical, science, technology, or default
labelstringHuman-readable display name
promptLengthnumberLength of the prompt in characters (32-2048)
promptPlaceholderstringPrompt placeholder text
interpolationStringstringPrompt interpolation string
availableToAgentsarray<string>List of agent IDs this prompt is available to
workspaceIDstringUnique workspace identifier (UUID v4)
createdBystringUser ID who created the prompt
updatedBystringUser ID who last updated the prompt
createdAtstringTimestamp when this resource was created
updatedAtstringTimestamp when this resource was last updated

Example

client.prompts.create(label="…", interpolation_string="…")

get

Get a prompt by ID.

def get(prompt_id: str) -> Prompt

Endpoint: GET /prompt/get/{prompt_id} · API service

Response

Returns the Prompt object — fields documented in the create section above.

Example

client.prompts.get(prompt_id="agent-id")

delete

Delete a prompt.

def delete(prompt_id: str) -> Dict[str, bool]

Endpoint: DELETE /prompt/delete/{prompt_id} · API service

Response fields

FieldTypeDescription
successbooleanOperation success status
dataobjectResponse data
messagestringOptional success message

Example

client.prompts.delete(prompt_id="agent-id")

update

Update a prompt.

def update(
prompt_id: str,
label: Optional[str] = None,
interpolation_string: Optional[str] = None,
prompt_type: Optional[str] = None,
scope: Optional[str] = None,
style: Optional[str] = None,
domain: Optional[str] = None,
prompt_placeholder: Optional[str] = None,
available_to_agents: Optional[List[str]] = None
) -> Prompt

Endpoint: POST /prompt/update · API service

Request fields

FieldTypeRequiredDescription
idstringyesUnique identifier for the prompt
workspaceidstringnoYour workspace ID (UUID v4). Auto-injected by the SDK client from your configuration; you do not need to set it manually.
typestringnoPrompt type classification
scopestringnoOAuth scope
stylestringnoGeneration style: default, short, long, funny, informal, formal, interview, academic, business, creative, scientific, poetry, or news
domainstringnoGeneration domain: editorial, customerService, sales, marketing, hr, finance, legal, medical, science, technology, or default
labelstringnoHuman-readable display name
promptLengthintegernoLength of the prompt in characters (32-2048)
promptPlaceholderstringnoPrompt placeholder text
interpolationStringstringnoPrompt interpolation string
availableToAgentsstringnoList of agent IDs this prompt is available to
createdBystringnoUser ID who created the prompt
updatedBystringnoUser ID who last updated the prompt

The Python SDK accepts snake_case keyword arguments and converts them to the camelCase wire fields shown above.

Response

Returns the Prompt object — fields documented in the create section above.

Example

client.prompts.update(prompt_id="agent-id")

list

List prompts.

def list(
prompt_type: Optional[str] = None,
limit: Optional[int] = None,
offset: Optional[int] = None
) -> ListResponse

Endpoint: GET /prompt/list · API service

Example

client.prompts.list()

get_by_type

Get prompts by type.

def get_by_type(prompt_type: str, limit: Optional[int] = None) -> List[Prompt]

Derived method — delegates to another SDK call and performs no direct HTTP request.

Example

client.prompts.get_by_type(prompt_type="…")

get_by_agent

Get prompts available to a specific agent.

def get_by_agent(agent_id: str) -> List[Prompt]

Derived method — delegates to another SDK call and performs no direct HTTP request.

Example

client.prompts.get_by_agent(agent_id="agent-id")

get_by_scope

Get prompts by scope.

def get_by_scope(scope: str) -> List[Prompt]

Derived method — delegates to another SDK call and performs no direct HTTP request.

Example

client.prompts.get_by_scope(scope="…")

Search prompts by label.

def search(search_term: str, prompt_type: Optional[str] = None) -> List[Prompt]

Derived method — delegates to another SDK call and performs no direct HTTP request.

Example

client.prompts.search(search_term="…")

clone

Clone a prompt with optional modifications.

def clone(
prompt_id: str,
label: Optional[str] = None,
interpolation_string: Optional[str] = None,
prompt_type: Optional[str] = None,
scope: Optional[str] = None,
style: Optional[str] = None,
domain: Optional[str] = None,
prompt_placeholder: Optional[str] = None,
available_to_agents: Optional[List[str]] = None
) -> Prompt

Derived method — delegates to another SDK call and performs no direct HTTP request.

Example

client.prompts.clone(prompt_id="agent-id")