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

Python kwargWire fieldTypeRequiredDescription
ididstringnoUnique identifier for the prompt
workspace_idworkspaceidstringyesYour workspace ID (UUID v4). Auto-injected by the SDK client from your configuration; you do not need to set it manually.
typetypestringnoPrompt type classification
scopescopestringnoOAuth scope
stylestylestringnoGeneration style: default, short, long, funny, informal, formal, interview, academic, business, creative, scientific, poetry, or news
domaindomainstringnoGeneration domain: editorial, customerService, sales, marketing, hr, finance, legal, medical, science, technology, or default
labellabelstringyesHuman-readable display name
prompt_lengthpromptLengthintegeryesLength of the prompt in characters (32-2048)
prompt_placeholderpromptPlaceholderstringnoPrompt placeholder text
interpolation_stringinterpolationStringstringyesPrompt interpolation string
available_to_agentsavailableToAgentsstringnoList of agent IDs this prompt is available to
created_bycreatedBystringnoUser ID who created the prompt
updated_byupdatedBystringnoUser ID who last updated the prompt

Always pass snake_case keyword arguments — the Python kwarg column shows the exact name to use for each wire field (as a named parameter where it appears in the method signature, otherwise via **kwargs). The SDK converts it deterministically to the camelCase wire key the API expects. Passing camelCase directly is deprecated: it emits a warning and converts to the same wire key.

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

Python kwargWire fieldTypeRequiredDescription
ididstringyesUnique identifier for the prompt
workspace_idworkspaceidstringnoYour workspace ID (UUID v4). Auto-injected by the SDK client from your configuration; you do not need to set it manually.
typetypestringnoPrompt type classification
scopescopestringnoOAuth scope
stylestylestringnoGeneration style: default, short, long, funny, informal, formal, interview, academic, business, creative, scientific, poetry, or news
domaindomainstringnoGeneration domain: editorial, customerService, sales, marketing, hr, finance, legal, medical, science, technology, or default
labellabelstringnoHuman-readable display name
prompt_lengthpromptLengthintegernoLength of the prompt in characters (32-2048)
prompt_placeholderpromptPlaceholderstringnoPrompt placeholder text
interpolation_stringinterpolationStringstringnoPrompt interpolation string
available_to_agentsavailableToAgentsstringnoList of agent IDs this prompt is available to
created_bycreatedBystringnoUser ID who created the prompt
updated_byupdatedBystringnoUser ID who last updated the prompt

Always pass snake_case keyword arguments — the Python kwarg column shows the exact name to use for each wire field (as a named parameter where it appears in the method signature, otherwise via **kwargs). The SDK converts it deterministically to the camelCase wire key the API expects. Passing camelCase directly is deprecated: it emits a warning and converts to the same wire key.

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")