Closed wwzeng1 closed 10 months ago
29ce88717b
)Here are the sandbox execution logs prior to making any changes:
d734fa9
Checking sweepai/utils/ticket_utils.py for syntax errors... ✅ sweepai/utils/ticket_utils.py has no syntax errors!
1/1 ✓Checking sweepai/utils/ticket_utils.py for syntax errors... ✅ sweepai/utils/ticket_utils.py has no syntax errors!
Sandbox passed on the latest main
, so sandbox checks will be enabled for this issue.
I found the following snippets in your repository. I will now analyze these snippets and come up with a plan.
[X] Create sweepai/agents/filter_agent.py
✓ https://github.com/sweepai/sweep/commit/567be650e200fafaf77de80939e41aa8ad8456ff
Create sweepai/agents/filter_agent.py with contents:
• Create a new file named filter_agent.py in the sweepai/agents directory.
• In this file, import the necessary modules and classes. This includes the ChatGPT class from sweepai.core.chat, and the DEFAULT_GPT4_32K_MODEL and DEFAULT_GPT35_MODEL from sweepai.config.server.
• Define a new class named FilterAgent that inherits from the ChatGPT class.
• In the FilterAgent class, define a method named filter_search_query. This method should take in a search query and return a filtered version of it. The filtering process should be done using a prompt, similar to how it's done in the name_agent.py file.
• The filter_search_query method should use the chat method of the ChatGPT class to generate the filtered search query. The content of the chat should be the prompt with the search query filled in.
• The filter_search_query method should then extract the filtered search query from the response of the chat method and return it.
[X] Running GitHub Actions for sweepai/agents/filter_agent.py
✓
Check sweepai/agents/filter_agent.py with contents:
Ran GitHub Actions for 567be650e200fafaf77de80939e41aa8ad8456ff:
• black: ✓
• Vercel Preview Comments: ✓
[X] Modify sweepai/utils/ticket_utils.py
✓ https://github.com/sweepai/sweep/commit/aaaa83939b6316801faf5c0deeff37637f3bf977
Modify sweepai/utils/ticket_utils.py with contents:
• In the ticket_utils.py file, import the FilterAgent class from the sweepai.agents.filter_agent file.
• In the method that prepares the search query, create an instance of the FilterAgent class.
• Use the filter_search_query method of the FilterAgent instance to filter the search query before it's sent into lexical search.
• Replace the original search query with the filtered search query.
[X] Running GitHub Actions for sweepai/utils/ticket_utils.py
✓
Check sweepai/utils/ticket_utils.py with contents:
Ran GitHub Actions for aaaa83939b6316801faf5c0deeff37637f3bf977:
• Vercel Preview Comments: ✓
• black: ✓
I have finished reviewing the code for completeness. I did not find errors for sweep/search-query-filtering-agent_1
.
💡 To recreate the pull request edit the issue title or description. To tweak the pull request, leave a comment on the pull request. Join Our Discord
The agent should filter unnecessary terms out of the search query to be sent into lexical search. Use a prompt to do this, using name_agent.py as a reference.
Checklist
- [X] Create `sweepai/agents/filter_agent.py` ✓ https://github.com/sweepai/sweep/commit/567be650e200fafaf77de80939e41aa8ad8456ff - [X] Running GitHub Actions for `sweepai/agents/filter_agent.py` ✓ - [X] Modify `sweepai/utils/ticket_utils.py` ✓ https://github.com/sweepai/sweep/commit/aaaa83939b6316801faf5c0deeff37637f3bf977 - [X] Running GitHub Actions for `sweepai/utils/ticket_utils.py` ✓ ![Flowchart](https://raw.githubusercontent.com/sweepai/sweep/sweep/assets/db0bd603893c36ffc9786f9823dfb47de913ca5c95b38f3a9235c4bd1bd03c09_2693_flowchart.svg)