Skip to content

Commit f503f34

Browse files
timeout improvements
1 parent 78617e3 commit f503f34

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

manager.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,9 +81,9 @@ def call_model_manager(self, state):
8181
}
8282
]
8383
))
84-
elif len(last_ai_message.tool_calls) == 0:
85-
state["messages"].append(HumanMessage(content=no_tools_msg))
8684
state = call_tool(state, self.tools)
85+
if len(last_ai_message.tool_calls) == 0:
86+
state["messages"].append(HumanMessage(content=no_tools_msg))
8787
state = actualize_tasks_list_and_progress_description(state)
8888
return state
8989

src/utilities/llms.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ def llm_open_router(model):
2020
"HTTP-Referer": "https://github.com/Grigorij-Dudnik/Clean-Coder-AI",
2121
"X-Title": "Clean Coder",
2222
},
23-
timeout=60,
23+
timeout=90,
2424
)
2525

2626

@@ -36,12 +36,12 @@ def llm_open_local_hosted(model):
3636
def init_llms_medium_intelligence(tools=None, run_name="Clean Coder", temp=0):
3737
llms = []
3838
if getenv("ANTHROPIC_API_KEY"):
39-
llms.append(ChatAnthropic(model="claude-3-5-sonnet-latest", temperature=temp, timeout=60, max_tokens=4096))
39+
llms.append(ChatAnthropic(model="claude-3-5-sonnet-latest", temperature=temp, timeout=90))
4040

4141
if getenv("OPENROUTER_API_KEY"):
4242
llms.append(llm_open_router("anthropic/claude-3.5-sonnet"))
4343
if getenv("OPENAI_API_KEY"):
44-
llms.append(ChatOpenAI(model="gpt-4.1", temperature=temp, timeout=60))
44+
llms.append(ChatOpenAI(model="gpt-4.1", temperature=temp, timeout=90))
4545

4646
if getenv("OLLAMA_MODEL"):
4747
llms.append(ChatOllama(model=os.getenv("OLLAMA_MODEL")))
@@ -57,11 +57,11 @@ def init_llms_medium_intelligence(tools=None, run_name="Clean Coder", temp=0):
5757
def init_llms_mini(tools=None, run_name="Clean Coder", temp=0):
5858
llms = []
5959
if os.getenv("ANTHROPIC_API_KEY"):
60-
llms.append(ChatAnthropic(model="claude-3-5-haiku-20241022", temperature=temp, timeout=60))
60+
llms.append(ChatAnthropic(model="claude-3-5-haiku-20241022", temperature=temp, timeout=90))
6161
if os.getenv("OPENROUTER_API_KEY"):
6262
llms.append(llm_open_router("anthropic/claude-3.5-haiku"))
6363
if os.getenv("OPENAI_API_KEY"):
64-
llms.append(ChatOpenAI(model="gpt-4.1-mini", temperature=temp, timeout=60))
64+
llms.append(ChatOpenAI(model="gpt-4.1-mini", temperature=temp, timeout=90))
6565
# if os.getenv("GOOGLE_API_KEY"):
6666
# llms.append(ChatGoogleGenerativeAI(model="gemini-2.0-flash-exp", temperature=temp, timeout=60))
6767
if os.getenv("OLLAMA_MODEL"):
@@ -78,13 +78,13 @@ def init_llms_mini(tools=None, run_name="Clean Coder", temp=0):
7878
def init_llms_high_intelligence(tools=None, run_name="Clean Coder", temp=0.2):
7979
llms = []
8080
if os.getenv("ANTHROPIC_API_KEY"):
81-
llms.append(ChatAnthropic(model="claude-3-7-sonnet-latest", temperature=temp, timeout=60, max_tokens=4096))
81+
llms.append(ChatAnthropic(model="claude-3-7-sonnet-latest", temperature=temp, timeout=90))
8282
if getenv("OPENROUTER_API_KEY"):
8383
llms.append(llm_open_router("anthropic/claude-3.7-sonnet"))
8484
if os.getenv("OPENAI_API_KEY"):
85-
llms.append(ChatOpenAI(model="o3", temperature=1, timeout=60, reasoning_effort="high"))
85+
llms.append(ChatOpenAI(model="o3", temperature=1, timeout=90, reasoning_effort="high"))
8686
if os.getenv("OPENAI_API_KEY"):
87-
llms.append(ChatOpenAI(model="o1", temperature=1, timeout=60))
87+
llms.append(ChatOpenAI(model="o1", temperature=1, timeout=90))
8888

8989
if os.getenv("OLLAMA_MODEL"):
9090
llms.append(ChatOllama(model=os.getenv("OLLAMA_MODEL")))

0 commit comments

Comments
 (0)