DevRewind
This is an experimental Python library designed to establish a relationship between code and actual business by mining development logs, and analyzing with LLM and langchain.
At the current stage, we provide two typical capabilities:
- Summarizing the functionality of a specific code file.
- Searching for files related to a specific functionality.
In simple terms, our goal is to establish a connection between code and real-world business scenarios and support bidirectional search.
Example
With a simple script:
import click
from dev_rewind import DevRewind, DevRewindConfig
config = DevRewindConfig()
# on your codebase path
config.repo_root = "../requests"
api = DevRewind(config)
agent = api.create_agent()
while True:
question = click.prompt("Question")
if question == "exit":
break
response = agent.run(input=question)
click.echo(f"Answer: {response}")
and setting a valid OPENAI_API_KEY like https://github.com/openai/openai-python#usage:
export OPENAI_API_KEY=sk-xxxxxxxx
And you will get an interactive agent:
2023-10-31 22:29:17.576 | DEBUG | dev_rewind.core.agent:create_agent:111 - file docs/user/authentication.rst keywords: ['blacked', 'requires', 'benefit', 'project', 'read', 'openid', 'connect', 'formatted', 'protocol', 'https', 'directly', 'highlighting', 'netrc', 'flow', 'oauth', 'guides', 'malformed', 'kwpolska', 'v1', 'supports', 'meth', 'discoverability', 'images', 'wrap', 'urls', 'required', 'underpinning', 'improve', 'api', 'oauthlib', '1471', 'header', 'twitter', 'folks', 'authentication', 'prefer', 'couple', 'add', 'impression', 'credentials', 'split', 'gmail', 'streaming', 'test_basicauth_with_netrc', 'long', 'test_requests', 'ages', 'server', 'pypi', 'precedence', 'digest', 'spent', '2nd', 'separate', 'ie38844a40ec7a483e6ce5e56077be344242bcd99', 'remove', '2062', 'xauth', 'color', 'basic', 'simple', 'underlying', 'grammar', 'schemes', 'custom', 'explicitly', 'clarifying', 'analytics', 'lines']
2023-10-31 22:29:18.279 | DEBUG | dev_rewind.core.agent:create_agent:111 - file docs/_static/custom.css keywords: ['compact', 'broken', 'zone', 'footer', 'padding', 'reitz', 'org', 'double', 'css', 'overlap', 'button', 'human', 'request', 'ads', 'framework', 'official', 'expanded', 'carbon', 'moved', 'install', 'correct', 'cpc', 'integrate', 'native', 'space', 'adjust', 'integration', 'vertical', 'width', 'kenneth', 'key', 'direct', 'buysellads', 'placements', 'kennethreitz', 'site', 'design', 'things', 'white', 'custom', 'cta', 'image', 'attempt']
2023-10-31 22:29:18.899 | DEBUG | dev_rewind.core.agent:create_agent:111 - file docs/community/vulnerabilities.rst keywords: ['red', 'markup', 'early', 'vulnerabilities', 'contact', 'info', 'note', 'clarify', 'cve', 'images', 'urls', 'disclosure', 'longer', 'valid', 'process', '5369', 'fixing', 'jeremycline', 'remove', 'ship', 'vulnerability', 'hat', '5881', 'analytics', 'subdomain']
2023-10-31 22:29:18.970 | DEBUG | dev_rewind.core.agent:create_agent:114 - keywords ready
Question:
Ask about a file
Question: Tell me about the feature of tests/test_utils.py
Based on the fact we have extracted, it can answer well:
Answer: The file tests/test_utils.py contains keywords related to setting environment variables, bypassing proxies, extracting zipped paths, and comparing uri. It also contains keywords related to renaming, formatting, and parsing files.
Ask about a feature
Question: Which files talk about environment variables?
And it should work vice versa.
Answer: The response to your last comment is that the files related to environment variables are tests/utils.py, tests/conftest.py, tests/test_packages.py, .pre-commit-config.yaml, tests/test_hooks.py, tests/__init__.py, tests/test_structures.py, docs/user/advanced.rst, tests/testserver/server.py, and .coveragerc.
Installtion
pip install DevRewind
or just clone this repo. See the "Contribution" part.
How it works?
The key of this repo is that, it will create a topic list for each file to represent them.
Contribution
- clone this repo
- install poetry
- run
poetry install - run
poetry run devr, which will start an interactive shell
Also, dev_rewind/test_core.py should help.
License
Metadata
Release files for DevRewind 0.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| devrewind-0.2.0.tar.gz | 19.8 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| devrewind-0.2.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 42.1 kB
Release files / devrewind-0.2.0.tar.gz
| Download URL | devrewind-0.2.0.tar.gz |
|---|---|
| Size | 19.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
030527044612d692cfcdaf16e7242601198b537c394518e95f528b7290d730ba
|
|
BLAKE2b-256 checksum How to use checksums |
290b72d7a07ba4fca3e4a886887af01c863437aba90aec4a9d7e1a83b15d76d2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/4.0.2 CPython/3.11.6
|
Release files / devrewind-0.2.0-py3-none-any.whl
| Download URL | devrewind-0.2.0-py3-none-any.whl |
|---|---|
| Size | 22.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
f38a1d245aa2a58d8ae4a48e8c5d431a586ad7257edc37edd310b50dfa35ee27
|
|
BLAKE2b-256 checksum How to use checksums |
6babbbca2c15d44cdffa745a3ae23e17b344abe0c143c2434f72d229e4a311fe
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/4.0.2 CPython/3.11.6
|