You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
refactor(config): restructure config to use nested model objects (#577)
* refactor(config): restructure config to use nested model objects
This commit refactors the RouterConfig structure to organize related
configuration fields into nested objects for better modularity and clarity:
- BertModel: Groups BERT similarity model configuration (ModelID, Threshold, UseCPU)
- MCPCategoryModel: Groups MCP category classifier configuration (Enabled, TransportType, Command, Args, etc.)
- SemanticCache: Groups semantic cache configuration (Enabled, BackendType, MaxEntries, TTLSeconds, etc.)
Updated all references across the codebase:
- pkg/apiserver/route_model_info.go: Access BERT config via BertModel nested object
- pkg/classification/classifier.go: Check MCP enabled via MCPCategoryModel.Enabled
- pkg/classification/mcp_classifier.go: Access all MCP config via MCPCategoryModel
- pkg/extproc/request_handler.go: Access cache config via SemanticCache.Enabled
- pkg/extproc/router.go: Access BERT and cache config via nested objects
- pkg/services/classification.go: Check MCP enabled via MCPCategoryModel.Enabled
This improves code organization and makes the configuration structure
more maintainable and easier to understand.
Signed-off-by: bitliu <[email protected]>
* test
Signed-off-by: bitliu <[email protected]>
---------
Signed-off-by: bitliu <[email protected]>
0 commit comments