Merge branch 'master' of github.com:khoj-ai/khoj into features/improve-multiple-output-mode-generation

This commit is contained in:
sabaimran 2024-12-10 16:56:36 -08:00
commit 2bb14c55a6
4 changed files with 479 additions and 492 deletions

View file

@ -24,7 +24,7 @@ services:
condition: service_healthy condition: service_healthy
# Use the following line to use the latest version of khoj. Otherwise, it will build from source. Set this to ghcr.io/khoj-ai/khoj-cloud if you want to use the prod image. # Use the following line to use the latest version of khoj. Otherwise, it will build from source. Set this to ghcr.io/khoj-ai/khoj-cloud if you want to use the prod image.
image: ghcr.io/khoj-ai/khoj:latest image: ghcr.io/khoj-ai/khoj:latest
# Uncomment the following line to build from source. This will take a few minutes. Comment the next two lines out if you want to use the offiicial image. # Uncomment the following line to build from source. This will take a few minutes. Comment the next two lines out if you want to use the official image.
# build: # build:
# context: . # context: .
ports: ports:
@ -64,7 +64,7 @@ services:
# Ensure you set your provider specific API keys. # Ensure you set your provider specific API keys.
# --- # ---
# Free, Slower API. Does both web search and webpage read. Get API key from https://jina.ai/ # Free, Slower API. Does both web search and webpage read. Get API key from https://jina.ai/
# - JINA_API_KEY=you_jina_api_key # - JINA_API_KEY=your_jina_api_key
# Paid, Fast API. Only does web search. Get API key from https://serper.dev/ # Paid, Fast API. Only does web search. Get API key from https://serper.dev/
# - SERPER_DEV_API_KEY=your_serper_dev_api_key # - SERPER_DEV_API_KEY=your_serper_dev_api_key
# Paid, Fast, Open API. Only does webpage read. Get API key from https://firecrawl.dev/ # Paid, Fast, Open API. Only does webpage read. Get API key from https://firecrawl.dev/

File diff suppressed because it is too large Load diff

View file

@ -63,7 +63,7 @@ dependencies = [
"tenacity == 8.3.0", "tenacity == 8.3.0",
"anyio == 3.7.1", "anyio == 3.7.1",
"pymupdf == 1.24.11", "pymupdf == 1.24.11",
"django == 5.0.9", "django == 5.0.10",
"django-unfold == 0.42.0", "django-unfold == 0.42.0",
"authlib == 1.2.1", "authlib == 1.2.1",
"llama-cpp-python == 0.2.88", "llama-cpp-python == 0.2.88",

View file

@ -334,9 +334,10 @@ def construct_structured_message(
ChatModelOptions.ModelType.GOOGLE, ChatModelOptions.ModelType.GOOGLE,
ChatModelOptions.ModelType.ANTHROPIC, ChatModelOptions.ModelType.ANTHROPIC,
]: ]:
constructed_messages: List[Any] = [ if not attached_file_context and not (vision_enabled and images):
{"type": "text", "text": message}, return message
]
constructed_messages: List[Any] = [{"type": "text", "text": message}]
if not is_none_or_empty(attached_file_context): if not is_none_or_empty(attached_file_context):
constructed_messages.append({"type": "text", "text": attached_file_context}) constructed_messages.append({"type": "text", "text": attached_file_context})