From 052b25af0a4da5a97aab21d8be05a89fc60cfaed Mon Sep 17 00:00:00 2001 From: sabaimran Date: Fri, 6 Oct 2023 12:29:15 -0700 Subject: [PATCH] Update default configuration passed to Khoj clients to circumvent valiation issues --- src/khoj/utils/constants.py | 53 +++++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) diff --git a/src/khoj/utils/constants.py b/src/khoj/utils/constants.py index c5a67714..8da50d76 100644 --- a/src/khoj/utils/constants.py +++ b/src/khoj/utils/constants.py @@ -6,6 +6,59 @@ empty_escape_sequences = "\n|\r|\t| " app_env_filepath = "~/.khoj/env" telemetry_server = "https://khoj.beta.haletic.com/v1/telemetry" +empty_config = { + "content-type": { + "org": { + "input-files": None, + "input-filter": None, + "compressed-jsonl": "~/.khoj/content/org/org.jsonl.gz", + "embeddings-file": "~/.khoj/content/org/org_embeddings.pt", + "index-heading-entries": False, + }, + "markdown": { + "input-files": None, + "input-filter": None, + "compressed-jsonl": "~/.khoj/content/markdown/markdown.jsonl.gz", + "embeddings-file": "~/.khoj/content/markdown/markdown_embeddings.pt", + }, + "pdf": { + "input-files": None, + "input-filter": None, + "compressed-jsonl": "~/.khoj/content/pdf/pdf.jsonl.gz", + "embeddings-file": "~/.khoj/content/pdf/pdf_embeddings.pt", + }, + "plaintext": { + "input-files": None, + "input-filter": None, + "compressed-jsonl": "~/.khoj/content/plaintext/plaintext.jsonl.gz", + "embeddings-file": "~/.khoj/content/plaintext/plaintext_embeddings.pt", + }, + }, + "search-type": { + "symmetric": { + "encoder": "sentence-transformers/all-MiniLM-L6-v2", + "cross-encoder": "cross-encoder/ms-marco-MiniLM-L-6-v2", + "model_directory": "~/.khoj/search/symmetric/", + }, + "asymmetric": { + "encoder": "sentence-transformers/multi-qa-MiniLM-L6-cos-v1", + "cross-encoder": "cross-encoder/ms-marco-MiniLM-L-6-v2", + "model_directory": "~/.khoj/search/asymmetric/", + }, + "image": {"encoder": "sentence-transformers/clip-ViT-B-32", "model_directory": "~/.khoj/search/image/"}, + }, + "processor": { + "conversation": { + "openai": { + "api-key": None, + "chat-model": "gpt-3.5-turbo", + }, + "enable-offline-chat": False, + "conversation-logfile": "~/.khoj/processor/conversation/conversation_logs.json", + } + }, +} + # default app config to use default_config = { "content-type": {