diff --git a/docs/docs/usage-guide/changing_a_model.md b/docs/docs/usage-guide/changing_a_model.md index 3e470040..ed57bb3e 100644 --- a/docs/docs/usage-guide/changing_a_model.md +++ b/docs/docs/usage-guide/changing_a_model.md @@ -48,8 +48,8 @@ api_base = "http://localhost:11434" # or whatever port you're running Ollama on !!! note "Local models vs commercial models" Qodo Merge is compatible with almost any AI model, but analyzing complex code repositories and pull requests requires a model specifically optimized for code analysis. - Commercial models such as GPT-4, Claude Sonnet, and Gemini have demonstrated robust capabilities in generating structured output for code analysis. In contrast, most open-source models currently available (as of January 2025) face challenges with these complex tasks. - Based on our testing, local open-source models are suitable for experimentation and learning purposes, but they may not be suitable for production-level code analysis tasks. + Commercial models such as GPT-4, Claude Sonnet, and Gemini have demonstrated robust capabilities in generating structured output for code analysis tasks with large input. In contrast, most open-source models currently available (as of January 2025) face challenges with these complex tasks. + Based on our testing, local open-source models are suitable for experimentation and learning purposes, but they are not suitable for production-level code analysis tasks. Hence, for production workflows and real-world code analysis, we recommend using commercial models. ### Hugging Face Inference Endpoints diff --git a/pr_agent/settings/pr_code_suggestions_prompts.toml b/pr_agent/settings/pr_code_suggestions_prompts.toml index 012ae0fc..7a449fb2 100644 --- a/pr_agent/settings/pr_code_suggestions_prompts.toml +++ b/pr_agent/settings/pr_code_suggestions_prompts.toml @@ -125,6 +125,30 @@ The PR Diff: {{ diff_no_line_numbers|trim }} ====== +{%- if duplicate_prompt_examples %} + + +Example output: +```yaml +code_suggestions: +- relevant_file: | + src/file1.py + language: | + python + suggestion_content: | + ... + existing_code: | + ... + improved_code: | + ... + one_sentence_summary: | + ... + label: | + ... +``` +(replace '...' with actual content) +{%- endif %} + Response (should be a valid YAML, and nothing else): ```yaml diff --git a/pr_agent/settings/pr_code_suggestions_reflect_prompts.toml b/pr_agent/settings/pr_code_suggestions_reflect_prompts.toml index 34b1eec4..16ffb435 100644 --- a/pr_agent/settings/pr_code_suggestions_reflect_prompts.toml +++ b/pr_agent/settings/pr_code_suggestions_reflect_prompts.toml @@ -122,6 +122,25 @@ Below are {{ num_code_suggestions }} AI-generated code suggestions for enhancing ====== +{%- if duplicate_prompt_examples %} + + +Example output: +```yaml +code_suggestions: +- suggestion_summary: | + ... + relevant_file: "..." + relevant_lines_start: ... + relevant_lines_end: ... + suggestion_score: ... + why: | + ... +- ... +``` +(replace '...' with actual content) +{%- endif %} + Response (should be a valid YAML, and nothing else): ```yaml """ diff --git a/pr_agent/tools/pr_code_suggestions.py b/pr_agent/tools/pr_code_suggestions.py index f3d7cda4..aebe5dec 100644 --- a/pr_agent/tools/pr_code_suggestions.py +++ b/pr_agent/tools/pr_code_suggestions.py @@ -81,6 +81,7 @@ class PRCodeSuggestions: "relevant_best_practices": "", "is_ai_metadata": get_settings().get("config.enable_ai_metadata", False), "focus_only_on_problems": get_settings().get("pr_code_suggestions.focus_only_on_problems", False), + 'duplicate_prompt_examples': get_settings().config.get('duplicate_prompt_examples', False), } self.pr_code_suggestions_prompt_system = get_settings().pr_code_suggestions_prompt.system @@ -830,7 +831,8 @@ class PRCodeSuggestions: "diff": patches_diff, 'num_code_suggestions': len(suggestion_list), 'prev_suggestions_str': prev_suggestions_str, - "is_ai_metadata": get_settings().get("config.enable_ai_metadata", False)} + "is_ai_metadata": get_settings().get("config.enable_ai_metadata", False), + 'duplicate_prompt_examples': get_settings().config.get('duplicate_prompt_examples', False)} environment = Environment(undefined=StrictUndefined) if dedicated_prompt: