sweepai / sweep

Sweep: open-source AI-powered Software Developer for small features and bug fixes.
https://sweep.dev
Other
7.39k stars 420 forks source link

Sweep: create a new agent to be used in ticket_utils.py #3158

Open wwzeng1 opened 6 months ago

wwzeng1 commented 6 months ago

Details

The agent should filter unnecessary terms out of the search query to be sent into lexical search. Write a prompt to do this, using pr_description as a reference

Checklist - [X] Create `sweepai/agents/query_filter_agent.py` ✓ https://github.com/sweepai/sweep/commit/9159660fe39e8db1ec039e836362627e567045b8 [Edit](https://github.com/sweepai/sweep/edit/sweep/create_a_new_agent_to_be_used_in_ticket_2f9c3/sweepai/agents/query_filter_agent.py) - [X] Running GitHub Actions for `sweepai/agents/query_filter_agent.py` ✓ [Edit](https://github.com/sweepai/sweep/edit/sweep/create_a_new_agent_to_be_used_in_ticket_2f9c3/sweepai/agents/query_filter_agent.py) - [X] Modify `sweepai/utils/ticket_utils.py` ✓ https://github.com/sweepai/sweep/commit/8d2252011a45e78dce97cddb27a991e025f7568c [Edit](https://github.com/sweepai/sweep/edit/sweep/create_a_new_agent_to_be_used_in_ticket_2f9c3/sweepai/utils/ticket_utils.py#L94-L118) - [X] Running GitHub Actions for `sweepai/utils/ticket_utils.py` ✓ [Edit](https://github.com/sweepai/sweep/edit/sweep/create_a_new_agent_to_be_used_in_ticket_2f9c3/sweepai/utils/ticket_utils.py#L94-L118)
sweep-nightly[bot] commented 6 months ago

🚀 Here's the PR! #3160

See Sweep's progress at the progress dashboard!
💎 Sweep Pro: I'm using GPT-4. You have unlimited GPT-4 tickets. (tracking ID: None)

[!TIP] I can email you next time I complete a pull request if you set up your email here!


Actions (click)


Step 1: 🔎 Searching

I found the following snippets in your repository. I will now analyze these snippets and come up with a plan.

Some code snippets I think are relevant in decreasing order of relevance (click to expand). If some file is missing from here, you can mention the path in the ticket description. https://github.com/sweepai/sweep/blob/6430b99da33d913b814c90397ff118dbf3654a46/sweepai/utils/ticket_utils.py#L93-L130 https://github.com/sweepai/sweep/blob/6430b99da33d913b814c90397ff118dbf3654a46/sweepai/agents/assistant_functions.py#L52-L69 https://github.com/sweepai/sweep/blob/6430b99da33d913b814c90397ff118dbf3654a46/sweepai/agents/pr_description_bot.py#L25-L51

Step 2: ⌨️ Coding

Ran GitHub Actions for 9159660fe39e8db1ec039e836362627e567045b8:

--- 
+++ 
@@ -5,6 +5,7 @@

 from sweepai.config.client import SweepConfig
 from sweepai.core.context_pruning import RepoContextManager, get_relevant_context
+from sweepai.agents.query_filter_agent import QueryFilterAgent
 from sweepai.core.lexical_search import (
     compute_vector_search_scores,
     prepare_lexical_search_index,
@@ -108,7 +109,8 @@
 ):
     logger.info("Fetching relevant files...")
     try:
-        search_query = (title + summary + replies_text).strip("\n")
+        filter_agent = QueryFilterAgent()
+        search_query = filter_agent.filter_search_query((title + summary + replies_text).strip('\n'))
         replies_text = f"\n{replies_text}" if replies_text else ""
         formatted_query = (f"{title.strip()}\n{summary.strip()}" + replies_text).strip(
             "\n"

Ran GitHub Actions for 8d2252011a45e78dce97cddb27a991e025f7568c:


Step 3: 🔁 Code Review

I have finished reviewing the code for completeness. I did not find errors for sweep/create_a_new_agent_to_be_used_in_ticket_2f9c3.


🎉 Latest improvements to Sweep:
  • New dashboard launched for real-time tracking of Sweep issues, covering all stages from search to coding.
  • Integration of OpenAI's latest Assistant API for more efficient and reliable code planning and editing, improving speed by 3x.
  • Use the GitHub issues extension for creating Sweep issues directly from your editor.

💡 To recreate the pull request edit the issue title or description. Something wrong? Let us know.

This is an automated message generated by Sweep AI.