mirror of
https://github.com/fabro-sh/fabro.git
synced 2026-09-11 22:53:00 +00:00
Destructure ModelInfo to avoid unnecessary clone
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
c6f979e2f2
commit
ba9988d4ee
1 changed files with 5 additions and 3 deletions
|
|
@ -125,14 +125,16 @@ impl Transform for ModelResolutionTransform {
|
|||
.map(String::from);
|
||||
if let Some(model) = model {
|
||||
if let Some(info) = fabro_model::get_model_info(&model) {
|
||||
let canonical_id = info.id;
|
||||
let provider = info.provider;
|
||||
// Resolve alias to canonical model ID
|
||||
if model != info.id {
|
||||
if model != canonical_id {
|
||||
node.attrs
|
||||
.insert("model".to_string(), AttrValue::String(info.id.clone()));
|
||||
.insert("model".to_string(), AttrValue::String(canonical_id));
|
||||
}
|
||||
if !node.attrs.contains_key("provider") {
|
||||
node.attrs
|
||||
.insert("provider".to_string(), AttrValue::String(info.provider));
|
||||
.insert("provider".to_string(), AttrValue::String(provider));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue