Filter unsupported reasoning from Bedrock request history

This commit is contained in:
Ryan Ward
2026-10-28 18:26:02 +00:00
parent 3cce041a6d
commit f399ada2a3
7 changed files with 462 additions and 16 deletions
+17 -11
View File
@@ -495,18 +495,24 @@ pub(crate) async fn provider_runtime_for_request(
let cross_region_inference = config.invocation_model_id.is_none() && config.cross_region_inference;
let caching_config =
CachingConfig::from_external_config(&ExternalBedrockConfig::load()).for_model(&model);
let invocation_model = config.invocation_model_id.clone().unwrap_or(model);
let invocation_model = config
.invocation_model_id
.clone()
.unwrap_or_else(|| model.clone());
let client = BedrockClient::from_config(config).await?;
Arc::new(BedrockRuntime::from_aws_client(
client.runtime_client(),
BedrockRigConfig {
model: invocation_model,
region: client.region().to_string(),
cross_region_inference,
prompt_caching: caching_config.enabled,
max_output_tokens,
},
)?)
Arc::new(
BedrockRuntime::from_aws_client(
client.runtime_client(),
BedrockRigConfig {
model: invocation_model,
region: client.region().to_string(),
cross_region_inference,
prompt_caching: caching_config.enabled,
max_output_tokens,
},
)?
.with_reasoning_model(model),
)
}
crate::ai::provider::ProviderConfig::None => {
anyhow::bail!(