remove rs changes

This commit is contained in:
Adil Hafeez 2025-02-12 10:43:05 -08:00
parent ca766f81fa
commit 2fe91932d3
No known key found for this signature in database
GPG key ID: 9B18EF7691369645
2 changed files with 8 additions and 6 deletions

View file

@ -176,8 +176,6 @@ impl HttpContext for StreamContext {
// Envoy's HTTP model is event driven. The WASM ABI has given implementors events to hook onto
// the lifecycle of the http request and response.
fn on_http_request_headers(&mut self, _num_headers: usize, _end_of_stream: bool) -> Action {
let request_path = self.get_http_request_header(":path").unwrap_or_default();
debug!("request_path: {}", request_path);
self.select_llm_provider();
// if endpoint is not set then use provider name as routing header so envoy can resolve the cluster name

View file

@ -10,6 +10,7 @@ use common::{
},
errors::ServerError,
http::{CallArgs, Client},
pii::obfuscate_auth_header,
};
use http::StatusCode;
use log::{debug, trace, warn};
@ -39,6 +40,12 @@ impl HttpContext for StreamContext {
self.is_chat_completions_request = request_path == CHAT_COMPLETIONS_PATH;
trace!(
"on_http_request_headers S[{}] req_headers={:?}",
self.context_id,
obfuscate_auth_header(&mut self.get_http_request_headers())
);
self.request_id = self.get_http_request_header(REQUEST_ID_HEADER);
self.traceparent = self.get_http_request_header(TRACE_PARENT_HEADER);
Action::Continue
@ -137,10 +144,7 @@ impl HttpContext for StreamContext {
if metadata.is_none() {
metadata = Some(HashMap::new());
}
metadata
.as_mut()
.unwrap()
.insert("optimize_context_window".to_string(), "true".to_string());
metadata.as_mut().unwrap().insert("optimize_context_window".to_string(), "true".to_string());
}
}