Modifying a Prompt
Function
Modify a prompt.
If FreeMarker syntax needs to be used in the modified prompt, you need to check the prompt to avoid variable absence. For details about the FreeMarker manual, visit https://freemarker.apache.org/docs/ref.html.
URI
PUT /v1/{project_id}/applications/{application_id}/uni-search/prompt/{prompt_id}
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
project_id |
Yes |
String |
Definition: Project ID. For details about how to obtain the project ID, see Obtaining a Project ID. Constraints: N/A Value range: The value can contain 1 to 64 characters. Only digits, letters, hyphens (-), and underscores (_) are allowed. The value must start with a letter. Default value: N/A |
application_id |
Yes |
String |
Definition: Application ID. For details about how to obtain the application ID, see Obtaining an Application ID. Constraints: Character string Value range: The value can contain 1 to 64 characters. Only digits, letters, hyphens (-), and underscores (_) are allowed. The value must start with a letter. Default value: N/A |
prompt_id |
Yes |
String |
Prompt ID. The value is a string of 1 to 64 characters and can contain only digits, letters, hyphens (-), and underscores (_). |
Request Parameters
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
X-Auth-Token |
Yes |
String |
Definition: Token used for API authentication. For details about how to obtain the token, see Obtaining an IAM User Token. Constraints: N/A Value range: N/A Default value: N/A |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
name |
Yes |
String |
Definition: Prompt name. Constraints: N/A Value range: The value can contain 1 to 64 characters. It can only contain letters, digits, hyphens (-), and underscores (_), and must start with a letter or digit. Default value: N/A |
detail |
Yes |
String |
Definition: Prompt description. Constraints: N/A Value range: Enter up to 100 characters. Default value: N/A |
type |
Yes |
String |
Definition: Prompt types DEFAULT_CHAT_PROMPT: default RAG prompt DEFAULT_QA_ANSWER_PROMPT: default QA answer generation prompt The DEFAULT_QA_QUESTION_PROMPT: default QA question generation prompt CHAT_PROMPT: RAG prompt QA_QUESTION_PROMPT: QA answer generation prompt QA_ANSWER_PROMPT: QA question generation prompt MLLM_PROMPT: multimodal model prompt. Value range:
|
prompts |
Yes |
Array of PromptItem objects |
Definition: List of prompts in different languages. Constraints: N/A Value range: The value contains a maximum of 20 characters. Default value: N/A |
freemarker_enabled |
No |
Boolean |
Definition: Whether the current prompt needs to use the FreeMarker syntax. Constraints: N/A Value range: true/false Default value: false |
search_scope |
No |
String |
Definition: This parameter is required when freeMarkerEnabled is set to true. It is used to determine the reference document source of the current prompt. The options are DOCUMENT and WEB. Constraints: This parameter is required when freeMarkerEnabled is set to true. Value range:
Default value: DOCUMENT |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
language |
No |
String |
Definition: Language name. Constraints: N/A Value range:
Default value: N/A |
prompt |
No |
String |
Definition: Prompt. Constraints: N/A Value range: The value contains a maximum of 8,192 characters. Default value: N/A |
attention |
No |
String |
Definition: Notes. Constraints: N/A Value range: The maximum length is 65,535 characters. Default value: N/A |
Response Parameters
Status code: 200
Parameter |
Type |
Description |
---|---|---|
id |
String |
Definition: Prompt ID. Constraints: N/A Value range: N/A Default value: N/A |
Status code: 400
Parameter |
Type |
Description |
---|---|---|
error_code |
String |
Definition: Value range: N/A |
error_msg |
String |
Definition: Error message. Value range: N/A |
Status code: 500
Parameter |
Type |
Description |
---|---|---|
error_code |
String |
Definition: Value range: N/A |
error_msg |
String |
Definition: Error message. Value range: N/A |
Example Requests
Modify a prompt.
/v1/{project_id}/applications/{application_id}/uni-search/prompt/{prompt_id} { "name" : "Prompt name", "detail" : "Prompt description", "type" : "chat_prompt", "prompts" : [ { "prompt" : "Chinese prompt", "language" : "zh" }, { "prompt" : "English prompt", "language" : "en" }, { "prompt" : "Arabic prompt", "language" : "ar" }, { "prompt" : "Thai prompt", "language" : "th" }, { "prompt" : "Spanish prompt", "language" : "es" }, { "prompt" : "Portuguese prompt", "language" : "pt" } ] }
Example Responses
None
Status Codes
Status Code |
Description |
---|---|
200 |
Response body for modifying a prompt. |
400 |
Incorrect request body parameter. |
500 |
Internal error. |
Error Codes
See Error Codes.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot