From b63fbc5345abfc9bf1d0cb611da3dc013905af1a Mon Sep 17 00:00:00 2001 From: sabaimran Date: Wed, 30 Oct 2024 13:00:16 -0700 Subject: [PATCH 1/3] Add a simple badget to the dropdown menu that shows subscription status --- .../web/app/components/navMenu/navMenu.tsx | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/src/interface/web/app/components/navMenu/navMenu.tsx b/src/interface/web/app/components/navMenu/navMenu.tsx index 2ff4eaf4..256c7d77 100644 --- a/src/interface/web/app/components/navMenu/navMenu.tsx +++ b/src/interface/web/app/components/navMenu/navMenu.tsx @@ -26,6 +26,17 @@ import { Moon, Sun, UserCircle, Question, GearFine, ArrowRight } from "@phosphor import { KhojAgentLogo, KhojAutomationLogo, KhojSearchLogo } from "../logo/khojLogo"; import { useIsMobileWidth } from "@/app/common/utils"; +function SubscriptionBadge({ is_active }: { is_active: boolean }) { + return ( +
+
+

{is_active ? "Futurist" : "Free"}

+
+ ); +} + export default function NavMenu() { const userData = useAuthenticatedData(); const [darkMode, setDarkMode] = useState(false); @@ -85,8 +96,9 @@ export default function NavMenu() { -
+

{userData?.email}

+
@@ -192,8 +204,9 @@ export default function NavMenu() { -
+

{userData?.email}

+
From 8d1ecb9bd827306dabaffaa02116c149d4289577 Mon Sep 17 00:00:00 2001 From: sabaimran Date: Thu, 31 Oct 2024 12:41:53 -0700 Subject: [PATCH 2/3] Add optional brew steps for docker install --- documentation/docs/get-started/setup.mdx | 72 ++++++++++++++++++------ 1 file changed, 55 insertions(+), 17 deletions(-) diff --git a/documentation/docs/get-started/setup.mdx b/documentation/docs/get-started/setup.mdx index 817af37a..04146d9f 100644 --- a/documentation/docs/get-started/setup.mdx +++ b/documentation/docs/get-started/setup.mdx @@ -27,7 +27,28 @@ If you want to use the offline chat model and you have a GPU, you should use Ins

Prerequisites

- Install [Docker Desktop](https://docs.docker.com/desktop/install/mac-install/) +

Docker

+ (Option 1) Click here to install [Docker Desktop](https://docs.docker.com/desktop/install/mac-install/). Make sure you also install the [Docker Compose](https://docs.docker.com/desktop/install/mac-install/) tool. + + (Option 2) Use [Homebrew](https://brew.sh/) to install Docker and Docker Compose. + ```shell + brew install --cask docker + brew install docker-compose + ``` +

Setup

+ 1. Download the Khoj docker-compose.yml file [from Github](https://github.com/khoj-ai/khoj/blob/master/docker-compose.yml) + ```shell + mkdir ~/.khoj && cd ~/.khoj + wget https://raw.githubusercontent.com/khoj-ai/khoj/master/docker-compose.yml + ``` + 2. Configure the environment variables in the docker-compose.yml + - Set `KHOJ_ADMIN_PASSWORD`, `KHOJ_DJANGO_SECRET_KEY` (and optionally the `KHOJ_ADMIN_EMAIL`) to something secure. This allows you to customize Khoj later via the admin panel. + - Set `OPENAI_API_KEY`, `ANTHROPIC_API_KEY`, or `GEMINI_API_KEY` to your API key if you want to use OpenAI, Anthropic or Gemini chat models respectively. + 3. Start Khoj by running the following command in the same directory as your docker-compose.yml file. + ```shell + cd ~/.khoj + docker-compose up + ```

Prerequisites

@@ -37,30 +58,47 @@ If you want to use the offline chat model and you have a GPU, you should use Ins wsl --install ``` 2. Install [Docker Desktop](https://docs.docker.com/desktop/install/windows-install/) with **[WSL2 backend](https://docs.docker.com/desktop/wsl/#turn-on-docker-desktop-wsl-2)** (default) + +

Setup

+ 1. Download the Khoj docker-compose.yml file [from Github](https://github.com/khoj-ai/khoj/blob/master/docker-compose.yml) + ```shell + # Windows users should use their WSL2 terminal to run these commands + mkdir ~/.khoj && cd ~/.khoj + wget https://raw.githubusercontent.com/khoj-ai/khoj/master/docker-compose.yml + ``` + 2. Configure the environment variables in the docker-compose.yml + - Set `KHOJ_ADMIN_PASSWORD`, `KHOJ_DJANGO_SECRET_KEY` (and optionally the `KHOJ_ADMIN_EMAIL`) to something secure. This allows you to customize Khoj later via the admin panel. + - Set `OPENAI_API_KEY`, `ANTHROPIC_API_KEY`, or `GEMINI_API_KEY` to your API key if you want to use OpenAI, Anthropic or Gemini chat models respectively. + 3. Start Khoj by running the following command in the same directory as your docker-compose.yml file. + ```shell + # Windows users should use their WSL2 terminal to run these commands + cd ~/.khoj + docker-compose up + ```

Prerequisites

Install [Docker Desktop](https://docs.docker.com/desktop/install/linux/). You can also use your package manager to install Docker Engine & Docker Compose. + +

Setup

+ 1. Download the Khoj docker-compose.yml file [from Github](https://github.com/khoj-ai/khoj/blob/master/docker-compose.yml) + ```shell + mkdir ~/.khoj && cd ~/.khoj + wget https://raw.githubusercontent.com/khoj-ai/khoj/master/docker-compose.yml + ``` + 2. Configure the environment variables in the docker-compose.yml + - Set `KHOJ_ADMIN_PASSWORD`, `KHOJ_DJANGO_SECRET_KEY` (and optionally the `KHOJ_ADMIN_EMAIL`) to something secure. This allows you to customize Khoj later via the admin panel. + - Set `OPENAI_API_KEY`, `ANTHROPIC_API_KEY`, or `GEMINI_API_KEY` to your API key if you want to use OpenAI, Anthropic or Gemini chat models respectively. + 3. Start Khoj by running the following command in the same directory as your docker-compose.yml file. + ```shell + cd ~/.khoj + docker-compose up + ```
-

Setup

-1. Download the Khoj docker-compose.yml file [from Github](https://github.com/khoj-ai/khoj/blob/master/docker-compose.yml) - ```shell - # Windows users should use their WSL2 terminal to run these commands - mkdir ~/.khoj && cd ~/.khoj - wget https://raw.githubusercontent.com/khoj-ai/khoj/master/docker-compose.yml - ``` -2. Configure the environment variables in the docker-compose.yml - - Set `KHOJ_ADMIN_PASSWORD`, `KHOJ_DJANGO_SECRET_KEY` (and optionally the `KHOJ_ADMIN_EMAIL`) to something secure. This allows you to customize Khoj later via the admin panel. - - Set `OPENAI_API_KEY`, `ANTHROPIC_API_KEY`, or `GEMINI_API_KEY` to your API key if you want to use OpenAI, Anthropic or Gemini chat models respectively. -3. Start Khoj by running the following command in the same directory as your docker-compose.yml file. - ```shell - # Windows users should use their WSL2 terminal to run these commands - cd ~/.khoj - docker-compose up - ``` + :::info[Remote Access] By default Khoj is only accessible on the machine it is running. To access Khoj from a remote machine see [Remote Access Docs](/advanced/remote). From 159ea448835b489d61fae46f6f599d76f27a272f Mon Sep 17 00:00:00 2001 From: sabaimran Date: Thu, 31 Oct 2024 18:14:51 -0700 Subject: [PATCH 3/3] Remove frame references in the diagramming prompts --- src/khoj/processor/conversation/prompts.py | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/src/khoj/processor/conversation/prompts.py b/src/khoj/processor/conversation/prompts.py index 0cca1e37..3cb50715 100644 --- a/src/khoj/processor/conversation/prompts.py +++ b/src/khoj/processor/conversation/prompts.py @@ -193,7 +193,6 @@ you need to convert the user's query to a description format that the novice art - ellipse - line - arrow -- frame use these primitives to describe what sort of diagram the drawer should create. the artist must recreate the diagram every time, so include all relevant prior information in your description. @@ -284,21 +283,6 @@ For text, you must use the `text` property to specify the text to be rendered. Y text: string, }} -For frames, use the `children` property to specify the elements that are inside the frame by their ids. - -{{ - type: "frame", - id: string, - x: number, - y: number, - width: number, - height: number, - name: string, - children: [ - string - ] -}} - Here's an example of a valid diagram: Design Description: Create a diagram describing a circular development process with 3 stages: design, implementation and feedback. The design stage is connected to the implementation stage and the implementation stage is connected to the feedback stage and the feedback stage is connected to the design stage. Each stage should be labeled with the stage name.