Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions crates/common/src/api/open_ai.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ use crate::{
configuration::LlmProvider,
consts::{ARCH_FC_MODEL_NAME, ASSISTANT_ROLE},
};
use core::{panic, str};
use serde::{ser::SerializeMap, Deserialize, Serialize};
use std::{
collections::{HashMap, VecDeque},
Expand Down Expand Up @@ -193,7 +192,7 @@ impl Display for ContentType {
// skip image URLs or their data in text representation
None
} else {
panic!("Unsupported content type: {:?}", part.content_type);
None
}
})
.collect();
Expand Down
5 changes: 4 additions & 1 deletion crates/common/src/http.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,10 @@ pub trait Client: Context {
fn add_call_context(&self, id: u32, call_context: Self::CallContext) {
let callouts = self.callouts();
if callouts.borrow_mut().insert(id, call_context).is_some() {
panic!("Duplicate http call with id={}", id);
log::warn!(
"Duplicate http call with id={}, previous context overwritten",
id
);
}
self.active_http_calls().increment(1);
}
Expand Down
5 changes: 4 additions & 1 deletion crates/common/src/ratelimit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,10 @@ impl RatelimitMap {
match new_ratelimit_map.datastore.get_mut(&ratelimit_config.model) {
Some(limits) => match limits.get_mut(&ratelimit_config.selector) {
Some(_) => {
panic!("repeated selector. Selectors per provider must be unique")
log::error!(
"repeated selector for model '{}'. Selectors per provider must be unique, skipping duplicate",
ratelimit_config.model
);
}
None => {
limits.insert(ratelimit_config.selector, limit);
Expand Down
Loading