Skip to content

Commit 80c8c14

Browse files
committed
Add parse_project example script to demonstrate CodeTide functionality
1 parent a66cb83 commit 80c8c14

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

examples/parse_project.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
from codetide import CodeTide
2+
from codetide.core.common import writeFile
3+
from dotenv import load_dotenv
4+
import asyncio
5+
import os
6+
7+
async def main():
8+
tide = await CodeTide.from_path(os.getenv("AICORE_REPO_PATH"))
9+
tide.serialize()
10+
11+
print(tide.codebase.get_tree_view(include_modules=True))
12+
13+
tide.codebase._build_cached_elements()
14+
output = tide.codebase.get(["aicore.llm.llm.Llm.acomplete", "aicore.llm.providers.base_provider.LlmBaseProvider.acomplete"], degree=1, as_string=True)
15+
16+
writeFile(output, "./storage/context.txt")
17+
18+
if __name__ == "__main__":
19+
load_dotenv()
20+
asyncio.run(main())

0 commit comments

Comments
 (0)