From a76032522e006fbbd7b639694bb72897e97b5923 Mon Sep 17 00:00:00 2001 From: Debanjum Date: Thu, 22 May 2025 14:56:09 -0700 Subject: [PATCH] Add type hints to function args calling anthropic model api --- .../processor/conversation/anthropic/utils.py | 34 +++++++++---------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/src/khoj/processor/conversation/anthropic/utils.py b/src/khoj/processor/conversation/anthropic/utils.py index 7c56b8ac..eb6c53aa 100644 --- a/src/khoj/processor/conversation/anthropic/utils.py +++ b/src/khoj/processor/conversation/anthropic/utils.py @@ -43,16 +43,16 @@ MAX_REASONING_TOKENS_ANTHROPIC = 12000 ) def anthropic_completion_with_backoff( messages: list[ChatMessage], - system_prompt, + system_prompt: str, model_name: str, - temperature=0.4, - api_key=None, - api_base_url: str = None, - model_kwargs=None, - max_tokens=None, - response_type="text", - deepthought=False, - tracer={}, + temperature: float = 0.4, + api_key: str | None = None, + api_base_url: str | None = None, + model_kwargs: dict | None = None, + max_tokens: int | None = None, + response_type: str = "text", + deepthought: bool = False, + tracer: dict = {}, ) -> str: client = anthropic_clients.get(api_key) if not client: @@ -122,15 +122,15 @@ def anthropic_completion_with_backoff( ) async def anthropic_chat_completion_with_backoff( messages: list[ChatMessage], - model_name, - temperature, - api_key, - api_base_url, + model_name: str | None, + temperature: float, + api_key: str | None, + api_base_url: str, system_prompt: str, - max_prompt_size=None, - deepthought=False, - model_kwargs=None, - tracer={}, + max_prompt_size: int | None = None, + deepthought: bool = False, + model_kwargs: dict | None = None, + tracer: dict = {}, ) -> AsyncGenerator[ResponseWithThought, None]: client = anthropic_async_clients.get(api_key) if not client: