Skip to content

Commit

Permalink
smart max_retries for claude
Browse files Browse the repository at this point in the history
  • Loading branch information
vadim0x60 committed Jul 2, 2024
1 parent 30de595 commit 66402fb
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion seidr/llm.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
from langchain.chains import LLMChain
from langchain.chat_models import ChatOpenAI, ChatOllama
from langchain_anthropic import ChatAnthropic
import anthropic._constants
from collections.abc import Iterable
from typing import Callable, Optional
import re
Expand Down Expand Up @@ -85,7 +86,7 @@ def create_chain(
model_name=model_name,
temperature=temperature,
anthropic_api_key=os.getenv('ANTHROPIC_API_KEY'),
max_retries=4096
max_retries=int(25 * 60 * 60 / anthropic._constants.MAX_RETRY_DELAY)
)
elif api == ChatOllama:
chat_model = ChatOllama(
Expand Down

0 comments on commit 66402fb

Please sign in to comment.