mirror of
https://github.com/BerriAI/litellm.git
synced 2026-11-18 09:45:23 +00:00
fix(model-catalog): restore rejected rows through the store
with_rejected_replaced still wrote the entries and names fields the store refactor removed, so 02 did not compile. It now inserts the bundled rows in one store edit, which rebuilds the name index Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
7c716d5165
commit
fb9a261d61
1 changed files with 16 additions and 13 deletions
|
|
@ -369,22 +369,25 @@ impl Catalog {
|
|||
rejected.entry(key).or_default().push(error);
|
||||
}
|
||||
}
|
||||
let rejections = rejected
|
||||
let rejections: Vec<_> = rejected
|
||||
.into_iter()
|
||||
.map(|(key, errors)| {
|
||||
let bundled_entry = bundled.entries.get(&key).cloned();
|
||||
let replaced_by_bundled = bundled_entry.is_some();
|
||||
if let Some(entry) = bundled_entry {
|
||||
catalog.entries.insert(key.clone(), entry);
|
||||
}
|
||||
Rejection {
|
||||
key,
|
||||
errors,
|
||||
replaced_by_bundled,
|
||||
}
|
||||
.map(|(key, errors)| Rejection {
|
||||
replaced_by_bundled: bundled.rows().entries.contains_key(&key),
|
||||
key,
|
||||
errors,
|
||||
})
|
||||
.collect();
|
||||
catalog.names = name_index(&catalog.entries, &catalog.aliases);
|
||||
catalog.store.edit(|rows| {
|
||||
for rejection in rejections
|
||||
.iter()
|
||||
.filter(|rejection| rejection.replaced_by_bundled)
|
||||
{
|
||||
rows.entries.insert(
|
||||
rejection.key.clone(),
|
||||
bundled.rows().entries[&rejection.key].clone(),
|
||||
);
|
||||
}
|
||||
});
|
||||
(catalog, rejections)
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue