Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generate and analyze documents with Khoj using the Code sandbox #960

Merged
merged 7 commits into from
Nov 12, 2024

Commits on Nov 12, 2024

  1. Enable analysing user documents in code sandbox and other improvements

    - Run one program at a time, instead of allowing model to pass
      multiple programs to run in parallel to simplify logic for model
    - Update prompt to give more example of complex, multi-line code
    - Allow passing user files as input into code sandbox for analysis
    
    - Log code execution timer at info level to evaluate execution latencies
      in production
    
    - Type the generated code for easier processing by caller functions
    debanjum committed Nov 12, 2024
    Configuration menu
    Copy the full SHA
    7b39f20 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    af02157 View commit details
    Browse the repository at this point in the history
  3. Fixes to render & save code context with non text based output modes

    - Fix to render code generated chart with images, excalidraw diagrams
    - Fix to save code context to chat history in image, diagram output modes
    - Fix bug in image markdown being wrapped twice in markdown syntax
    - Render newline in code references shown on chat page of web app
      Previously newlines weren't getting rendered. This made the code
      executed by Khoj hard to read in references. This changes fixes that.
    
      `dangerouslySetInnerHTML' usage is justified as rendered code
      snippet is being sanitized by DOMPurify before rendering.
    debanjum committed Nov 12, 2024
    Configuration menu
    Copy the full SHA
    92c1efe View commit details
    Browse the repository at this point in the history
  4. Render code output files with code references in reference section

    - Improve rendering code reference with better icons, smaller text and
      different line clamps for better visibility
    - Show code output files as sub card of code card in reference section
    - Allow downloading files generated by code instead of rendering it in
      chat message directly
    - Show executed code before online references in reference panel
    debanjum committed Nov 12, 2024
    Configuration menu
    Copy the full SHA
    8e9f426 View commit details
    Browse the repository at this point in the history
  5. Align styling of reference panel card across code, docs, web results

    - Add a border below heading
    - Show code snippet in pre block
    - Overflow-x when reference side panel open to allow seeing whole text
      via x-scroll
    - Align header, body position of reference cards with each other
    - Only show filename in doc reference cards at message bottom.
      Show full file path in hover and reference side panel
    debanjum committed Nov 12, 2024
    Configuration menu
    Copy the full SHA
    b970cfd View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    218eed8 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    a52500d View commit details
    Browse the repository at this point in the history