Skip to content

Commit

Permalink
remove streaming retries
Browse files Browse the repository at this point in the history
  • Loading branch information
spolu committed Apr 4, 2024
1 parent d3cb123 commit f0c6da6
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 29 deletions.
18 changes: 5 additions & 13 deletions core/src/providers/anthropic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -541,11 +541,7 @@ impl AnthropicLLM {
"Anthropic API Error: {}",
event.error.to_string()
),
retryable: Some(ModelErrorRetryOptions {
sleep: Duration::from_millis(500),
factor: 1,
retries: 1,
}),
retryable: None,
})?;
break 'stream;
}
Expand All @@ -557,14 +553,10 @@ impl AnthropicLLM {
}
},
Err(error) => {
Err(ModelError {
message: format!("Error streaming from Anthropic: {:?}", error),
retryable: Some(ModelErrorRetryOptions {
sleep: Duration::from_millis(500),
factor: 1,
retries: 1,
}),
})?;
Err(anyhow!(
"Error streaming tokens from Anthropic: {:?}",
error
))?;
break 'stream;
}
}
Expand Down
8 changes: 2 additions & 6 deletions core/src/providers/mistral.rs
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,7 @@ impl MistralAPIError {
}

pub fn retryable_streamed(&self) -> bool {
self.retryable()
false
}
}

Expand Down Expand Up @@ -497,11 +497,7 @@ impl MistralAILLM {
})?,
false => Err(ModelError {
message: error.message(),
retryable: Some(ModelErrorRetryOptions {
sleep: Duration::from_millis(500),
factor: 1,
retries: 1,
}),
retryable: None,
})?,
}
break 'stream;
Expand Down
12 changes: 2 additions & 10 deletions core/src/providers/openai.rs
Original file line number Diff line number Diff line change
Expand Up @@ -280,11 +280,7 @@ pub async fn streamed_completion(
})?,
false => Err(ModelError {
message: error.message(),
retryable: Some(ModelErrorRetryOptions {
sleep: Duration::from_millis(500),
factor: 1,
retries: 1,
}),
retryable: None,
})?,
}
break 'stream;
Expand Down Expand Up @@ -666,11 +662,7 @@ pub async fn streamed_chat_completion(
})?,
false => Err(ModelError {
message: error.message(),
retryable: Some(ModelErrorRetryOptions {
sleep: Duration::from_millis(500),
factor: 1,
retries: 1,
}),
retryable: None,
})?,
}
break 'stream;
Expand Down

0 comments on commit f0c6da6

Please sign in to comment.