Files
tkmind_go/crates/goose/src/macros.rs
T
Douwe Osinga 21604df685 Ok, well, that got out of hand (#3718)
Co-authored-by: Douwe Osinga <douwe@squareup.com>
Co-authored-by: Michael Neale <michael.neale@gmail.com>
2025-07-30 11:41:42 +02:00

20 lines
642 B
Rust

#[macro_export]
macro_rules! impl_provider_default {
($provider:ty) => {
impl Default for $provider {
fn default() -> Self {
let model = $crate::model::ModelConfig::new(
&<$provider as $crate::providers::base::Provider>::metadata().default_model,
)
.expect(concat!(
"Failed to create model config for ",
stringify!($provider)
));
<$provider>::from_env(model)
.expect(concat!("Failed to initialize ", stringify!($provider)))
}
}
};
}