forked from continuedev/continue
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 27ecedb
Showing
239 changed files
with
60,887 additions
and
0 deletions.
There are no files selected for viewing
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,138 @@ | ||
# Byte-compiled / optimized / DLL files | ||
__pycache__/ | ||
*.py[cod] | ||
*$py.class | ||
|
||
# C extensions | ||
*.so | ||
|
||
# Distribution / packaging | ||
.Python | ||
build/ | ||
develop-eggs/ | ||
dist/ | ||
downloads/ | ||
eggs/ | ||
.eggs/ | ||
lib/ | ||
lib64/ | ||
parts/ | ||
sdist/ | ||
var/ | ||
wheels/ | ||
pip-wheel-metadata/ | ||
share/python-wheels/ | ||
*.egg-info/ | ||
.installed.cfg | ||
*.egg | ||
MANIFEST | ||
|
||
# PyInstaller | ||
# Usually these files are written by a python script from a template | ||
# before PyInstaller builds the exe, so as to inject date/other infos into it. | ||
*.manifest | ||
*.spec | ||
|
||
# Installer logs | ||
pip-log.txt | ||
pip-delete-this-directory.txt | ||
|
||
# Unit test / coverage reports | ||
htmlcov/ | ||
.tox/ | ||
.nox/ | ||
.coverage | ||
.coverage.* | ||
.cache | ||
nosetests.xml | ||
coverage.xml | ||
*.cover | ||
*.py,cover | ||
.hypothesis/ | ||
.pytest_cache/ | ||
|
||
# Translations | ||
*.mo | ||
*.pot | ||
|
||
# Django stuff: | ||
*.log | ||
local_settings.py | ||
db.sqlite3 | ||
db.sqlite3-journal | ||
|
||
# Flask stuff: | ||
instance/ | ||
.webassets-cache | ||
|
||
# Scrapy stuff: | ||
.scrapy | ||
|
||
# Sphinx documentation | ||
docs/_build/ | ||
|
||
# PyBuilder | ||
target/ | ||
|
||
# Jupyter Notebook | ||
.ipynb_checkpoints | ||
|
||
# IPython | ||
profile_default/ | ||
ipython_config.py | ||
|
||
# pyenv | ||
.python-version | ||
|
||
# pipenv | ||
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control. | ||
# However, in case of collaboration, if having platform-specific dependencies or dependencies | ||
# having no cross-platform support, pipenv may install dependencies that don't work, or not | ||
# install all needed dependencies. | ||
#Pipfile.lock | ||
|
||
# PEP 582; used by e.g. github.com/David-OConnor/pyflow | ||
__pypackages__/ | ||
|
||
# Celery stuff | ||
celerybeat-schedule | ||
celerybeat.pid | ||
|
||
# SageMath parsed files | ||
*.sage.py | ||
|
||
# Environments | ||
.env | ||
.venv | ||
env/ | ||
venv/ | ||
ENV/ | ||
env.bak/ | ||
venv.bak/ | ||
|
||
# Spyder project settings | ||
.spyderproject | ||
.spyproject | ||
|
||
# Rope project settings | ||
.ropeproject | ||
|
||
# mkdocs documentation | ||
/site | ||
|
||
# mypy | ||
.mypy_cache/ | ||
.dmypy.json | ||
dmypy.json | ||
|
||
# Pyre type checker | ||
.pyre/ | ||
|
||
|
||
**/node_modules | ||
**/out | ||
**/.vscode | ||
notes.txt | ||
cached_embeddings.pkl | ||
.ruff_cache | ||
codeql |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# Continue | ||
|
||
Try out latest version: | ||
|
||
- `cd extension` | ||
- `npm run package` | ||
- `cd build` | ||
- `code --install-extension continue-0.0.1.vsix` | ||
|
||
Resources | ||
|
||
- [Continue Github Project](https://github.com/orgs/continuedev/projects/1/views/1) | ||
- [Continue User Guide](https://www.notion.so/continue-dev/Continue-User-Guide-1c6ad99887d0474d9e42206f6c98efa4) | ||
- [Continue - Mission & Vision](https://continue-dev.notion.site/Continue-a8e41af9801641f79d2c8565907bbd22) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
notes.md | ||
config.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
## Steps to start | ||
|
||
- `cd continue/continue` | ||
- Make sure packages are installed with `poetry install` | ||
- `poetry shell` | ||
- `cd ..` | ||
- `python3 -m continuedev.src.continuedev` | ||
|
||
## Steps to generate JSON Schema | ||
|
||
Same up until last step and then `python3 -m continuedev.src.scripts.gen_json_schema`. | ||
|
||
## Start the server | ||
|
||
Same steps, then `uvicorn continue.src.server.main:app --reload`. | ||
|
||
## To build | ||
|
||
Run `poetry build` and it will output wheel and tarball files in `./dist`. |
Empty file.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
[virtualenvs] | ||
in-project = true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
[tool.poetry] | ||
name = "continuedev" | ||
version = "0.1.0" | ||
description = "" | ||
authors = ["Nate Sesti <[email protected]>"] | ||
readme = "README.md" | ||
|
||
[tool.poetry.dependencies] | ||
python = "^3.9" | ||
fastapi = "^0.95.1" | ||
typer = "^0.7.0" | ||
openai = "^0.27.5" | ||
boltons = "^23.0.0" | ||
pydantic = "^1.10.7" | ||
uvicorn = "^0.21.1" | ||
python-dotenv = "^1.0.0" | ||
nest-asyncio = "^1.5.6" | ||
websockets = "^11.0.2" | ||
urllib3 = "1.26.15" | ||
gpt-index = "^0.6.8" | ||
setuptools = "^67.7.2" | ||
|
||
[build-system] | ||
requires = ["poetry-core"] | ||
build-backend = "poetry.core.masonry.api" |
Empty file.
Empty file.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
data |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
import subprocess | ||
import sys | ||
from llama_index import GPTVectorStoreIndex, StorageContext, load_index_from_storage | ||
import os | ||
from typer import Typer | ||
from enum import Enum | ||
from .update import update_codebase_index, create_codebase_index, index_dir_for, get_current_branch | ||
from .replace import replace_additional_index | ||
|
||
app = Typer() | ||
|
||
|
||
def query_codebase_index(query: str) -> str: | ||
"""Query the codebase index.""" | ||
branch = subprocess.check_output( | ||
["git", "rev-parse", "--abbrev-ref", "HEAD"]).decode("utf-8").strip() | ||
path = index_dir_for(branch) | ||
if not os.path.exists(path): | ||
print("No index found for the codebase at ", path) | ||
return "" | ||
|
||
storage_context = StorageContext.from_defaults( | ||
persist_dir=index_dir_for(branch)) | ||
index = load_index_from_storage(storage_context) | ||
# index = GPTVectorStoreIndex.load_from_disk(path) | ||
engine = index.as_query_engine() | ||
return engine.query(query) | ||
|
||
|
||
def query_additional_index(query: str) -> str: | ||
"""Query the additional index.""" | ||
index = GPTVectorStoreIndex.load_from_disk('data/additional_index.json') | ||
return index.query(query) | ||
|
||
|
||
class IndexTypeOption(str, Enum): | ||
codebase = "codebase" | ||
additional = "additional" | ||
|
||
|
||
@app.command() | ||
def query(context: IndexTypeOption, query: str): | ||
if context == IndexTypeOption.additional: | ||
response = query_additional_index(query) | ||
elif context == IndexTypeOption.codebase: | ||
response = query_codebase_index(query) | ||
else: | ||
print("Error: unknown context") | ||
print({"response": response}) | ||
|
||
|
||
@app.command() | ||
def check_index_exists(root_path: str): | ||
branch = get_current_branch() | ||
exists = os.path.exists(index_dir_for(branch)) | ||
print({"exists": exists}) | ||
|
||
|
||
@app.command() | ||
def update(): | ||
update_codebase_index() | ||
print("Updated codebase index") | ||
|
||
|
||
@app.command("create") | ||
def create_index(): | ||
create_codebase_index() | ||
print("Created file index") | ||
|
||
|
||
@app.command() | ||
def replace_additional_index(info: str): | ||
replace_additional_index() | ||
print("Replaced additional index") | ||
|
||
|
||
if __name__ == '__main__': | ||
app() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import sys | ||
from llama_index import GPTVectorStoreIndex, Document | ||
|
||
|
||
def replace_additional_index(info: str): | ||
"""Replace the additional index.""" | ||
with open('data/additional_context.txt', 'w') as f: | ||
f.write(info) | ||
documents = [Document(info)] | ||
index = GPTVectorStoreIndex(documents) | ||
index.save_to_disk('data/additional_index.json') | ||
print("Additional index replaced") | ||
|
||
|
||
if __name__ == "__main__": | ||
"""python3 replace.py <info>""" | ||
info = sys.argv[1] if len(sys.argv) > 1 else None | ||
if info: | ||
replace_additional_index(info) |
Oops, something went wrong.