为分离模型请求增加重试退避
瞬时请求失败时按递增毫秒延迟后重试 将重试循环末尾改为不可达断言
This commit is contained in:
@@ -55,6 +55,8 @@ where
|
||||
max_retries,
|
||||
error
|
||||
);
|
||||
tokio::time::sleep(std::time::Duration::from_millis(200 * (attempt as u64 + 1)))
|
||||
.await;
|
||||
continue;
|
||||
}
|
||||
Err(error) => return Err(error),
|
||||
@@ -71,7 +73,7 @@ where
|
||||
Err(error) => return Err(error),
|
||||
}
|
||||
}
|
||||
Err("LLM 修复重试流程未产生结果".to_string())
|
||||
unreachable!("重试循环在最后一次尝试时始终返回结果")
|
||||
}
|
||||
|
||||
pub(crate) fn parse_limited_llm_tool_arguments(
|
||||
|
||||
Reference in New Issue
Block a user