Include additional user context in the image generation flow (#660)

* Make major improvements to the image generation flow

- Include user context from online references and personal notes for generating images
- Dynamically select the modality that the LLM should respond with
- Retun the inferred context in the query response for the dekstop, web chat views to read

* Add unit tests for retrieving response modes via LLM

* Move output mode unit tests to the actor suite, rather than director

* Only show the references button if there is at least one available

* Rename aget_relevant_modes to aget_relevant_output_modes

* Use a shared method for generating reference sections, simplify some of the prompting logic

* Make out of space errors in the desktop client more obvious
This commit is contained in:
sabaimran
2024-03-06 13:48:41 +05:30
committed by GitHub
parent 3cbc5b0d52
commit e323a6d69b
9 changed files with 336 additions and 102 deletions

View File

@@ -8,7 +8,10 @@ from freezegun import freeze_time
from khoj.database.models import KhojUser
from khoj.processor.conversation import prompts
from khoj.processor.conversation.utils import message_to_log
from khoj.routers.helpers import aget_relevant_information_sources
from khoj.routers.helpers import (
aget_relevant_information_sources,
aget_relevant_output_modes,
)
from tests.helpers import ConversationFactory
# Initialize variables for tests