khoj 1.33.3.dev32__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- khoj/__init__.py +0 -0
- khoj/app/README.md +94 -0
- khoj/app/__init__.py +0 -0
- khoj/app/asgi.py +16 -0
- khoj/app/settings.py +218 -0
- khoj/app/urls.py +25 -0
- khoj/configure.py +452 -0
- khoj/database/__init__.py +0 -0
- khoj/database/adapters/__init__.py +1821 -0
- khoj/database/admin.py +417 -0
- khoj/database/apps.py +6 -0
- khoj/database/management/__init__.py +0 -0
- khoj/database/management/commands/__init__.py +0 -0
- khoj/database/management/commands/change_default_model.py +116 -0
- khoj/database/management/commands/change_generated_images_url.py +61 -0
- khoj/database/management/commands/convert_images_png_to_webp.py +99 -0
- khoj/database/migrations/0001_khojuser.py +98 -0
- khoj/database/migrations/0002_googleuser.py +32 -0
- khoj/database/migrations/0003_vector_extension.py +10 -0
- khoj/database/migrations/0004_content_types_and_more.py +181 -0
- khoj/database/migrations/0005_embeddings_corpus_id.py +19 -0
- khoj/database/migrations/0006_embeddingsdates.py +33 -0
- khoj/database/migrations/0007_add_conversation.py +27 -0
- khoj/database/migrations/0008_alter_conversation_conversation_log.py +17 -0
- khoj/database/migrations/0009_khojapiuser.py +24 -0
- khoj/database/migrations/0010_chatmodeloptions_and_more.py +83 -0
- khoj/database/migrations/0010_rename_embeddings_entry_and_more.py +30 -0
- khoj/database/migrations/0011_merge_20231102_0138.py +14 -0
- khoj/database/migrations/0012_entry_file_source.py +21 -0
- khoj/database/migrations/0013_subscription.py +37 -0
- khoj/database/migrations/0014_alter_googleuser_picture.py +17 -0
- khoj/database/migrations/0015_alter_subscription_user.py +21 -0
- khoj/database/migrations/0016_alter_subscription_renewal_date.py +17 -0
- khoj/database/migrations/0017_searchmodel.py +32 -0
- khoj/database/migrations/0018_searchmodelconfig_delete_searchmodel.py +30 -0
- khoj/database/migrations/0019_alter_googleuser_family_name_and_more.py +27 -0
- khoj/database/migrations/0020_reflectivequestion.py +36 -0
- khoj/database/migrations/0021_speechtotextmodeloptions_and_more.py +42 -0
- khoj/database/migrations/0022_texttoimagemodelconfig.py +25 -0
- khoj/database/migrations/0023_usersearchmodelconfig.py +33 -0
- khoj/database/migrations/0024_alter_entry_embeddings.py +18 -0
- khoj/database/migrations/0025_clientapplication_khojuser_phone_number_and_more.py +46 -0
- khoj/database/migrations/0025_searchmodelconfig_embeddings_inference_endpoint_and_more.py +22 -0
- khoj/database/migrations/0026_searchmodelconfig_cross_encoder_inference_endpoint_and_more.py +22 -0
- khoj/database/migrations/0027_merge_20240118_1324.py +13 -0
- khoj/database/migrations/0028_khojuser_verified_phone_number.py +17 -0
- khoj/database/migrations/0029_userrequests.py +27 -0
- khoj/database/migrations/0030_conversation_slug_and_title.py +38 -0
- khoj/database/migrations/0031_agent_conversation_agent.py +53 -0
- khoj/database/migrations/0031_alter_googleuser_locale.py +30 -0
- khoj/database/migrations/0032_merge_20240322_0427.py +14 -0
- khoj/database/migrations/0033_rename_tuning_agent_personality.py +17 -0
- khoj/database/migrations/0034_alter_chatmodeloptions_chat_model.py +32 -0
- khoj/database/migrations/0035_processlock.py +26 -0
- khoj/database/migrations/0036_alter_processlock_name.py +19 -0
- khoj/database/migrations/0036_delete_offlinechatprocessorconversationconfig.py +15 -0
- khoj/database/migrations/0036_publicconversation.py +42 -0
- khoj/database/migrations/0037_chatmodeloptions_openai_config_and_more.py +51 -0
- khoj/database/migrations/0037_searchmodelconfig_bi_encoder_docs_encode_config_and_more.py +32 -0
- khoj/database/migrations/0038_merge_20240425_0857.py +14 -0
- khoj/database/migrations/0038_merge_20240426_1640.py +12 -0
- khoj/database/migrations/0039_merge_20240501_0301.py +12 -0
- khoj/database/migrations/0040_alter_processlock_name.py +26 -0
- khoj/database/migrations/0040_merge_20240504_1010.py +14 -0
- khoj/database/migrations/0041_merge_20240505_1234.py +14 -0
- khoj/database/migrations/0042_serverchatsettings.py +46 -0
- khoj/database/migrations/0043_alter_chatmodeloptions_model_type.py +21 -0
- khoj/database/migrations/0044_conversation_file_filters.py +17 -0
- khoj/database/migrations/0045_fileobject.py +37 -0
- khoj/database/migrations/0046_khojuser_email_verification_code_and_more.py +22 -0
- khoj/database/migrations/0047_alter_entry_file_type.py +31 -0
- khoj/database/migrations/0048_voicemodeloption_uservoicemodelconfig.py +52 -0
- khoj/database/migrations/0049_datastore.py +38 -0
- khoj/database/migrations/0049_texttoimagemodelconfig_api_key_and_more.py +58 -0
- khoj/database/migrations/0050_alter_processlock_name.py +25 -0
- khoj/database/migrations/0051_merge_20240702_1220.py +14 -0
- khoj/database/migrations/0052_alter_searchmodelconfig_bi_encoder_docs_encode_config_and_more.py +27 -0
- khoj/database/migrations/0053_agent_style_color_agent_style_icon.py +61 -0
- khoj/database/migrations/0054_alter_agent_style_color.py +38 -0
- khoj/database/migrations/0055_alter_agent_style_icon.py +37 -0
- khoj/database/migrations/0056_chatmodeloptions_vision_enabled.py +17 -0
- khoj/database/migrations/0056_searchmodelconfig_cross_encoder_model_config.py +17 -0
- khoj/database/migrations/0057_merge_20240816_1409.py +13 -0
- khoj/database/migrations/0057_remove_serverchatsettings_default_model_and_more.py +51 -0
- khoj/database/migrations/0058_alter_chatmodeloptions_chat_model.py +17 -0
- khoj/database/migrations/0059_searchmodelconfig_bi_encoder_confidence_threshold.py +17 -0
- khoj/database/migrations/0060_merge_20240905_1828.py +14 -0
- khoj/database/migrations/0061_alter_chatmodeloptions_model_type.py +26 -0
- khoj/database/migrations/0061_alter_texttoimagemodelconfig_model_type.py +21 -0
- khoj/database/migrations/0062_merge_20240913_0222.py +14 -0
- khoj/database/migrations/0063_conversation_temp_id.py +36 -0
- khoj/database/migrations/0064_remove_conversation_temp_id_alter_conversation_id.py +86 -0
- khoj/database/migrations/0065_remove_agent_avatar_remove_agent_public_and_more.py +49 -0
- khoj/database/migrations/0066_remove_agent_tools_agent_input_tools_and_more.py +69 -0
- khoj/database/migrations/0067_alter_agent_style_icon.py +50 -0
- khoj/database/migrations/0068_alter_agent_output_modes.py +24 -0
- khoj/database/migrations/0069_webscraper_serverchatsettings_web_scraper.py +89 -0
- khoj/database/migrations/0070_alter_agent_input_tools_alter_agent_output_modes.py +46 -0
- khoj/database/migrations/0071_subscription_enabled_trial_at_and_more.py +32 -0
- khoj/database/migrations/0072_entry_search_model.py +24 -0
- khoj/database/migrations/0073_delete_usersearchmodelconfig.py +15 -0
- khoj/database/migrations/0074_alter_conversation_title.py +17 -0
- khoj/database/migrations/0075_migrate_generated_assets_and_validate.py +85 -0
- khoj/database/migrations/0076_rename_openaiprocessorconversationconfig_aimodelapi_and_more.py +26 -0
- khoj/database/migrations/0077_chatmodel_alter_agent_chat_model_and_more.py +62 -0
- khoj/database/migrations/0078_khojuser_email_verification_code_expiry.py +17 -0
- khoj/database/migrations/__init__.py +0 -0
- khoj/database/models/__init__.py +725 -0
- khoj/database/tests.py +3 -0
- khoj/interface/compiled/404/index.html +1 -0
- khoj/interface/compiled/_next/static/Tg-vU1p1B-YKT5Qv8KSHt/_buildManifest.js +1 -0
- khoj/interface/compiled/_next/static/Tg-vU1p1B-YKT5Qv8KSHt/_ssgManifest.js +1 -0
- khoj/interface/compiled/_next/static/chunks/1010-8f39bb4648b5ba10.js +1 -0
- khoj/interface/compiled/_next/static/chunks/182-f1c48a203dc91e0e.js +20 -0
- khoj/interface/compiled/_next/static/chunks/1915-d3c36ad6ce697ce7.js +1 -0
- khoj/interface/compiled/_next/static/chunks/2117-165ef4747a5b836b.js +2 -0
- khoj/interface/compiled/_next/static/chunks/2581-455000f8aeb08fc3.js +1 -0
- khoj/interface/compiled/_next/static/chunks/3727.dcea8f2193111552.js +1 -0
- khoj/interface/compiled/_next/static/chunks/3789-a09e37a819171a9d.js +1 -0
- khoj/interface/compiled/_next/static/chunks/4124-6c28322ce218d2d5.js +1 -0
- khoj/interface/compiled/_next/static/chunks/5427-b52d95253e692bfa.js +1 -0
- khoj/interface/compiled/_next/static/chunks/5473-b1cf56dedac6577a.js +1 -0
- khoj/interface/compiled/_next/static/chunks/5477-0bbddb79c25a54a7.js +1 -0
- khoj/interface/compiled/_next/static/chunks/6065-64db9ad305ba0bcd.js +1 -0
- khoj/interface/compiled/_next/static/chunks/6293-469dd16402ea8a6f.js +3 -0
- khoj/interface/compiled/_next/static/chunks/688-b5b4391bbc0376f1.js +1 -0
- khoj/interface/compiled/_next/static/chunks/8667-b6bf63c72b2d76eb.js +1 -0
- khoj/interface/compiled/_next/static/chunks/9259-1172dbaca0515237.js +1 -0
- khoj/interface/compiled/_next/static/chunks/94ca1967.1d9b42d929a1ee8c.js +1 -0
- khoj/interface/compiled/_next/static/chunks/9597.83583248dfbf6e73.js +1 -0
- khoj/interface/compiled/_next/static/chunks/964ecbae.51d6faf8801d15e6.js +1 -0
- khoj/interface/compiled/_next/static/chunks/9665-391df1e5c51c960a.js +1 -0
- khoj/interface/compiled/_next/static/chunks/app/_not-found/page-a834eddae3e235df.js +1 -0
- khoj/interface/compiled/_next/static/chunks/app/agents/layout-e00fb81dca656a10.js +1 -0
- khoj/interface/compiled/_next/static/chunks/app/agents/page-28ce086a1129bca2.js +1 -0
- khoj/interface/compiled/_next/static/chunks/app/automations/layout-1fe1537449f43496.js +1 -0
- khoj/interface/compiled/_next/static/chunks/app/automations/page-bf365a60829d347f.js +1 -0
- khoj/interface/compiled/_next/static/chunks/app/chat/layout-33934fc2d6ae6838.js +1 -0
- khoj/interface/compiled/_next/static/chunks/app/chat/page-0e476e57eb2015e3.js +1 -0
- khoj/interface/compiled/_next/static/chunks/app/layout-30e7fda7262713ce.js +1 -0
- khoj/interface/compiled/_next/static/chunks/app/page-a5515ea71aec5ef0.js +1 -0
- khoj/interface/compiled/_next/static/chunks/app/search/layout-c02531d586972d7d.js +1 -0
- khoj/interface/compiled/_next/static/chunks/app/search/page-9140541e67ea307d.js +1 -0
- khoj/interface/compiled/_next/static/chunks/app/settings/layout-d09d6510a45cd4bd.js +1 -0
- khoj/interface/compiled/_next/static/chunks/app/settings/page-951ba40b5b94b23a.js +1 -0
- khoj/interface/compiled/_next/static/chunks/app/share/chat/layout-e8e5db7830bf3f47.js +1 -0
- khoj/interface/compiled/_next/static/chunks/app/share/chat/page-1beb80d8d741c932.js +1 -0
- khoj/interface/compiled/_next/static/chunks/d3ac728e-44ebd2a0c99b12a0.js +1 -0
- khoj/interface/compiled/_next/static/chunks/fd9d1056-4482b99a36fd1673.js +1 -0
- khoj/interface/compiled/_next/static/chunks/framework-8e0e0f4a6b83a956.js +1 -0
- khoj/interface/compiled/_next/static/chunks/main-app-de1f09df97a3cfc7.js +1 -0
- khoj/interface/compiled/_next/static/chunks/main-db4bfac6b0a8d00b.js +1 -0
- khoj/interface/compiled/_next/static/chunks/pages/_app-3c9ca398d360b709.js +1 -0
- khoj/interface/compiled/_next/static/chunks/pages/_error-cf5ca766ac8f493f.js +1 -0
- khoj/interface/compiled/_next/static/chunks/polyfills-42372ed130431b0a.js +1 -0
- khoj/interface/compiled/_next/static/chunks/webpack-a03962458328b163.js +1 -0
- khoj/interface/compiled/_next/static/css/089de1d8526b96e9.css +1 -0
- khoj/interface/compiled/_next/static/css/37a73b87f02df402.css +1 -0
- khoj/interface/compiled/_next/static/css/4e4e6a4a1c920d06.css +1 -0
- khoj/interface/compiled/_next/static/css/8d02837c730f8d13.css +25 -0
- khoj/interface/compiled/_next/static/css/8e6a3ca11a60b189.css +1 -0
- khoj/interface/compiled/_next/static/css/9c164d9727dd8092.css +1 -0
- khoj/interface/compiled/_next/static/css/dac88c17aaee5fcf.css +1 -0
- khoj/interface/compiled/_next/static/css/df4b47a2d0d85eae.css +1 -0
- khoj/interface/compiled/_next/static/css/e4eb883b5265d372.css +1 -0
- khoj/interface/compiled/_next/static/media/1d8a05b60287ae6c-s.p.woff2 +0 -0
- khoj/interface/compiled/_next/static/media/6f22fce21a7c433c-s.woff2 +0 -0
- khoj/interface/compiled/_next/static/media/77c207b095007c34-s.p.woff2 +0 -0
- khoj/interface/compiled/_next/static/media/82ef96de0e8f4d8c-s.p.woff2 +0 -0
- khoj/interface/compiled/_next/static/media/KaTeX_AMS-Regular.1608a09b.woff +0 -0
- khoj/interface/compiled/_next/static/media/KaTeX_AMS-Regular.4aafdb68.ttf +0 -0
- khoj/interface/compiled/_next/static/media/KaTeX_AMS-Regular.a79f1c31.woff2 +0 -0
- khoj/interface/compiled/_next/static/media/KaTeX_Caligraphic-Bold.b6770918.woff +0 -0
- khoj/interface/compiled/_next/static/media/KaTeX_Caligraphic-Bold.cce5b8ec.ttf +0 -0
- khoj/interface/compiled/_next/static/media/KaTeX_Caligraphic-Bold.ec17d132.woff2 +0 -0
- khoj/interface/compiled/_next/static/media/KaTeX_Caligraphic-Regular.07ef19e7.ttf +0 -0
- khoj/interface/compiled/_next/static/media/KaTeX_Caligraphic-Regular.55fac258.woff2 +0 -0
- khoj/interface/compiled/_next/static/media/KaTeX_Caligraphic-Regular.dad44a7f.woff +0 -0
- khoj/interface/compiled/_next/static/media/KaTeX_Fraktur-Bold.9f256b85.woff +0 -0
- khoj/interface/compiled/_next/static/media/KaTeX_Fraktur-Bold.b18f59e1.ttf +0 -0
- khoj/interface/compiled/_next/static/media/KaTeX_Fraktur-Bold.d42a5579.woff2 +0 -0
- khoj/interface/compiled/_next/static/media/KaTeX_Fraktur-Regular.7c187121.woff +0 -0
- khoj/interface/compiled/_next/static/media/KaTeX_Fraktur-Regular.d3c882a6.woff2 +0 -0
- khoj/interface/compiled/_next/static/media/KaTeX_Fraktur-Regular.ed38e79f.ttf +0 -0
- khoj/interface/compiled/_next/static/media/KaTeX_Main-Bold.b74a1a8b.ttf +0 -0
- khoj/interface/compiled/_next/static/media/KaTeX_Main-Bold.c3fb5ac2.woff2 +0 -0
- khoj/interface/compiled/_next/static/media/KaTeX_Main-Bold.d181c465.woff +0 -0
- khoj/interface/compiled/_next/static/media/KaTeX_Main-BoldItalic.6f2bb1df.woff2 +0 -0
- khoj/interface/compiled/_next/static/media/KaTeX_Main-BoldItalic.70d8b0a5.ttf +0 -0
- khoj/interface/compiled/_next/static/media/KaTeX_Main-BoldItalic.e3f82f9d.woff +0 -0
- khoj/interface/compiled/_next/static/media/KaTeX_Main-Italic.47373d1e.ttf +0 -0
- khoj/interface/compiled/_next/static/media/KaTeX_Main-Italic.8916142b.woff2 +0 -0
- khoj/interface/compiled/_next/static/media/KaTeX_Main-Italic.9024d815.woff +0 -0
- khoj/interface/compiled/_next/static/media/KaTeX_Main-Regular.0462f03b.woff2 +0 -0
- khoj/interface/compiled/_next/static/media/KaTeX_Main-Regular.7f51fe03.woff +0 -0
- khoj/interface/compiled/_next/static/media/KaTeX_Main-Regular.b7f8fe9b.ttf +0 -0
- khoj/interface/compiled/_next/static/media/KaTeX_Math-BoldItalic.572d331f.woff2 +0 -0
- khoj/interface/compiled/_next/static/media/KaTeX_Math-BoldItalic.a879cf83.ttf +0 -0
- khoj/interface/compiled/_next/static/media/KaTeX_Math-BoldItalic.f1035d8d.woff +0 -0
- khoj/interface/compiled/_next/static/media/KaTeX_Math-Italic.5295ba48.woff +0 -0
- khoj/interface/compiled/_next/static/media/KaTeX_Math-Italic.939bc644.ttf +0 -0
- khoj/interface/compiled/_next/static/media/KaTeX_Math-Italic.f28c23ac.woff2 +0 -0
- khoj/interface/compiled/_next/static/media/KaTeX_SansSerif-Bold.8c5b5494.woff2 +0 -0
- khoj/interface/compiled/_next/static/media/KaTeX_SansSerif-Bold.94e1e8dc.ttf +0 -0
- khoj/interface/compiled/_next/static/media/KaTeX_SansSerif-Bold.bf59d231.woff +0 -0
- khoj/interface/compiled/_next/static/media/KaTeX_SansSerif-Italic.3b1e59b3.woff2 +0 -0
- khoj/interface/compiled/_next/static/media/KaTeX_SansSerif-Italic.7c9bc82b.woff +0 -0
- khoj/interface/compiled/_next/static/media/KaTeX_SansSerif-Italic.b4c20c84.ttf +0 -0
- khoj/interface/compiled/_next/static/media/KaTeX_SansSerif-Regular.74048478.woff +0 -0
- khoj/interface/compiled/_next/static/media/KaTeX_SansSerif-Regular.ba21ed5f.woff2 +0 -0
- khoj/interface/compiled/_next/static/media/KaTeX_SansSerif-Regular.d4d7ba48.ttf +0 -0
- khoj/interface/compiled/_next/static/media/KaTeX_Script-Regular.03e9641d.woff2 +0 -0
- khoj/interface/compiled/_next/static/media/KaTeX_Script-Regular.07505710.woff +0 -0
- khoj/interface/compiled/_next/static/media/KaTeX_Script-Regular.fe9cbbe1.ttf +0 -0
- khoj/interface/compiled/_next/static/media/KaTeX_Size1-Regular.e1e279cb.woff +0 -0
- khoj/interface/compiled/_next/static/media/KaTeX_Size1-Regular.eae34984.woff2 +0 -0
- khoj/interface/compiled/_next/static/media/KaTeX_Size1-Regular.fabc004a.ttf +0 -0
- khoj/interface/compiled/_next/static/media/KaTeX_Size2-Regular.57727022.woff +0 -0
- khoj/interface/compiled/_next/static/media/KaTeX_Size2-Regular.5916a24f.woff2 +0 -0
- khoj/interface/compiled/_next/static/media/KaTeX_Size2-Regular.d6b476ec.ttf +0 -0
- khoj/interface/compiled/_next/static/media/KaTeX_Size3-Regular.9acaf01c.woff +0 -0
- khoj/interface/compiled/_next/static/media/KaTeX_Size3-Regular.a144ef58.ttf +0 -0
- khoj/interface/compiled/_next/static/media/KaTeX_Size3-Regular.b4230e7e.woff2 +0 -0
- khoj/interface/compiled/_next/static/media/KaTeX_Size4-Regular.10d95fd3.woff2 +0 -0
- khoj/interface/compiled/_next/static/media/KaTeX_Size4-Regular.7a996c9d.woff +0 -0
- khoj/interface/compiled/_next/static/media/KaTeX_Size4-Regular.fbccdabe.ttf +0 -0
- khoj/interface/compiled/_next/static/media/KaTeX_Typewriter-Regular.6258592b.woff +0 -0
- khoj/interface/compiled/_next/static/media/KaTeX_Typewriter-Regular.a8709e36.woff2 +0 -0
- khoj/interface/compiled/_next/static/media/KaTeX_Typewriter-Regular.d97aaf4a.ttf +0 -0
- khoj/interface/compiled/_next/static/media/a6ecd16fa044d500-s.p.woff2 +0 -0
- khoj/interface/compiled/_next/static/media/bd82c78e5b7b3fe9-s.p.woff2 +0 -0
- khoj/interface/compiled/_next/static/media/c32c8052c071fc42-s.woff2 +0 -0
- khoj/interface/compiled/_next/static/media/c4250770ab8708b6-s.p.woff2 +0 -0
- khoj/interface/compiled/_next/static/media/e098aaaecc9cfbb2-s.p.woff2 +0 -0
- khoj/interface/compiled/_next/static/media/flags.3afdda2f.webp +0 -0
- khoj/interface/compiled/_next/static/media/flags@2x.5fbe9fc1.webp +0 -0
- khoj/interface/compiled/_next/static/media/globe.98e105ca.webp +0 -0
- khoj/interface/compiled/_next/static/media/globe@2x.974df6f8.webp +0 -0
- khoj/interface/compiled/agents/index.html +1 -0
- khoj/interface/compiled/agents/index.txt +7 -0
- khoj/interface/compiled/agents.svg +6 -0
- khoj/interface/compiled/assets/icons/khoj_lantern.ico +0 -0
- khoj/interface/compiled/assets/icons/khoj_lantern.svg +100 -0
- khoj/interface/compiled/assets/icons/khoj_lantern_1200x1200.png +0 -0
- khoj/interface/compiled/assets/icons/khoj_lantern_128x128.png +0 -0
- khoj/interface/compiled/assets/icons/khoj_lantern_128x128_dark.png +0 -0
- khoj/interface/compiled/assets/icons/khoj_lantern_256x256.png +0 -0
- khoj/interface/compiled/assets/icons/khoj_lantern_512x512.png +0 -0
- khoj/interface/compiled/assets/icons/khoj_lantern_logomarktype_1200x630.png +0 -0
- khoj/interface/compiled/assets/samples/desktop-browse-draw-sample.png +0 -0
- khoj/interface/compiled/assets/samples/desktop-plain-chat-sample.png +0 -0
- khoj/interface/compiled/assets/samples/desktop-remember-plan-sample.png +0 -0
- khoj/interface/compiled/assets/samples/phone-browse-draw-sample.png +0 -0
- khoj/interface/compiled/assets/samples/phone-plain-chat-sample.png +0 -0
- khoj/interface/compiled/assets/samples/phone-remember-plan-sample.png +0 -0
- khoj/interface/compiled/automation.svg +37 -0
- khoj/interface/compiled/automations/index.html +1 -0
- khoj/interface/compiled/automations/index.txt +8 -0
- khoj/interface/compiled/chat/index.html +1 -0
- khoj/interface/compiled/chat/index.txt +7 -0
- khoj/interface/compiled/chat.svg +24 -0
- khoj/interface/compiled/close.svg +5 -0
- khoj/interface/compiled/copy-button-success.svg +6 -0
- khoj/interface/compiled/copy-button.svg +5 -0
- khoj/interface/compiled/index.html +1 -0
- khoj/interface/compiled/index.txt +7 -0
- khoj/interface/compiled/khoj.webmanifest +76 -0
- khoj/interface/compiled/logo.svg +24 -0
- khoj/interface/compiled/search/index.html +1 -0
- khoj/interface/compiled/search/index.txt +7 -0
- khoj/interface/compiled/send.svg +1 -0
- khoj/interface/compiled/settings/index.html +1 -0
- khoj/interface/compiled/settings/index.txt +9 -0
- khoj/interface/compiled/share/chat/index.html +1 -0
- khoj/interface/compiled/share/chat/index.txt +7 -0
- khoj/interface/compiled/share.svg +8 -0
- khoj/interface/compiled/thumbs-down.svg +6 -0
- khoj/interface/compiled/thumbs-up.svg +6 -0
- khoj/interface/email/feedback.html +34 -0
- khoj/interface/email/magic_link.html +40 -0
- khoj/interface/email/task.html +37 -0
- khoj/interface/email/welcome.html +90 -0
- khoj/interface/web/.well-known/assetlinks.json +11 -0
- khoj/interface/web/assets/icons/agents.svg +19 -0
- khoj/interface/web/assets/icons/automation.svg +43 -0
- khoj/interface/web/assets/icons/chat.svg +24 -0
- khoj/interface/web/assets/icons/github.svg +1 -0
- khoj/interface/web/assets/icons/khoj-logo-sideways-200.png +0 -0
- khoj/interface/web/assets/icons/khoj-logo-sideways-500.png +0 -0
- khoj/interface/web/assets/icons/khoj-logo-sideways.svg +32 -0
- khoj/interface/web/assets/icons/khoj.svg +26 -0
- khoj/interface/web/assets/icons/logotype.svg +1 -0
- khoj/interface/web/assets/icons/search.svg +57 -0
- khoj/interface/web/assets/icons/sync.svg +4 -0
- khoj/interface/web/assets/khoj.css +237 -0
- khoj/interface/web/assets/utils.js +33 -0
- khoj/interface/web/base_config.html +445 -0
- khoj/interface/web/content_source_github_input.html +208 -0
- khoj/interface/web/login.html +310 -0
- khoj/interface/web/utils.html +48 -0
- khoj/main.py +249 -0
- khoj/manage.py +22 -0
- khoj/migrations/__init__.py +0 -0
- khoj/migrations/migrate_offline_chat_default_model.py +69 -0
- khoj/migrations/migrate_offline_chat_default_model_2.py +71 -0
- khoj/migrations/migrate_offline_chat_schema.py +83 -0
- khoj/migrations/migrate_offline_model.py +29 -0
- khoj/migrations/migrate_processor_config_openai.py +67 -0
- khoj/migrations/migrate_server_pg.py +132 -0
- khoj/migrations/migrate_version.py +17 -0
- khoj/processor/__init__.py +0 -0
- khoj/processor/content/__init__.py +0 -0
- khoj/processor/content/docx/__init__.py +0 -0
- khoj/processor/content/docx/docx_to_entries.py +111 -0
- khoj/processor/content/github/__init__.py +0 -0
- khoj/processor/content/github/github_to_entries.py +226 -0
- khoj/processor/content/images/__init__.py +0 -0
- khoj/processor/content/images/image_to_entries.py +117 -0
- khoj/processor/content/markdown/__init__.py +0 -0
- khoj/processor/content/markdown/markdown_to_entries.py +160 -0
- khoj/processor/content/notion/notion_to_entries.py +259 -0
- khoj/processor/content/org_mode/__init__.py +0 -0
- khoj/processor/content/org_mode/org_to_entries.py +226 -0
- khoj/processor/content/org_mode/orgnode.py +532 -0
- khoj/processor/content/pdf/__init__.py +0 -0
- khoj/processor/content/pdf/pdf_to_entries.py +119 -0
- khoj/processor/content/plaintext/__init__.py +0 -0
- khoj/processor/content/plaintext/plaintext_to_entries.py +117 -0
- khoj/processor/content/text_to_entries.py +296 -0
- khoj/processor/conversation/__init__.py +0 -0
- khoj/processor/conversation/anthropic/__init__.py +0 -0
- khoj/processor/conversation/anthropic/anthropic_chat.py +243 -0
- khoj/processor/conversation/anthropic/utils.py +217 -0
- khoj/processor/conversation/google/__init__.py +0 -0
- khoj/processor/conversation/google/gemini_chat.py +253 -0
- khoj/processor/conversation/google/utils.py +260 -0
- khoj/processor/conversation/offline/__init__.py +0 -0
- khoj/processor/conversation/offline/chat_model.py +308 -0
- khoj/processor/conversation/offline/utils.py +80 -0
- khoj/processor/conversation/offline/whisper.py +15 -0
- khoj/processor/conversation/openai/__init__.py +0 -0
- khoj/processor/conversation/openai/gpt.py +243 -0
- khoj/processor/conversation/openai/utils.py +232 -0
- khoj/processor/conversation/openai/whisper.py +13 -0
- khoj/processor/conversation/prompts.py +1188 -0
- khoj/processor/conversation/utils.py +867 -0
- khoj/processor/embeddings.py +122 -0
- khoj/processor/image/generate.py +215 -0
- khoj/processor/speech/__init__.py +0 -0
- khoj/processor/speech/text_to_speech.py +51 -0
- khoj/processor/tools/__init__.py +0 -0
- khoj/processor/tools/online_search.py +472 -0
- khoj/processor/tools/run_code.py +179 -0
- khoj/routers/__init__.py +0 -0
- khoj/routers/api.py +760 -0
- khoj/routers/api_agents.py +295 -0
- khoj/routers/api_chat.py +1273 -0
- khoj/routers/api_content.py +634 -0
- khoj/routers/api_model.py +123 -0
- khoj/routers/api_phone.py +86 -0
- khoj/routers/api_subscription.py +144 -0
- khoj/routers/auth.py +307 -0
- khoj/routers/email.py +135 -0
- khoj/routers/helpers.py +2333 -0
- khoj/routers/notion.py +85 -0
- khoj/routers/research.py +364 -0
- khoj/routers/storage.py +63 -0
- khoj/routers/twilio.py +36 -0
- khoj/routers/web_client.py +141 -0
- khoj/search_filter/__init__.py +0 -0
- khoj/search_filter/base_filter.py +15 -0
- khoj/search_filter/date_filter.py +215 -0
- khoj/search_filter/file_filter.py +32 -0
- khoj/search_filter/word_filter.py +29 -0
- khoj/search_type/__init__.py +0 -0
- khoj/search_type/text_search.py +255 -0
- khoj/utils/__init__.py +0 -0
- khoj/utils/cli.py +101 -0
- khoj/utils/config.py +81 -0
- khoj/utils/constants.py +51 -0
- khoj/utils/fs_syncer.py +252 -0
- khoj/utils/helpers.py +627 -0
- khoj/utils/initialization.py +301 -0
- khoj/utils/jsonl.py +43 -0
- khoj/utils/models.py +47 -0
- khoj/utils/rawconfig.py +208 -0
- khoj/utils/state.py +48 -0
- khoj/utils/yaml.py +47 -0
- khoj-1.33.3.dev32.dist-info/METADATA +190 -0
- khoj-1.33.3.dev32.dist-info/RECORD +393 -0
- khoj-1.33.3.dev32.dist-info/WHEEL +4 -0
- khoj-1.33.3.dev32.dist-info/entry_points.txt +2 -0
- khoj-1.33.3.dev32.dist-info/licenses/LICENSE +661 -0
@@ -0,0 +1,445 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html data-theme="light">
|
3
|
+
<head>
|
4
|
+
<meta charset="utf-8">
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0 maximum-scale=1.0">
|
6
|
+
<link rel="icon" type="image/png" sizes="128x128" href="https://assets.khoj.dev/khoj_lantern_128x128.png?v={{ khoj_version }}">
|
7
|
+
<title>Khoj</title>
|
8
|
+
<meta http-equiv="Content-Security-Policy"
|
9
|
+
content="default-src 'self' https://assets.khoj.dev;
|
10
|
+
script-src 'self' https://assets.khoj.dev 'unsafe-inline';
|
11
|
+
connect-src 'self' https://ipapi.co/json;
|
12
|
+
style-src 'self' https://assets.khoj.dev 'unsafe-inline' https://fonts.googleapis.com;
|
13
|
+
img-src 'self' data: https://*.khoj.dev https://*.googleusercontent.com;
|
14
|
+
font-src https://assets.khoj.dev https://fonts.gstatic.com;
|
15
|
+
child-src 'none';
|
16
|
+
object-src 'none';">
|
17
|
+
<link rel="stylesheet" href="/static/assets/pico.min.css?v={{ khoj_version }}">
|
18
|
+
<link rel="stylesheet" href="/static/assets/khoj.css?v={{ khoj_version }}">
|
19
|
+
<script
|
20
|
+
integrity="sha384-05IkdNHoAlkhrFVUCCN805WC/h4mcI98GUBssmShF2VJAXKyZTrO/TmJ+4eBo0Cy"
|
21
|
+
crossorigin="anonymous"
|
22
|
+
src="https://assets.khoj.dev/intl-tel-input/intlTelInput.min.js"></script>
|
23
|
+
<link rel="stylesheet" href="https://assets.khoj.dev/intl-tel-input/intlTelInput.css">
|
24
|
+
</head>
|
25
|
+
<script type="text/javascript" src="/static/assets/utils.js?v={{ khoj_version }}"></script>
|
26
|
+
<script type="text/javascript" src="/static/assets/purify.min.js?v={{ khoj_version }}"></script>
|
27
|
+
<body class="khoj-configure">
|
28
|
+
<div class="khoj-header-wrapper">
|
29
|
+
<div class="filler"></div>
|
30
|
+
|
31
|
+
<!--Add Header Logo and Nav Pane-->
|
32
|
+
{% import 'utils.html' as utils %}
|
33
|
+
{{ utils.heading_pane(user_photo, username, is_active, has_documents) }}
|
34
|
+
|
35
|
+
<div class="filler"></div>
|
36
|
+
</div>
|
37
|
+
<div class="content khoj-header-wrapper">
|
38
|
+
<div class="filler"></div>
|
39
|
+
{% block content %}
|
40
|
+
{% endblock %}
|
41
|
+
<div class="filler"></div>
|
42
|
+
</div>
|
43
|
+
</body>
|
44
|
+
<script>
|
45
|
+
const settingsNav = document.getElementById("settings-nav");
|
46
|
+
if (settingsNav) {
|
47
|
+
settingsNav.classList.add("khoj-nav-selected");
|
48
|
+
}
|
49
|
+
</script>
|
50
|
+
<style>
|
51
|
+
html, body {
|
52
|
+
width: 100%;
|
53
|
+
margin: 0;
|
54
|
+
padding: 0;
|
55
|
+
}
|
56
|
+
|
57
|
+
img.khoj-logo {
|
58
|
+
max-width: none!important;
|
59
|
+
}
|
60
|
+
div.khoj-header-wrapper {
|
61
|
+
display: grid;
|
62
|
+
grid-template-columns: 1fr min(70vw, 100%) 1fr;
|
63
|
+
}
|
64
|
+
.circle {
|
65
|
+
width: 52px;
|
66
|
+
height: 52px;
|
67
|
+
}
|
68
|
+
.user-initial {
|
69
|
+
width: 40px;
|
70
|
+
height: 40px;
|
71
|
+
}
|
72
|
+
|
73
|
+
.page {
|
74
|
+
display: grid;
|
75
|
+
grid-auto-flow: row;
|
76
|
+
gap: 32px;
|
77
|
+
}
|
78
|
+
.section {
|
79
|
+
display: grid;
|
80
|
+
justify-self: normal;
|
81
|
+
}
|
82
|
+
|
83
|
+
div.section-manage-files,
|
84
|
+
div.api-settings {
|
85
|
+
display: grid;
|
86
|
+
grid-template-columns: 1fr;
|
87
|
+
justify-items: start;
|
88
|
+
gap: 8px;
|
89
|
+
padding: 24px 24px;
|
90
|
+
background: var(--background-color);
|
91
|
+
border: 1px solid rgb(229, 229, 229);
|
92
|
+
border-radius: 4px;
|
93
|
+
box-shadow: 0px 1px 3px 0px rgba(0,0,0,0.1),0px 1px 2px -1px rgba(0,0,0,0.8);
|
94
|
+
}
|
95
|
+
|
96
|
+
div.section-manage-files {
|
97
|
+
width: 640px;
|
98
|
+
}
|
99
|
+
|
100
|
+
div.api-settings {
|
101
|
+
grid-template-rows: 1fr 1fr auto;
|
102
|
+
}
|
103
|
+
#api-settings-card-description {
|
104
|
+
margin: 8px 0 0 0;
|
105
|
+
}
|
106
|
+
#api-settings-keys-table {
|
107
|
+
margin-bottom: 16px;
|
108
|
+
}
|
109
|
+
|
110
|
+
#phone-number-input-card {
|
111
|
+
grid-template-rows: auto;
|
112
|
+
gap: 20px;
|
113
|
+
}
|
114
|
+
|
115
|
+
div.instructions {
|
116
|
+
font-size: large;
|
117
|
+
}
|
118
|
+
|
119
|
+
.section-title {
|
120
|
+
margin: 0;
|
121
|
+
padding: 0 0 16px 0;
|
122
|
+
font-size: 32;
|
123
|
+
font-weight: normal;
|
124
|
+
}
|
125
|
+
.section-cards {
|
126
|
+
display: grid;
|
127
|
+
grid-template-columns: repeat(2, 1fr);
|
128
|
+
gap: 16px;
|
129
|
+
justify-items: start;
|
130
|
+
}
|
131
|
+
.card {
|
132
|
+
display: grid;
|
133
|
+
grid-template-rows: repeat(3, 1fr);
|
134
|
+
gap: 8px;
|
135
|
+
padding: 24px 16px 8px;
|
136
|
+
width: 100%;
|
137
|
+
height: 180px;
|
138
|
+
background: var(--background-color);
|
139
|
+
border: 1px solid rgb(229, 229, 229);
|
140
|
+
border-radius: 4px;
|
141
|
+
box-shadow: 0px 1px 3px 0px rgba(0,0,0,0.1),0px 1px 2px -1px rgba(0,0,0,0.8);
|
142
|
+
overflow: hidden;
|
143
|
+
}
|
144
|
+
div.finalize-buttons {
|
145
|
+
display: grid;
|
146
|
+
gap: 8px;
|
147
|
+
padding: 32px 0px 0px;
|
148
|
+
width: 320px;
|
149
|
+
border-radius: 4px;
|
150
|
+
overflow: hidden;
|
151
|
+
}
|
152
|
+
div.finalize-buttons button {
|
153
|
+
background-color: var(--primary-hover);
|
154
|
+
}
|
155
|
+
div.finalize-buttons button:hover {
|
156
|
+
background-color: var(--summer-sun);
|
157
|
+
}
|
158
|
+
div#features-hint-text {
|
159
|
+
width: 640px;
|
160
|
+
opacity: 0;
|
161
|
+
transition: opacity 0.5s ease-in-out;
|
162
|
+
overflow: hidden;
|
163
|
+
height: 0;
|
164
|
+
}
|
165
|
+
div#features-hint-text.show {
|
166
|
+
opacity: 1;
|
167
|
+
height: auto;
|
168
|
+
}
|
169
|
+
.card-title-row {
|
170
|
+
display: grid;
|
171
|
+
grid-template-columns: auto 1fr;
|
172
|
+
padding: 0;
|
173
|
+
gap: 12px;
|
174
|
+
}
|
175
|
+
.card-icon {
|
176
|
+
width: 40px;
|
177
|
+
height: 40px;
|
178
|
+
}
|
179
|
+
.card-title {
|
180
|
+
font-size: x-large;
|
181
|
+
font-weight: normal;
|
182
|
+
margin: 0;
|
183
|
+
padding: 0;
|
184
|
+
align-self: end;
|
185
|
+
}
|
186
|
+
.card-title-text {
|
187
|
+
vertical-align: text-top;
|
188
|
+
}
|
189
|
+
.card-description {
|
190
|
+
margin: 0;
|
191
|
+
color: grey;
|
192
|
+
font-size: 16px;
|
193
|
+
}
|
194
|
+
.card-description-row {
|
195
|
+
padding-top: 4px;
|
196
|
+
}
|
197
|
+
.card-action-row {
|
198
|
+
display: grid;
|
199
|
+
grid-auto-flow: row;
|
200
|
+
justify-content: left;
|
201
|
+
}
|
202
|
+
.card-button {
|
203
|
+
border: none;
|
204
|
+
font-weight: bold;
|
205
|
+
color: rgb(64,64,64);
|
206
|
+
background: transparent;
|
207
|
+
font-size: 16px;
|
208
|
+
cursor: pointer;
|
209
|
+
margin: 0;
|
210
|
+
padding: 0;
|
211
|
+
height: 32px;
|
212
|
+
text-align: right;
|
213
|
+
}
|
214
|
+
.primary-button {
|
215
|
+
border: none;
|
216
|
+
color: white;
|
217
|
+
padding: 15px 32px;
|
218
|
+
text-align: center;
|
219
|
+
text-decoration: none;
|
220
|
+
display: inline-block;
|
221
|
+
font-size: 16px;
|
222
|
+
}
|
223
|
+
|
224
|
+
button.card-button {
|
225
|
+
color: var(--flower);
|
226
|
+
background: transparent;
|
227
|
+
font-size: 16px;
|
228
|
+
cursor: pointer;
|
229
|
+
margin: 0;
|
230
|
+
padding: 0;
|
231
|
+
height: 32px;
|
232
|
+
text-align: right;
|
233
|
+
text-align: left;
|
234
|
+
}
|
235
|
+
|
236
|
+
button.remove-file-button:hover {
|
237
|
+
background-color: rgb(255 235 235);
|
238
|
+
border-radius: 3px;
|
239
|
+
border: none;
|
240
|
+
color: var(--flower);
|
241
|
+
padding: 4px;
|
242
|
+
cursor: pointer;
|
243
|
+
}
|
244
|
+
|
245
|
+
button.remove-file-button {
|
246
|
+
background-color: rgb(253 214 214);
|
247
|
+
border-radius: 3px;
|
248
|
+
border: none;
|
249
|
+
color: var(--flower);
|
250
|
+
padding: 4px;
|
251
|
+
width: 32px;
|
252
|
+
margin-bottom: 0px
|
253
|
+
}
|
254
|
+
|
255
|
+
div.file-element {
|
256
|
+
display: grid;
|
257
|
+
grid-template-columns: 1fr 5fr 1fr;
|
258
|
+
border: 1px solid rgb(229, 229, 229);
|
259
|
+
border-radius: 4px;
|
260
|
+
box-shadow: 0px 1px 3px 0px rgba(0,0,0,0.1),0px 1px 2px -1px rgba(0,0,0,0.8);
|
261
|
+
padding: 4px 0;
|
262
|
+
margin-bottom: 8px;
|
263
|
+
justify-items: center;
|
264
|
+
align-items: center;
|
265
|
+
}
|
266
|
+
|
267
|
+
div.remove-button-container {
|
268
|
+
text-align: right;
|
269
|
+
}
|
270
|
+
|
271
|
+
.card-button.happy {
|
272
|
+
color: var(--leaf);
|
273
|
+
}
|
274
|
+
|
275
|
+
img.automation-action-icon {
|
276
|
+
width: 16px;
|
277
|
+
padding-bottom: 2px;
|
278
|
+
}
|
279
|
+
img.automation-row-icon {
|
280
|
+
max-width: 24px;
|
281
|
+
}
|
282
|
+
|
283
|
+
img.configured-icon {
|
284
|
+
max-width: 16px;
|
285
|
+
}
|
286
|
+
|
287
|
+
div.card-action-row.enabled{
|
288
|
+
display: block;
|
289
|
+
}
|
290
|
+
|
291
|
+
img.configured-icon.enabled {
|
292
|
+
display: inline;
|
293
|
+
}
|
294
|
+
|
295
|
+
div.card-action-row.disabled,
|
296
|
+
img.configured-icon.disabled {
|
297
|
+
display: none;
|
298
|
+
}
|
299
|
+
|
300
|
+
.loader {
|
301
|
+
border: 16px solid #f3f3f3; /* Light grey */
|
302
|
+
border-top: 16px solid var(--primary);
|
303
|
+
border-radius: 50%;
|
304
|
+
width: 16px;
|
305
|
+
height: 16px;
|
306
|
+
animation: spin 2s linear infinite;
|
307
|
+
}
|
308
|
+
|
309
|
+
@keyframes spin {
|
310
|
+
0% { transform: rotate(0deg); }
|
311
|
+
100% { transform: rotate(360deg); }
|
312
|
+
}
|
313
|
+
|
314
|
+
#status {
|
315
|
+
padding-top: 32px;
|
316
|
+
}
|
317
|
+
div.finalize-actions {
|
318
|
+
grid-auto-flow: column;
|
319
|
+
grid-gap: 24px;
|
320
|
+
}
|
321
|
+
|
322
|
+
button#logout {
|
323
|
+
font-size: 16px;
|
324
|
+
cursor: pointer;
|
325
|
+
margin: 0;
|
326
|
+
padding: 0;
|
327
|
+
height: 32px;
|
328
|
+
}
|
329
|
+
|
330
|
+
div#notification-banner {
|
331
|
+
background-color: var(--primary);
|
332
|
+
border: 1px solid var(--primary-hover);
|
333
|
+
padding: 8px;
|
334
|
+
box-shadow: 0px 1px 3px 0px rgba(0,0,0,0.1),0px 1px 2px -1px rgba(0,0,0,0.8);
|
335
|
+
}
|
336
|
+
|
337
|
+
div#notification-banner-parent {
|
338
|
+
position: fixed;
|
339
|
+
right: 0;
|
340
|
+
bottom: 0;
|
341
|
+
margin: 20px;
|
342
|
+
}
|
343
|
+
|
344
|
+
select#paint-models,
|
345
|
+
select#search-models,
|
346
|
+
select#voice-models,
|
347
|
+
select#chat-models {
|
348
|
+
margin-bottom: 0;
|
349
|
+
padding: 8px;
|
350
|
+
}
|
351
|
+
|
352
|
+
|
353
|
+
div.api-settings {
|
354
|
+
width: 100%;
|
355
|
+
}
|
356
|
+
|
357
|
+
img.api-key-action:hover {
|
358
|
+
cursor: pointer;
|
359
|
+
}
|
360
|
+
|
361
|
+
a {
|
362
|
+
color: #3b82f6;
|
363
|
+
text-decoration: none;
|
364
|
+
}
|
365
|
+
|
366
|
+
div#phone-number-input-element {
|
367
|
+
display: flex;
|
368
|
+
align-items: center;
|
369
|
+
}
|
370
|
+
|
371
|
+
p#phone-number-plus {
|
372
|
+
padding: 8px;
|
373
|
+
}
|
374
|
+
|
375
|
+
div#clients {
|
376
|
+
grid-gap: 12px;
|
377
|
+
}
|
378
|
+
|
379
|
+
input#country-code-phone-number-input {
|
380
|
+
max-width: 100px;
|
381
|
+
margin-right: 8px;
|
382
|
+
}
|
383
|
+
|
384
|
+
input#country-code-phone-number-input {
|
385
|
+
max-width: 100px;
|
386
|
+
margin-right: 8px;
|
387
|
+
}
|
388
|
+
|
389
|
+
input#profile_given_name {
|
390
|
+
width: 100%;
|
391
|
+
margin: 0;
|
392
|
+
}
|
393
|
+
|
394
|
+
@media screen and (max-width: 700px) {
|
395
|
+
.section-cards {
|
396
|
+
grid-template-columns: 1fr;
|
397
|
+
}
|
398
|
+
}
|
399
|
+
@media only screen and (max-width: 700px) {
|
400
|
+
body {
|
401
|
+
display: grid;
|
402
|
+
grid-template-columns: 1fr;
|
403
|
+
grid-template-rows: 1fr repeat(4, auto);
|
404
|
+
}
|
405
|
+
body > * {
|
406
|
+
grid-column: 1;
|
407
|
+
}
|
408
|
+
|
409
|
+
div.filler {
|
410
|
+
display: none;
|
411
|
+
}
|
412
|
+
|
413
|
+
body.khoj-configure {
|
414
|
+
padding: 0;
|
415
|
+
}
|
416
|
+
|
417
|
+
div.section {
|
418
|
+
padding: 12px;
|
419
|
+
}
|
420
|
+
|
421
|
+
div#features-hint-text {
|
422
|
+
width: 320px;
|
423
|
+
}
|
424
|
+
|
425
|
+
div.khoj-header-wrapper {
|
426
|
+
grid-template-columns: auto;
|
427
|
+
}
|
428
|
+
|
429
|
+
div.section-manage-files,
|
430
|
+
div.api-settings {
|
431
|
+
width: auto;
|
432
|
+
}
|
433
|
+
|
434
|
+
#status {
|
435
|
+
padding-top: 12px;
|
436
|
+
}
|
437
|
+
div.finalize-actions {
|
438
|
+
padding: 12px 0 0;
|
439
|
+
}
|
440
|
+
div.finalize-buttons {
|
441
|
+
padding: 0;
|
442
|
+
}
|
443
|
+
}
|
444
|
+
</style>
|
445
|
+
</html>
|
@@ -0,0 +1,208 @@
|
|
1
|
+
{% extends "base_config.html" %}
|
2
|
+
{% block content %}
|
3
|
+
<div class="page">
|
4
|
+
<div class="section">
|
5
|
+
<h2 class="section-title">
|
6
|
+
<img class="card-icon" src="/static/assets/icons/github.svg?v={{ khoj_version }}" alt="Github">
|
7
|
+
<span class="card-title-text">Github</span>
|
8
|
+
<div class="instructions">
|
9
|
+
<a href="https://docs.khoj.dev/data-sources/github_integration">ⓘ Help</a>
|
10
|
+
</div>
|
11
|
+
</h2>
|
12
|
+
<form>
|
13
|
+
<table>
|
14
|
+
<tr>
|
15
|
+
<td>
|
16
|
+
<label for="pat-token">Personal Access Token</label>
|
17
|
+
</td>
|
18
|
+
<td>
|
19
|
+
<input type="text" id="pat-token" name="pat" value="{{ current_config['pat_token'] }}">
|
20
|
+
</td>
|
21
|
+
</tr>
|
22
|
+
</table>
|
23
|
+
<h4>Repositories</h4>
|
24
|
+
<div id="repositories" class="section-cards">
|
25
|
+
{% for repo in current_config['repos'] %}
|
26
|
+
<div class="card repo" id="repo-card-{{loop.index}}">
|
27
|
+
<label for="repo-owner">Repository Owner</label>
|
28
|
+
<input type="text" id="repo-owner-{{loop.index}}" name="repo_owner" value="{{ repo.owner }}">
|
29
|
+
<label for="repo-name">Repository Name</label>
|
30
|
+
<input type="text" id="repo-name-{{loop.index}}" name="repo_name" value="{{ repo.name}}">
|
31
|
+
<label for="repo-branch">Repository Branch</label>
|
32
|
+
<input type="text" id="repo-branch-{{loop.index}}" name="repo_branch" value="{{ repo.branch }}">
|
33
|
+
<button type="button"
|
34
|
+
class="remove-repo-button"
|
35
|
+
onclick="remove_repo({{loop.index}})"
|
36
|
+
id="remove-repo-button-{{loop.index}}">Remove Repository</button>
|
37
|
+
</div>
|
38
|
+
{% endfor %}
|
39
|
+
</div>
|
40
|
+
<button type="button" id="add-repository-button">Add Repository</button>
|
41
|
+
<div class="section">
|
42
|
+
<div id="success" style="display: none;"></div>
|
43
|
+
<button id="submit" type="submit">Save</button>
|
44
|
+
</div>
|
45
|
+
</form>
|
46
|
+
</div>
|
47
|
+
</div>
|
48
|
+
<style>
|
49
|
+
td {
|
50
|
+
padding: 10px 0;
|
51
|
+
}
|
52
|
+
div.repo {
|
53
|
+
width: 100%;
|
54
|
+
height: 100%;
|
55
|
+
grid-template-rows: none;
|
56
|
+
}
|
57
|
+
div#repositories {
|
58
|
+
margin-bottom: 12px;
|
59
|
+
}
|
60
|
+
button.remove-repo-button {
|
61
|
+
background-color: gainsboro;
|
62
|
+
}
|
63
|
+
</style>
|
64
|
+
<script>
|
65
|
+
const add_repo_button = document.getElementById("add-repository-button");
|
66
|
+
add_repo_button.addEventListener("click", function(event) {
|
67
|
+
event.preventDefault();
|
68
|
+
var repo = document.createElement("div");
|
69
|
+
repo.classList.add("card");
|
70
|
+
repo.classList.add("repo");
|
71
|
+
const id = Date.now();
|
72
|
+
repo.id = "repo-card-" + id;
|
73
|
+
|
74
|
+
// Create repo owner, name, branch elements
|
75
|
+
let repoOwnerLabel = document.createElement("label");
|
76
|
+
repoOwnerLabel.textContent = "Repository Owner";
|
77
|
+
repoOwnerLabel.for = "repo-owner";
|
78
|
+
|
79
|
+
let repoOwner = document.createElement("input");
|
80
|
+
repoOwner.type = "text";
|
81
|
+
repoOwner.id = "repo-owner-" + id;
|
82
|
+
repoOwner.name = "repo_owner";
|
83
|
+
|
84
|
+
let repoNameLabel = document.createElement("label");
|
85
|
+
repoNameLabel.textContent = "Repository Name";
|
86
|
+
repoNameLabel.for = "repo-name";
|
87
|
+
|
88
|
+
let repoName = document.createElement("input");
|
89
|
+
repoName.type = "text";
|
90
|
+
repoName.id = "repo-name-" + id;
|
91
|
+
repoName.name = "repo_name";
|
92
|
+
|
93
|
+
let repoBranchLabel = document.createElement("label");
|
94
|
+
repoBranchLabel.textContent = "Repository Branch";
|
95
|
+
repoBranchLabel.for = "repo-branch";
|
96
|
+
|
97
|
+
let repoBranch = document.createElement("input");
|
98
|
+
repoBranch.type = "text";
|
99
|
+
repoBranch.id = "repo-branch-" + id;
|
100
|
+
repoBranch.name = "repo_branch";
|
101
|
+
|
102
|
+
let removeRepoButton = document.createElement("button");
|
103
|
+
removeRepoButton.type = "button";
|
104
|
+
removeRepoButton.classList.add("remove-repo-button");
|
105
|
+
removeRepoButton.onclick = function() { remove_repo(id); };
|
106
|
+
removeRepoButton.id = "remove-repo-button-" + id;
|
107
|
+
removeRepoButton.textContent = "Remove Repository";
|
108
|
+
|
109
|
+
// Append elements to repo card
|
110
|
+
repo.append(
|
111
|
+
repoOwnerLabel, repoOwner,
|
112
|
+
repoNameLabel, repoName,
|
113
|
+
repoBranchLabel, repoBranch,
|
114
|
+
removeRepoButton
|
115
|
+
);
|
116
|
+
|
117
|
+
document.getElementById("repositories").appendChild(repo);
|
118
|
+
})
|
119
|
+
|
120
|
+
function remove_repo(index) {
|
121
|
+
document.getElementById("repo-card-" + index).remove();
|
122
|
+
}
|
123
|
+
|
124
|
+
submit.addEventListener("click", function(event) {
|
125
|
+
event.preventDefault();
|
126
|
+
|
127
|
+
const pat_token = document.getElementById("pat-token").value;
|
128
|
+
var cards = document.getElementById("repositories").getElementsByClassName("repo");
|
129
|
+
var repos = [];
|
130
|
+
|
131
|
+
for (var i = 0; i < cards.length; i++) {
|
132
|
+
var card = cards[i];
|
133
|
+
var owner = card.getElementsByTagName("input")[0].value;
|
134
|
+
var name = card.getElementsByTagName("input")[1].value;
|
135
|
+
var branch = card.getElementsByTagName("input")[2].value;
|
136
|
+
|
137
|
+
if (owner == "" || name == "" || branch == "") {
|
138
|
+
continue;
|
139
|
+
}
|
140
|
+
|
141
|
+
repos.push({
|
142
|
+
"owner": owner,
|
143
|
+
"name": name,
|
144
|
+
"branch": branch,
|
145
|
+
});
|
146
|
+
}
|
147
|
+
|
148
|
+
if (repos.length == 0) {
|
149
|
+
document.getElementById("success").textContent = "❌ Please add at least one repository.";
|
150
|
+
document.getElementById("success").style.display = "block";
|
151
|
+
return;
|
152
|
+
}
|
153
|
+
|
154
|
+
const submitButton = document.getElementById("submit");
|
155
|
+
submitButton.disabled = true;
|
156
|
+
submitButton.textContent = "Saving...";
|
157
|
+
|
158
|
+
// Save Github config on server
|
159
|
+
const csrfToken = document.cookie.split('; ').find(row => row.startsWith('csrftoken'))?.split('=')[1];
|
160
|
+
fetch('/api/content/github', {
|
161
|
+
method: 'POST',
|
162
|
+
headers: {
|
163
|
+
'Content-Type': 'application/json',
|
164
|
+
'X-CSRFToken': csrfToken,
|
165
|
+
},
|
166
|
+
body: JSON.stringify({
|
167
|
+
"pat_token": pat_token,
|
168
|
+
"repos": repos,
|
169
|
+
})
|
170
|
+
})
|
171
|
+
.then(response => response.json())
|
172
|
+
.then(data => { data["status"] === "ok" ? data : Promise.reject(data) })
|
173
|
+
.catch(error => {
|
174
|
+
document.getElementById("success").textContent = "⚠️ Failed to save Github settings.";
|
175
|
+
document.getElementById("success").style.display = "block";
|
176
|
+
submitButton.textContent = "⚠️ Failed to save settings";
|
177
|
+
setTimeout(function() {
|
178
|
+
submitButton.textContent = "Save";
|
179
|
+
submitButton.disabled = false;
|
180
|
+
}, 2000);
|
181
|
+
return;
|
182
|
+
});
|
183
|
+
|
184
|
+
// Index Github content on server
|
185
|
+
fetch('/api/update?t=github')
|
186
|
+
.then(response => response.json())
|
187
|
+
.then(data => { data["status"] == "ok" ? data : Promise.reject(data) })
|
188
|
+
.then(data => {
|
189
|
+
document.getElementById("success").style.display = "none";
|
190
|
+
submitButton.textContent = "✅ Successfully updated";
|
191
|
+
setTimeout(function() {
|
192
|
+
submitButton.textContent = "Save";
|
193
|
+
submitButton.disabled = false;
|
194
|
+
}, 2000);
|
195
|
+
})
|
196
|
+
.catch(error => {
|
197
|
+
document.getElementById("success").textContent = "⚠️ Failed to save Github content.";
|
198
|
+
document.getElementById("success").style.display = "block";
|
199
|
+
submitButton.textContent = "⚠️ Failed to save content";
|
200
|
+
setTimeout(function() {
|
201
|
+
submitButton.textContent = "Save";
|
202
|
+
submitButton.disabled = false;
|
203
|
+
}, 2000);
|
204
|
+
});
|
205
|
+
|
206
|
+
});
|
207
|
+
</script>
|
208
|
+
{% endblock %}
|