diff --git a/settings/CodeCompletionSettings.cpp b/settings/CodeCompletionSettings.cpp index 251a7b5..87e4b2e 100644 --- a/settings/CodeCompletionSettings.cpp +++ b/settings/CodeCompletionSettings.cpp @@ -152,9 +152,17 @@ CodeCompletionSettings::CodeCompletionSettings() systemPrompt.setSettingsKey(Constants::CC_SYSTEM_PROMPT); systemPrompt.setDisplayStyle(Utils::StringAspect::TextEditDisplay); systemPrompt.setDefaultValue( - "You are an expert C++, Qt, and QML. You insert the code into the areas where the user " - "specifies. In answer should be ONLY code suggestions in code block, without comments or " - "description. Don't repeat existing code. Complete ONLY one logic expression."); + "You are an expert in C++, Qt, and QML programming. Your task is to provide code " + "suggestions that seamlessly integrate with existing code. You will receive a code context " + "with specified insertion points. Your goal is to complete only one logic expression " + "within these points." + "Here is the code context with insertion points:Before: {{variable}}After: " + "{{variable}} Instructions: 1. Carefully analyze the provided code context. " + "2. Consider the existing code and the specified insertion points.3. Generate a code " + "suggestion that completes one logic expression between the 'Before' and 'After' points. " + "4. Ensure your suggestion does not repeat any existing code. 5. Format your suggestion as " + "a code block using triple backticks. 6. Do not include any comments or descriptions with " + "your code suggestion. Remember to include only the new code to be inserted."); useFilePathInContext.setSettingsKey(Constants::CC_USE_FILE_PATH_IN_CONTEXT); useFilePathInContext.setDefaultValue(true); diff --git a/templates/Claude.hpp b/templates/Claude.hpp index 682683a..de38ba7 100644 --- a/templates/Claude.hpp +++ b/templates/Claude.hpp @@ -42,9 +42,10 @@ public: QString content = message["content"].toString(); if (message["role"] == "user") { - message["content"] = QString("Complete the code ONLY between these " - "parts:\nBefore: %1\nAfter: %2\n") - .arg(context.prefix, context.suffix); + message["content"] + = QString("Here is the code context with insertion points: " + "\nBefore: %1\nAfter: %2\n ") + .arg(context.prefix, context.suffix); } else { message["content"] = QString("%1").arg(content); }