cognee/examples/python/code_graph_pipeline.py
Boris 64b8aac86f
feat: code graph swe integration
Co-authored-by: hajdul88 <52442977+hajdul88@users.noreply.github.com>
Co-authored-by: hande-k <handekafkas7@gmail.com>
Co-authored-by: Igor Ilic <igorilic03@gmail.com>
Co-authored-by: Vasilije <8619304+Vasilije1990@users.noreply.github.com>
Co-authored-by: Igor Ilic <30923996+dexters1@users.noreply.github.com>
2024-11-27 09:32:29 +01:00

36 lines
1.1 KiB
Python

import asyncio
from cognee.modules.pipelines import Task, run_tasks
from cognee.tasks.repo_processor import (
enrich_dependency_graph,
expand_dependency_graph,
get_repo_file_dependencies,
)
from cognee.tasks.storage import add_data_points
from cognee.tasks.summarization import summarize_code
async def print_results(pipeline):
async for result in pipeline:
print(result)
if __name__ == "__main__":
'''
parser = argparse.ArgumentParser(description="Process a file path")
parser.add_argument("path", help="Path to the file")
args = parser.parse_args()
abspath = os.path.abspath(args.path or ".")
'''
abspath = '/Users/laszlohajdu/Documents/Github/RAW_GIT_REPOS/astropy__astropy-12907'
tasks = [
Task(get_repo_file_dependencies),
Task(add_data_points),
Task(enrich_dependency_graph),
Task(expand_dependency_graph),
Task(add_data_points),
# Task(summarize_code, summarization_model = SummarizedContent),
]
pipeline = run_tasks(tasks, abspath, "cognify_code_pipeline")
asyncio.run(print_results(pipeline))