mirror of
https://github.com/khoaliber/khoj.git
synced 2026-03-03 21:29:08 +00:00
Add separate unit test for github. Will only run of a PAT token is set
This commit is contained in:
@@ -16,6 +16,7 @@ from khoj.utils.rawconfig import (
|
||||
ConversationProcessorConfig,
|
||||
ProcessorConfig,
|
||||
TextContentConfig,
|
||||
GithubContentConfig,
|
||||
ImageContentConfig,
|
||||
SearchConfig,
|
||||
TextSearchConfig,
|
||||
@@ -89,6 +90,15 @@ def content_config(tmp_path_factory, search_config: SearchConfig):
|
||||
)
|
||||
}
|
||||
|
||||
content_config.github = GithubContentConfig(
|
||||
pat_token=os.getenv("GITHUB_PAT_TOKEN"),
|
||||
repo_name="lantern",
|
||||
repo_owner="khoj-ai",
|
||||
repo_branch="master",
|
||||
compressed_jsonl=content_dir.joinpath("github.jsonl.gz"),
|
||||
embeddings_file=content_dir.joinpath("github_embeddings.pt"),
|
||||
)
|
||||
|
||||
filters = [DateFilter(), WordFilter(), FileFilter()]
|
||||
text_search.setup(
|
||||
JsonlToJsonl, content_config.plugins["plugin1"], search_config.asymmetric, regenerate=False, filters=filters
|
||||
|
||||
Reference in New Issue
Block a user