mirror of
https://github.com/block/goose.git
synced 2026-07-17 12:56:20 +02:00
Handle Bedrock 'prompt is too long' error (#7550)
Signed-off-by: Oleg Levchenko <oleg.levchenko@ooma.com> Co-authored-by: Oleg Levchenko <oleg.levchenko@ooma.com>
This commit is contained in:
@@ -284,10 +284,11 @@ impl BedrockProvider {
|
||||
ProviderError::Authentication(format!("Failed to call Bedrock: {:?}", err))
|
||||
}
|
||||
ConverseError::ValidationException(err)
|
||||
if err
|
||||
.message()
|
||||
.unwrap_or_default()
|
||||
.contains("Input is too long for requested model.") =>
|
||||
if {
|
||||
let msg = err.message().unwrap_or_default();
|
||||
msg.contains("Input is too long for requested model.")
|
||||
|| msg.contains("prompt is too long")
|
||||
} =>
|
||||
{
|
||||
ProviderError::ContextLengthExceeded(format!(
|
||||
"Failed to call Bedrock: {:?}",
|
||||
|
||||
Reference in New Issue
Block a user