use anyhow::Result;
use serde::Deserialize;
use std::collections::HashMap;
#[derive(Deserialize, Debug)]
pub struct CompatibilityConfig {
pub google: HashMap<String, String>,
pub openai: HashMap<String, String>,
}
pub fn load_model_compatibility() -> Result<CompatibilityConfig> {
let compat_bytes = include_bytes!("../assets/model_compatibility.yaml");
let contents = String::from_utf8_lossy(compat_bytes);
let compat: CompatibilityConfig = serde_yaml::from_str(&contents)
.map_err(|e| anyhow::anyhow!("Failed to parse model compatibility configuration: {}", e))?;
Ok(compat)
}
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn test_load_model_compatibility_success() -> Result<()> {
let config = load_model_compatibility()?;
assert!(config.google.contains_key("gemini-2.0-flash"));
Ok(())
}
}