mirror of
https://gitee.com/wanwujie/deer-flow
synced 2026-04-17 19:44:45 +08:00
feat(llm): Add retry mechanism for LLM API calls (#400)
* feat(llm): Add retry mechanism for LLM API calls * feat: configure max_retries for LLM calls via conf.yaml --------- Co-authored-by: Willem Jiang <willem.jiang@gmail.com>
This commit is contained in:
@@ -70,6 +70,10 @@ def _create_llm_use_conf(
|
||||
if not merged_conf:
|
||||
raise ValueError(f"No configuration found for LLM type: {llm_type}")
|
||||
|
||||
# Add max_retries to handle rate limit errors
|
||||
if "max_retries" not in merged_conf:
|
||||
merged_conf["max_retries"] = 3
|
||||
|
||||
if llm_type == "reasoning":
|
||||
merged_conf["api_base"] = merged_conf.pop("base_url", None)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user