Prompt Template API
api_delete_prompt_template(pt_id)
Deletes a prompt template by its identifier.
This function calls the delete
method from the PromptTemplate
class to delete a prompt template
identified by its unique ID. It returns True if the deletion was successful, otherwise it raises an exception.
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
api_get_all_prompt_template_detail()
Retrieves all available prompt template details and returns them as a list of dictionaries.
This function calls the get_all_prompt_template_details
method from the PromptTemplate
class
to fetch the details of all prompt templates. It then returns these details 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
api_get_all_prompt_template_name()
Retrieves all available prompt template names and returns them as a list.
This function calls the get_all_prompt_template_names
method from the PromptTemplate
class
to fetch the names of all prompt templates. It then returns these names as a list of strings.
Returns:
Type | Description |
---|---|
list[str]
|
list[str]: A list of prompt template names. |