From 2366fa08b91d5655440f1fffd42b0d15e4e2be33 Mon Sep 17 00:00:00 2001 From: Debanjum Date: Sat, 16 Nov 2024 22:07:11 -0800 Subject: [PATCH] Update default vision supported & anthropic chat models on first run - Update to latest initialize with new claude 3.5 sonnet and haiku models - Update to set vision enabled for google and anthropic models by default. Previously we didn't support but we've supported this for a month or two now --- src/khoj/utils/constants.py | 2 +- src/khoj/utils/initialization.py | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/khoj/utils/constants.py b/src/khoj/utils/constants.py index d91cc84a..b8107edb 100644 --- a/src/khoj/utils/constants.py +++ b/src/khoj/utils/constants.py @@ -16,7 +16,7 @@ default_offline_chat_models = [ ] default_openai_chat_models = ["gpt-4o-mini", "gpt-4o"] default_gemini_chat_models = ["gemini-1.5-flash", "gemini-1.5-pro"] -default_anthropic_chat_models = ["claude-3-5-sonnet-20240620", "claude-3-opus-20240229"] +default_anthropic_chat_models = ["claude-3-5-sonnet-20241022", "claude-3-5-haiku-20241022"] empty_config = { "search-type": { diff --git a/src/khoj/utils/initialization.py b/src/khoj/utils/initialization.py index 6a39c41a..b8472288 100644 --- a/src/khoj/utils/initialization.py +++ b/src/khoj/utils/initialization.py @@ -87,7 +87,7 @@ def initialization(interactive: bool = True): ChatModelOptions.ModelType.GOOGLE, default_gemini_chat_models, default_api_key=os.getenv("GEMINI_API_KEY"), - vision_enabled=False, + vision_enabled=True, is_offline=False, interactive=interactive, provider_name="Google Gemini", @@ -98,7 +98,7 @@ def initialization(interactive: bool = True): ChatModelOptions.ModelType.ANTHROPIC, default_anthropic_chat_models, default_api_key=os.getenv("ANTHROPIC_API_KEY"), - vision_enabled=False, + vision_enabled=True, is_offline=False, interactive=interactive, ) @@ -158,7 +158,9 @@ def initialization(interactive: bool = True): is_offline: bool = False, provider_name: str = None, ) -> Tuple[bool, OpenAIProcessorConversationConfig]: - supported_vision_models = ["gpt-4o-mini", "gpt-4o"] + supported_vision_models = ( + default_openai_chat_models + default_anthropic_chat_models + default_gemini_chat_models + ) provider_name = provider_name or model_type.name.capitalize() default_use_model = {True: "y", False: "n"}[default_api_key is not None or is_offline] use_model_provider = (