mirror of
https://github.com/katanemo/plano.git
synced 2026-07-14 16:22:12 +02:00
remove rs changes
This commit is contained in:
parent
ca766f81fa
commit
2fe91932d3
2 changed files with 8 additions and 6 deletions
|
|
@ -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
|
// 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.
|
// the lifecycle of the http request and response.
|
||||||
fn on_http_request_headers(&mut self, _num_headers: usize, _end_of_stream: bool) -> Action {
|
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();
|
self.select_llm_provider();
|
||||||
|
|
||||||
// if endpoint is not set then use provider name as routing header so envoy can resolve the cluster name
|
// if endpoint is not set then use provider name as routing header so envoy can resolve the cluster name
|
||||||
|
|
|
||||||
|
|
@ -10,6 +10,7 @@ use common::{
|
||||||
},
|
},
|
||||||
errors::ServerError,
|
errors::ServerError,
|
||||||
http::{CallArgs, Client},
|
http::{CallArgs, Client},
|
||||||
|
pii::obfuscate_auth_header,
|
||||||
};
|
};
|
||||||
use http::StatusCode;
|
use http::StatusCode;
|
||||||
use log::{debug, trace, warn};
|
use log::{debug, trace, warn};
|
||||||
|
|
@ -39,6 +40,12 @@ impl HttpContext for StreamContext {
|
||||||
|
|
||||||
self.is_chat_completions_request = request_path == CHAT_COMPLETIONS_PATH;
|
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.request_id = self.get_http_request_header(REQUEST_ID_HEADER);
|
||||||
self.traceparent = self.get_http_request_header(TRACE_PARENT_HEADER);
|
self.traceparent = self.get_http_request_header(TRACE_PARENT_HEADER);
|
||||||
Action::Continue
|
Action::Continue
|
||||||
|
|
@ -137,10 +144,7 @@ impl HttpContext for StreamContext {
|
||||||
if metadata.is_none() {
|
if metadata.is_none() {
|
||||||
metadata = Some(HashMap::new());
|
metadata = Some(HashMap::new());
|
||||||
}
|
}
|
||||||
metadata
|
metadata.as_mut().unwrap().insert("optimize_context_window".to_string(), "true".to_string());
|
||||||
.as_mut()
|
|
||||||
.unwrap()
|
|
||||||
.insert("optimize_context_window".to_string(), "true".to_string());
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue