From 6fa2dbc042c461bdc166abe30e5fd5ee9ba32aaa Mon Sep 17 00:00:00 2001 From: sabaimran Date: Tue, 2 Jul 2024 21:58:51 +0530 Subject: [PATCH] Do not use the custom configured max prompt size to send message to anthropic --- src/khoj/processor/conversation/anthropic/utils.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/khoj/processor/conversation/anthropic/utils.py b/src/khoj/processor/conversation/anthropic/utils.py index d6c8f4f2..dbae1e11 100644 --- a/src/khoj/processor/conversation/anthropic/utils.py +++ b/src/khoj/processor/conversation/anthropic/utils.py @@ -99,15 +99,13 @@ def anthropic_llm_thread( anthropic.types.MessageParam(role=message.role, content=message.content) for message in messages ] - max_prompt_size = max_prompt_size or DEFAULT_MAX_TOKENS_ANTHROPIC - with client.messages.stream( messages=formatted_messages, model=model_name, # type: ignore temperature=temperature, system=system_prompt, timeout=20, - max_tokens=max_prompt_size, + max_tokens=DEFAULT_MAX_TOKENS_ANTHROPIC, **(model_kwargs or dict()), ) as stream: for text in stream.text_stream: