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

Conversation

debanjum
Copy link
Member

@debanjum debanjum commented Nov 6, 2024

  • Allow passing user files as input into code sandbox for analysis
  • Update prompt to give more example of complex, multi-line code
  • Simplify logic for model. Run one program at a time,
    instead of allowing model to run multiple programs in parallel
  • Show Code generated charts and docs in Reference pane of web app and make them downloaded

Copy link
Member

@sabaimran sabaimran left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sweet, looking forward to improving the code execution reliability & depth.

src/khoj/processor/tools/run_code.py Outdated Show resolved Hide resolved
src/khoj/processor/tools/run_code.py Show resolved Hide resolved
@debanjum debanjum force-pushed the analyze-input-files-in-code-sandbox branch 2 times, most recently from 3d3446d to 99d8ba2 Compare November 11, 2024 09:56
- 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 debanjum force-pushed the analyze-input-files-in-code-sandbox branch from 99d8ba2 to 9c22276 Compare November 12, 2024 01:59
- 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.
- 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
- 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 debanjum force-pushed the analyze-input-files-in-code-sandbox branch from 9c22276 to a52500d Compare November 12, 2024 02:01
@debanjum debanjum changed the title Enable Passing External Documents for Analysis in Code Sandbox Generate and analyze documents with Khoj using the Code sandbox Nov 12, 2024
@debanjum debanjum added the upgrade New feature or request label Nov 12, 2024
@debanjum debanjum merged commit 48862a8 into master Nov 12, 2024
9 checks passed
@debanjum debanjum deleted the analyze-input-files-in-code-sandbox branch November 12, 2024 03:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
upgrade New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants