[model-gateway] refactor oai router 1/n (#14228)
This commit is contained in:
@@ -1133,15 +1133,6 @@ impl crate::routers::RouterTrait for OpenAIRouter {
|
|||||||
(StatusCode::NOT_IMPLEMENTED, "Embeddings not supported").into_response()
|
(StatusCode::NOT_IMPLEMENTED, "Embeddings not supported").into_response()
|
||||||
}
|
}
|
||||||
|
|
||||||
async fn route_rerank(
|
|
||||||
&self,
|
|
||||||
_headers: Option<&HeaderMap>,
|
|
||||||
_body: &RerankRequest,
|
|
||||||
_model_id: Option<&str>,
|
|
||||||
) -> Response {
|
|
||||||
(StatusCode::NOT_IMPLEMENTED, "Rerank not supported").into_response()
|
|
||||||
}
|
|
||||||
|
|
||||||
async fn route_classify(
|
async fn route_classify(
|
||||||
&self,
|
&self,
|
||||||
_headers: Option<&HeaderMap>,
|
_headers: Option<&HeaderMap>,
|
||||||
@@ -1151,6 +1142,15 @@ impl crate::routers::RouterTrait for OpenAIRouter {
|
|||||||
(StatusCode::NOT_IMPLEMENTED, "Classify not supported").into_response()
|
(StatusCode::NOT_IMPLEMENTED, "Classify not supported").into_response()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async fn route_rerank(
|
||||||
|
&self,
|
||||||
|
_headers: Option<&HeaderMap>,
|
||||||
|
_body: &RerankRequest,
|
||||||
|
_model_id: Option<&str>,
|
||||||
|
) -> Response {
|
||||||
|
(StatusCode::NOT_IMPLEMENTED, "Rerank not supported").into_response()
|
||||||
|
}
|
||||||
|
|
||||||
async fn create_conversation(&self, _headers: Option<&HeaderMap>, body: &Value) -> Response {
|
async fn create_conversation(&self, _headers: Option<&HeaderMap>, body: &Value) -> Response {
|
||||||
create_conversation(&self.conversation_storage, body.clone()).await
|
create_conversation(&self.conversation_storage, body.clone()).await
|
||||||
}
|
}
|
||||||
@@ -1180,10 +1180,6 @@ impl crate::routers::RouterTrait for OpenAIRouter {
|
|||||||
delete_conversation(&self.conversation_storage, conversation_id).await
|
delete_conversation(&self.conversation_storage, conversation_id).await
|
||||||
}
|
}
|
||||||
|
|
||||||
fn router_type(&self) -> &'static str {
|
|
||||||
"openai"
|
|
||||||
}
|
|
||||||
|
|
||||||
async fn list_conversation_items(
|
async fn list_conversation_items(
|
||||||
&self,
|
&self,
|
||||||
_headers: Option<&HeaderMap>,
|
_headers: Option<&HeaderMap>,
|
||||||
@@ -1258,4 +1254,8 @@ impl crate::routers::RouterTrait for OpenAIRouter {
|
|||||||
)
|
)
|
||||||
.await
|
.await
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn router_type(&self) -> &'static str {
|
||||||
|
"openai"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user