mirror of
https://github.com/katanemo/plano.git
synced 2026-05-04 21:32:43 +02:00
Merge 9f76ca2bf1 into 128059e7c1
This commit is contained in:
commit
0dfa810f7a
2 changed files with 7 additions and 3 deletions
|
|
@ -192,10 +192,13 @@ async fn init_app_state(
|
||||||
// Validate that all models referenced in top-level routing_preferences exist in model_providers.
|
// Validate that all models referenced in top-level routing_preferences exist in model_providers.
|
||||||
// The CLI renders model_providers with `name` = "openai/gpt-4o" and `model` = "gpt-4o",
|
// The CLI renders model_providers with `name` = "openai/gpt-4o" and `model` = "gpt-4o",
|
||||||
// so we accept a match against either field.
|
// so we accept a match against either field.
|
||||||
|
// Internal providers (arch-router, arch-function, etc.) are excluded since they are not
|
||||||
|
// valid routing targets for user-defined routing_preferences.
|
||||||
if let Some(ref route_prefs) = config.routing_preferences {
|
if let Some(ref route_prefs) = config.routing_preferences {
|
||||||
let provider_model_names: std::collections::HashSet<&str> = config
|
let provider_model_names: std::collections::HashSet<&str> = config
|
||||||
.model_providers
|
.model_providers
|
||||||
.iter()
|
.iter()
|
||||||
|
.filter(|p| p.internal != Some(true))
|
||||||
.flat_map(|p| std::iter::once(p.name.as_str()).chain(p.model.as_deref()))
|
.flat_map(|p| std::iter::once(p.name.as_str()).chain(p.model.as_deref()))
|
||||||
.collect();
|
.collect();
|
||||||
for pref in route_prefs {
|
for pref in route_prefs {
|
||||||
|
|
|
||||||
|
|
@ -809,6 +809,10 @@ impl HttpContext for StreamContext {
|
||||||
return Action::Continue;
|
return Action::Continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Capture request ID and traceparent early so all subsequent log messages include them
|
||||||
|
self.request_id = self.get_http_request_header(REQUEST_ID_HEADER);
|
||||||
|
self.traceparent = self.get_http_request_header(TRACE_PARENT_HEADER);
|
||||||
|
|
||||||
// Capture HTTP method and protocol for tracing
|
// Capture HTTP method and protocol for tracing
|
||||||
self.http_method = self.get_http_request_header(":method");
|
self.http_method = self.get_http_request_header(":method");
|
||||||
self.http_protocol = self.get_http_request_header(":scheme");
|
self.http_protocol = self.get_http_request_header(":scheme");
|
||||||
|
|
@ -884,9 +888,6 @@ impl HttpContext for StreamContext {
|
||||||
self.delete_content_length_header();
|
self.delete_content_length_header();
|
||||||
self.save_ratelimit_header();
|
self.save_ratelimit_header();
|
||||||
|
|
||||||
self.request_id = self.get_http_request_header(REQUEST_ID_HEADER);
|
|
||||||
self.traceparent = self.get_http_request_header(TRACE_PARENT_HEADER);
|
|
||||||
|
|
||||||
Action::Continue
|
Action::Continue
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue