* ♻️ refactoring codebase index folder * ➕ tree_sitter dependency * 🐛 solve a few indexing bugs * ⚡️ code chunker * ✏️ automatically remove trailing / from serverUrl * 🎨 introduce Chunk class * 🎨 finish chunking refactor
11 lines
302 B
Python
11 lines
302 B
Python
import os
|
|
from typing import Dict
|
|
|
|
|
|
def chunk_metadata(filepath: str, chunk: str) -> Dict[str, str]:
|
|
# TODO: Try adding c-tags to the top of each chunk
|
|
return {}
|
|
|
|
|
|
def format_chunk_with_metadata(filepath: str, chunk: str) -> str:
|
|
return f"```title={os.path.basename(filepath)}\n{chunk}```"
|