Skip to content

Prompt Template API

api_delete_prompt_template(pt_id)

Deletes a prompt template by its identifier.

Parameters:

Name Type Description Default
pt_id str

The unique identifier of the prompt template to be deleted.

required

Returns:

Name Type Description
bool bool

True if the prompt template was successfully deleted.

Raises:

Type Description
Exception

If the deletion process encounters an error.

Source code in moonshot/src/api/api_prompt_template.py
@validate_call
def api_delete_prompt_template(pt_id: str) -> bool:
    """
    Deletes a prompt template by its identifier.

    Args:
        pt_id (str): The unique identifier of the prompt template to be deleted.

    Returns:
        bool: True if the prompt template was successfully deleted.

    Raises:
        Exception: If the deletion process encounters an error.
    """
    return PromptTemplate.delete(pt_id)

api_get_all_prompt_template_detail()

Retrieves all available prompt template details and returns them as a list of dictionaries.

Returns:

Type Description
list[dict]

list[dict]: A list of dictionaries, each representing the details of a prompt template.

Source code in moonshot/src/api/api_prompt_template.py
def api_get_all_prompt_template_detail() -> list[dict]:
    """
    Retrieves all available prompt template details and returns them as a list of dictionaries.

    Returns:
        list[dict]: A list of dictionaries, each representing the details of a prompt template.
    """
    return PromptTemplate.get_all_prompt_template_details()

api_get_all_prompt_template_name()

Retrieves all available prompt template names and returns them as a list.

Returns:

Type Description
list[str]

list[str]: A list of prompt template names.

Source code in moonshot/src/api/api_prompt_template.py
def api_get_all_prompt_template_name() -> list[str]:
    """
    Retrieves all available prompt template names and returns them as a list.

    Returns:
        list[str]: A list of prompt template names.
    """
    return PromptTemplate.get_all_prompt_template_names()