From 96e4713703ed2ea5227c0903e56de8d3c18ce97f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=BE=84=E6=BD=AD?= Date: Thu, 27 Mar 2025 14:15:11 +0800 Subject: [PATCH] update default enable path suffix in model mapper&router plugin (#1962) --- plugins/wasm-cpp/extensions/model_mapper/plugin.h | 4 +++- plugins/wasm-cpp/extensions/model_router/plugin.h | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/plugins/wasm-cpp/extensions/model_mapper/plugin.h b/plugins/wasm-cpp/extensions/model_mapper/plugin.h index df0c7eb0e..bfb85ac9a 100644 --- a/plugins/wasm-cpp/extensions/model_mapper/plugin.h +++ b/plugins/wasm-cpp/extensions/model_mapper/plugin.h @@ -41,7 +41,9 @@ struct ModelMapperConfigRule { std::map exact_model_mapping_; std::vector> prefix_model_mapping_; std::string default_model_mapping_; - std::vector enable_on_path_suffix_ = {"/v1/chat/completions"}; + std::vector enable_on_path_suffix_ = { + "/completions", "/embeddings", "/images/generations", + "/audio/speech", "/fine_tuning/jobs", "/moderations"}; }; // PluginRootContext is the root context for all streams processed by the diff --git a/plugins/wasm-cpp/extensions/model_router/plugin.h b/plugins/wasm-cpp/extensions/model_router/plugin.h index 14ef0b632..207ddb553 100644 --- a/plugins/wasm-cpp/extensions/model_router/plugin.h +++ b/plugins/wasm-cpp/extensions/model_router/plugin.h @@ -40,7 +40,9 @@ struct ModelRouterConfigRule { std::string model_key_ = "model"; std::string add_provider_header_; std::string model_to_header_; - std::vector enable_on_path_suffix_ = {"/v1/chat/completions"}; + std::vector enable_on_path_suffix_ = { + "/completions", "/embeddings", "/images/generations", + "/audio/speech", "/fine_tuning/jobs", "/moderations"}; }; // PluginRootContext is the root context for all streams processed by the