File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed
src/semantic-router/pkg/extproc Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -596,13 +596,18 @@ func (r *OpenAIRouter) handleModelRouting(openAIRequest *openai.ChatCompletionNe
596596
597597 // Add category-specific system prompt if configured
598598 if categoryName != "" {
599- // Use global config to get the most up-to-date category configuration
599+ // Try to get the most up-to-date category configuration from global config first
600600 // This ensures API updates are reflected immediately
601601 globalConfig := config .GetConfig ()
602602 var category * config.Category
603603 if globalConfig != nil {
604604 category = globalConfig .GetCategoryByName (categoryName )
605605 }
606+
607+ // If not found in global config, fall back to router's config (for tests and initial setup)
608+ if category == nil {
609+ category = r .Classifier .GetCategoryByName (categoryName )
610+ }
606611
607612 if category != nil && category .SystemPrompt != "" && category .IsSystemPromptEnabled () {
608613 mode := category .GetSystemPromptMode ()
You can’t perform that action at this time.
0 commit comments