mirror of
https://wget.la/https://github.com/leookun/cursor-byok
synced 2026-10-06 13:44:21 +08:00
refactor: remove retry_count from ProviderConfig and enhance error handling in tool execution
- Removed the `retry_count` field from `ProviderConfig` as it is no longer needed. - Introduced `argument_error` field in `ToolCall` to capture errors related to tool arguments. - Updated various components to handle argument errors more gracefully, including in the `ToolDispatcher` and `ConversationOutput`. - Enhanced tests to validate the new error handling and ensure proper functionality of tool calls.
This commit is contained in:
@@ -31,10 +31,13 @@ pub struct FakeProvider {
|
||||
|
||||
impl FakeProvider {
|
||||
pub fn push(&self, events: Vec<ModelEvent>) {
|
||||
self.push_results(events.into_iter().map(Ok).collect());
|
||||
}
|
||||
pub fn push_results(&self, events: Vec<Result<ModelEvent, Error>>) {
|
||||
self.responses
|
||||
.lock()
|
||||
.unwrap()
|
||||
.push_back(FakeResponse::Events(events.into_iter().map(Ok).collect()));
|
||||
.push_back(FakeResponse::Events(events));
|
||||
}
|
||||
pub fn push_error(&self, error: Error) {
|
||||
self.responses
|
||||
|
||||
Reference in New Issue
Block a user