Skip to content

Commit 39e73c3

Browse files
authored
Merge pull request #1576 from arc53/dependabot/pip/application/portalocker-3.1.1
build(deps): bump portalocker from 2.10.1 to 3.1.1 in /application
2 parents 8a7aeee + 39b36b6 commit 39e73c3

File tree

3 files changed

+51
-4
lines changed

3 files changed

+51
-4
lines changed

application/requirements.txt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ pandas==2.2.3
5555
openpyxl==3.1.5
5656
pathable==0.4.4
5757
pillow==11.1.0
58-
portalocker==2.10.1
58+
portalocker==3.1.1
5959
prance==23.6.21.0
6060
primp==0.14.0
6161
prompt-toolkit==3.0.50
@@ -71,7 +71,6 @@ python-dateutil==2.9.0.post0
7171
python-dotenv==1.0.1
7272
python-jose==3.4.0
7373
python-pptx==1.0.2
74-
qdrant-client==1.13.2
7574
redis==5.2.1
7675
referencing==0.30.2
7776
regex==2024.11.6

application/vectorstore/qdrant.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
1-
from langchain_community.vectorstores.qdrant import Qdrant
21
from application.vectorstore.base import BaseVectorStore
32
from application.core.settings import settings
4-
from qdrant_client import models
53

64

75
class QdrantStore(BaseVectorStore):
86
def __init__(self, source_id: str = "", embeddings_key: str = "embeddings"):
7+
from qdrant_client import models
8+
from langchain_community.vectorstores.qdrant import Qdrant
9+
910
self._filter = models.Filter(
1011
must=[
1112
models.FieldCondition(

md-gen.py

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
import os
2+
3+
def create_markdown_from_directory(directory=".", output_file="combined.md"):
4+
"""
5+
Recursively traverses the given directory, reads all files (ignoring files/folders in ignore_list),
6+
and creates a single markdown file containing the contents of each file, prefixed with the
7+
relative path of the file.
8+
9+
Args:
10+
directory (str): The directory to traverse. Defaults to the current directory.
11+
output_file (str): The name of the output markdown file. Defaults to 'combined.md'.
12+
"""
13+
ignore_list = [
14+
"node_modules", "__pycache__", ".git", ".DS_Store", "inputs", "indexes",
15+
"model", "models", ".venv", "temp", ".pytest_cache", ".ruff_cache",
16+
"extensions", "dir_tree.py", "map.txt", "signal-desktop-keyring.gpg",
17+
".husky", ".next", "docs", "index.pkl", "index.faiss", "assets", "fonts", "public",
18+
"yarn.lock", "package-lock.json",
19+
]
20+
21+
with open(output_file, "w", encoding="utf-8") as outfile:
22+
for root, dirs, files in os.walk(directory):
23+
# Filter out directories in ignore_list so they won't be traversed
24+
dirs[:] = [d for d in dirs if d not in ignore_list]
25+
26+
for filename in files:
27+
if filename in ignore_list:
28+
continue
29+
filepath = os.path.join(root, filename)
30+
31+
try:
32+
with open(filepath, "r", encoding="utf-8") as infile:
33+
content = infile.read()
34+
35+
# Get a relative path to better indicate file location
36+
rel_path = os.path.relpath(filepath, directory)
37+
outfile.write(f"## File: {rel_path}\n\n")
38+
outfile.write(content)
39+
outfile.write("\n\n---\n\n") # Separator between files
40+
41+
except Exception as e:
42+
print(f"Error processing file {filepath}: {e}")
43+
44+
print(f"Successfully created {output_file}")
45+
46+
if __name__ == "__main__":
47+
create_markdown_from_directory()

0 commit comments

Comments
 (0)