feat: yaml files for llm reasoning

This commit is contained in:
Danny
2026-01-30 10:37:00 -06:00
parent b0211b944d
commit 77260c3e08
4 changed files with 140 additions and 69 deletions
+8 -6
View File
@@ -14,12 +14,14 @@ logger = logging.getLogger(__name__)
Intent = Literal["codebase", "general", "clarification"]
INTENT_PROMPT = """Classify this user message into one category:
- "codebase": Questions about trading system code, architecture, files, methods, execution, strategies, exchanges, risk management, order handling, or technical implementation
- "general": Greetings, meta-questions, off-topic ("How are you?", "What can you do?", "Hello")
- "clarification": Follow-ups that rely on conversation context, not new retrieval ("Tell me more", "What did you mean?", "Can you explain that?")
INTENT_PROMPT = """You are classifying questions for a Tyndale trading system documentation assistant.
IMPORTANT: If the user is asking about specific code, files, classes, methods, or system behavior, classify as "codebase".
Classify this user message into one category:
- "codebase": ANY question about trading, strategies, exchanges, orders, positions, risk, execution, hedging, market making, P&L, or how the system works. Also includes questions with "our", "the system", "this", or references to specific functionality.
- "general": ONLY greetings or completely off-topic questions ("How are you?", "What's the weather?", "Hello")
- "clarification": Follow-ups that reference previous answers ("Tell me more", "What did you mean?", "Can you explain that?")
DEFAULT TO "codebase" if uncertain. This is a trading system assistant - assume trading questions are about the codebase.
Respond with ONLY the category name, nothing else."""
@@ -75,7 +77,7 @@ class IntentClassifier:
# Validate intent
if raw_intent in ("codebase", "general", "clarification"):
logger.debug(f"Classified intent: {raw_intent}")
logger.info(f"Intent classified: '{message[:50]}...' -> {raw_intent}")
return raw_intent
# Default to codebase for ambiguous cases (safer for RAG)