use super::transformations;
use crate::core::providers::unified_provider::ProviderError;
use crate::core::types::chat::ChatRequest;
use serde_json::Value;
pub async fn execute_invoke(
client: &crate::core::providers::bedrock::client::BedrockClient,
request: &ChatRequest,
) -> Result<Value, ProviderError> {
let model_config =
crate::core::providers::bedrock::model_config::get_model_config(&request.model)?;
let body = transformations::transform_for_model(request, model_config)?;
let response = client.send_request(&request.model, "invoke", &body).await?;
response
.json::<Value>()
.await
.map_err(|e| ProviderError::response_parsing("bedrock", e.to_string()))
}