Skip to content

Commit 50bce40

Browse files
committedDec 22, 2024·
expose more things
1 parent cd91917 commit 50bce40

File tree

2 files changed

+23
-2
lines changed

2 files changed

+23
-2
lines changed
 

‎examples/refresh_vectorstore/tpuf_namespace.py

+17-1
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,22 @@
4747
repo="PrefectHQ/prefect",
4848
include_globs=["flows/"],
4949
),
50+
GitHubRepoLoader(
51+
repo="PrefectHQ/prefect",
52+
include_globs=["src/prefect/*.py"],
53+
),
54+
GitHubRepoLoader(
55+
repo="PrefectHQ/prefect-background-task-examples",
56+
include_globs=["**/*.py", "**/*.md"],
57+
),
58+
GitHubRepoLoader(
59+
repo="zzstoatzz/prefect-pack",
60+
include_globs=["**/*.py", "**/*.md"],
61+
),
62+
GitHubRepoLoader(
63+
repo="zzstoatzz/prefect-monorepo",
64+
include_globs=["**/*.py", "**/*.md", "**/*.yaml"],
65+
),
5066
],
5167
"controlflow": [
5268
SitemapLoader(
@@ -97,7 +113,7 @@ def refresh_tpuf_namespace(
97113
for doc in future.result() # type: ignore
98114
]
99115

100-
print(f"Loaded {len(documents)} documents from the Prefect community.")
116+
print(f"Gathered {len(documents)} documents from the Prefect community.")
101117

102118
with TurboPuffer(namespace=namespace) as tpuf:
103119
if reset:

‎src/raggy/loaders/github.py

+6-1
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,8 @@ class GitHubRepoLoader(Loader):
194194
repo: str = Field(...)
195195
include_globs: list[str] | None = Field(default=None)
196196
exclude_globs: list[str] | None = Field(default=None)
197+
chunk_size: int = Field(default=500)
198+
overlap: float = Field(default=0.1)
197199

198200
@field_validator("repo")
199201
def validate_repo(cls, v: str) -> str:
@@ -243,7 +245,10 @@ async def load(self) -> list[Document]:
243245
Document(
244246
text=await read_file_with_chardet(Path(tmp_dir) / file),
245247
metadata=metadata,
246-
)
248+
),
249+
chunk_size=self.chunk_size,
250+
overlap=self.overlap,
247251
)
248252
)
249253
return documents
254+

0 commit comments

Comments
 (0)
Please sign in to comment.