Skip to content

Commit 9f5d89b

Browse files
committed
Ruff issues
1 parent 448be01 commit 9f5d89b

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

dspy_code/commands/nl_command_router.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -505,7 +505,7 @@ def route(
505505
# Check if user explicitly references a slash command (e.g., "/save", "/mcp-read")
506506
# We need to distinguish between actual commands (like "/save") and file paths (like "/tmp/city")
507507
# Slash commands typically appear as "/command" at word boundaries or standalone
508-
slash_command_pattern = r'\b/(?:save|run|validate|connect|mcp-|init|help|status|clear|exit|optimize|eval|explain|model|models|data|examples|adapters|retrievers|demo|session)'
508+
slash_command_pattern = r"\b/(?:save|run|validate|connect|mcp-|init|help|status|clear|exit|optimize|eval|explain|model|models|data|examples|adapters|retrievers|demo|session)"
509509
has_slash_command = re.search(slash_command_pattern, user_input_lower) is not None
510510

511511
# Also check for natural language command patterns (without "/")
@@ -531,9 +531,13 @@ def route(
531531
# If the user mentions a command (either slash or natural language),
532532
# allow the LLM router to decide whether to dispatch it.
533533
if has_slash_command:
534-
logger.debug(f"Using LLM reasoning for explicit slash command reference: '{user_input}'")
534+
logger.debug(
535+
f"Using LLM reasoning for explicit slash command reference: '{user_input}'"
536+
)
535537
else:
536-
logger.debug(f"Using LLM reasoning for natural language command pattern: '{user_input}'")
538+
logger.debug(
539+
f"Using LLM reasoning for natural language command pattern: '{user_input}'"
540+
)
537541
return self._route_with_llm(user_input, context, pattern_matches=None)
538542

539543
def _route_with_llm(

0 commit comments

Comments
 (0)