remove code_graph example after dev merge
This commit is contained in:
parent
5a2a5f64d2
commit
0fe16939c1
2 changed files with 0 additions and 93 deletions
30
.github/workflows/basic_tests.yml
vendored
30
.github/workflows/basic_tests.yml
vendored
|
|
@ -197,33 +197,3 @@ jobs:
|
||||||
|
|
||||||
- name: Run Simple Examples
|
- name: Run Simple Examples
|
||||||
run: uv run python ./examples/python/simple_example.py
|
run: uv run python ./examples/python/simple_example.py
|
||||||
|
|
||||||
graph-tests:
|
|
||||||
name: Run Basic Graph Tests
|
|
||||||
runs-on: ubuntu-22.04
|
|
||||||
env:
|
|
||||||
ENV: 'dev'
|
|
||||||
LLM_PROVIDER: openai
|
|
||||||
LLM_MODEL: ${{ secrets.LLM_MODEL }}
|
|
||||||
LLM_ENDPOINT: ${{ secrets.LLM_ENDPOINT }}
|
|
||||||
LLM_API_KEY: ${{ secrets.LLM_API_KEY }}
|
|
||||||
LLM_API_VERSION: ${{ secrets.LLM_API_VERSION }}
|
|
||||||
|
|
||||||
EMBEDDING_PROVIDER: openai
|
|
||||||
EMBEDDING_MODEL: ${{ secrets.EMBEDDING_MODEL }}
|
|
||||||
EMBEDDING_ENDPOINT: ${{ secrets.EMBEDDING_ENDPOINT }}
|
|
||||||
EMBEDDING_API_KEY: ${{ secrets.EMBEDDING_API_KEY }}
|
|
||||||
EMBEDDING_API_VERSION: ${{ secrets.EMBEDDING_API_VERSION }}
|
|
||||||
steps:
|
|
||||||
- name: Check out repository
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
with:
|
|
||||||
fetch-depth: 0
|
|
||||||
|
|
||||||
- name: Cognee Setup
|
|
||||||
uses: ./.github/actions/cognee_setup
|
|
||||||
with:
|
|
||||||
python-version: ${{ inputs.python-version }}
|
|
||||||
|
|
||||||
- name: Run Graph Tests
|
|
||||||
run: uv run python ./examples/python/code_graph_example.py --repo_path ./cognee/tasks/graph
|
|
||||||
|
|
|
||||||
|
|
@ -1,63 +0,0 @@
|
||||||
import argparse
|
|
||||||
import asyncio
|
|
||||||
import os
|
|
||||||
|
|
||||||
import cognee
|
|
||||||
from cognee import SearchType
|
|
||||||
from cognee.shared.logging_utils import setup_logging, ERROR
|
|
||||||
|
|
||||||
from cognee.api.v1.cognify.code_graph_pipeline import run_code_graph_pipeline
|
|
||||||
|
|
||||||
|
|
||||||
async def main(repo_path, include_docs):
|
|
||||||
# Disable permissions feature for this example
|
|
||||||
os.environ["ENABLE_BACKEND_ACCESS_CONTROL"] = "false"
|
|
||||||
|
|
||||||
run_status = False
|
|
||||||
async for run_status in run_code_graph_pipeline(repo_path, include_docs=include_docs):
|
|
||||||
run_status = run_status
|
|
||||||
|
|
||||||
# Test CODE search
|
|
||||||
search_results = await cognee.search(query_type=SearchType.CODE, query_text="test")
|
|
||||||
assert len(search_results) != 0, "The search results list is empty."
|
|
||||||
print("\n\nSearch results are:\n")
|
|
||||||
for result in search_results:
|
|
||||||
print(f"{result}\n")
|
|
||||||
|
|
||||||
return run_status
|
|
||||||
|
|
||||||
|
|
||||||
def parse_args():
|
|
||||||
parser = argparse.ArgumentParser()
|
|
||||||
parser.add_argument("--repo_path", type=str, required=True, help="Path to the repository")
|
|
||||||
parser.add_argument(
|
|
||||||
"--include_docs",
|
|
||||||
type=lambda x: x.lower() in ("true", "1"),
|
|
||||||
default=False,
|
|
||||||
help="Whether or not to process non-code files",
|
|
||||||
)
|
|
||||||
parser.add_argument(
|
|
||||||
"--time",
|
|
||||||
type=lambda x: x.lower() in ("true", "1"),
|
|
||||||
default=True,
|
|
||||||
help="Whether or not to time the pipeline run",
|
|
||||||
)
|
|
||||||
return parser.parse_args()
|
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
|
||||||
logger = setup_logging(log_level=ERROR)
|
|
||||||
|
|
||||||
args = parse_args()
|
|
||||||
|
|
||||||
if args.time:
|
|
||||||
import time
|
|
||||||
|
|
||||||
start_time = time.time()
|
|
||||||
asyncio.run(main(args.repo_path, args.include_docs))
|
|
||||||
end_time = time.time()
|
|
||||||
print("\n" + "=" * 50)
|
|
||||||
print(f"Pipeline Execution Time: {end_time - start_time:.2f} seconds")
|
|
||||||
print("=" * 50 + "\n")
|
|
||||||
else:
|
|
||||||
asyncio.run(main(args.repo_path, args.include_docs))
|
|
||||||
Loading…
Add table
Reference in a new issue