r/Python • • Oct 18 '23

Intermediate Showcase Sweep - Python AI Assistant for automatically adding Typehints and Pytest Unit Tests

Hi r/Python,

Sweep is an AI Assistant written in Python, and specialized for Python.We automatically handle simple fixes such as adding unit tests, typehints, and fixing leftover TODOs. You can go about your normal workflow (creating or merging PRs) and Sweep will automatically create PRs that clean up after you!

Here's a demo:https://www.youtube.com/watch?v=dUN9Lx3vlv0

Here's our source code (licensed under ELv2 so it's commercially viable). https://github.com/sweepai/sweep. You can deploy it yourself or use our hosted version.

We do a couple of things differently from other projects.

  • As far as we know, Sweep is the only project that actually runs your code and fixes it. We setup a sandbox that runs pytest, pylint, black, or any other test suite you'd like.

  • Sweep has way better retrieval. We use the Python AST, CST, lexical (keyword search), and semantic search to properly fetch the code. This takes a while, but it's alright because we run asynchronously from your workflow. https://docs.sweep.dev/blogs/ai-code-planning

  • Sweep allows you to comment on PRs to make any small tweaks to the original change from the bot.

Thank you for the support, and we're looking forward to answering any questions you have!

0 Upvotes

4 comments sorted by

View all comments

7

u/[deleted] Oct 18 '23

Just so I understand, you're essentially just passing people's code into ChatGPT but with some extra text asking ChatGPT to handle things like typehints and then you return the code back to the user?

-3

u/williamsweep Oct 18 '23

Yep, but doing this with a high degree of quality.

We take ChatGPT's code and validate + fix it for you so you can just click merge.

12

u/[deleted] Oct 18 '23

Sure, but when you call the product "AI" all you're really doing is asking a different AI to do that work. You're like an expensive middle man.

4

u/ageofwant Oct 18 '23 • Take My Silver

So are you asking your ISP's internet to move packets for you to do the work or do you use your own internet ?