Enforce ChatGPT response in JSON format
The prompt has been adjusted to emphasize that all responses from
ChatGPT, including those of 'message_creation' type, must be delivered
in JSON format.
Change-Id: If4ec54831d172f3a677a86a935d9ccf4f946305e
Signed-off-by: Patrizio <patrizio.gelosi@amarulasolutions.com>
diff --git a/src/main/resources/config/prompts.json b/src/main/resources/config/prompts.json
index b358bb9..340d8ed 100644
--- a/src/main/resources/config/prompts.json
+++ b/src/main/resources/config/prompts.json
@@ -4,7 +4,7 @@
"DEFAULT_GPT_REVIEW_PROMPT_COMMIT_MESSAGES": "You MUST review the commit message of the PatchSet and provide your feedback in an additional reply. The commit message is provided in %s. Ensure that the commit message accurately and succinctly describes the changes made, and verify if it matches the nature and scope of the changes in the PatchSet. If your feedback on the commit message is negative, you are required to supply an example of commit message that meets these criteria. For instance, if your comment is \"The commit message lacks detail\", you should follow up with \"A clearer commit message would be '...'\".",
"DEFAULT_GPT_REQUEST_PROMPT_DIFF": "I have some requests about the following PatchSet Diff:",
"DEFAULT_GPT_REQUEST_PROMPT_REQUESTS": "My requests are given in a JSON-formatted array, where each element includes the compulsory field `request`, the field `history` with any prior exchanged messages, and, for inline code comments, the fields `filename`, `lineNumber`, and `codeSnippet`:",
- "DEFAULT_GPT_REPLIES_PROMPT": "Each reply must be formatted as an individual object within an array in the key `replies`, as defined in the `format_replies` tools function. The object includes the string attributes %s, with the following specifications: %s.",
+ "DEFAULT_GPT_REPLIES_PROMPT": "You MUST provide your entire response as a JSON object; no other formats, such as plain text lists of suggestions, will be considered acceptable. Each reply must be formatted as an individual answer object within an array in the key `replies` of the response object, as defined in the tools function named `format_replies`. The answer object includes the string attributes %s, with the following specifications: %s.",
"DEFAULT_GPT_REPLIES_PROMPT_INLINE": "For replies that are specific to a certain part of the code, the object must additionally include the keys `filename`, `lineNumber`, and `codeSnippet` to precisely identify the relevant code section.",
"DEFAULT_GPT_REPLIES_PROMPT_ENFORCE_RESPONSE_CHECK": "Make sure that the array in `replies` contains exactly %d element(s), one for each request.",
"DEFAULT_GPT_REPLIES_ATTRIBUTES": {