Add separate unit test for github. Will only run of a PAT token is set

This commit is contained in:
Saba
2023-06-13 16:55:58 -07:00
parent 3a61919344
commit 751edfefe5
3 changed files with 29 additions and 1 deletions

View File

@@ -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