fix: default model to qwen3.5:9b + improve event classifier prompt
- Migration 026 and OllamaConfig now default to qwen3.5:9b instead of llama3.1:8b. Existing deployments keep their current model (qwen3.5:9b-fast) since the migration uses WHERE NOT EXISTS on slug. - Event classifier system prompt expanded with macro-vs-company filtering: explicitly instructs the model to NOT classify single-company news (lawsuits, earnings, management changes, debt crises) as macro events. Sets severity=low and confidence<0.3 for company-specific articles. Reserves 'critical' severity for multi-country/global market events. Prevents over-tagging event_types by requiring direct description. - Updated test_system_prompt_is_concise threshold to accommodate the expanded prompt (300 → 1000 chars).
This commit is contained in:
@@ -8,7 +8,7 @@ CREATE TABLE IF NOT EXISTS ai_agents (
|
||||
slug VARCHAR(100) NOT NULL UNIQUE,
|
||||
purpose TEXT NOT NULL DEFAULT '',
|
||||
model_provider VARCHAR(50) NOT NULL DEFAULT 'ollama',
|
||||
model_name VARCHAR(200) NOT NULL DEFAULT 'llama3.1:8b',
|
||||
model_name VARCHAR(200) NOT NULL DEFAULT 'qwen3.5:9b',
|
||||
system_prompt TEXT NOT NULL DEFAULT '',
|
||||
user_prompt_template TEXT NOT NULL DEFAULT '',
|
||||
prompt_version VARCHAR(100) NOT NULL DEFAULT '',
|
||||
@@ -34,7 +34,7 @@ SELECT * FROM (VALUES
|
||||
'document-extractor',
|
||||
'Extracts structured intelligence (sentiment, catalysts, impact scores, key facts, risks) from company news, SEC filings, earnings transcripts, and press releases.',
|
||||
'ollama',
|
||||
'llama3.1:8b',
|
||||
'qwen3.5:9b',
|
||||
'You are a financial document analyst. Extract structured data as JSON. Return ONLY a single JSON object. No markdown fences, no explanation, no text before or after the JSON. Every field in the schema is required. Use "other" for catalyst_type if unsure. Keep evidence_spans short (under 20 words each). Keep key_facts to 3-5 items max.',
|
||||
'document-intel-v2',
|
||||
'2.0.0',
|
||||
@@ -45,8 +45,8 @@ SELECT * FROM (VALUES
|
||||
'event-classifier',
|
||||
'Classifies global/geopolitical news into structured macro events with impact type, severity, affected regions/sectors/commodities, and estimated duration.',
|
||||
'ollama',
|
||||
'llama3.1:8b',
|
||||
'Classify this global news article as a macro event. Fill every field. RULES: - Only extract facts EXPLICITLY stated in the article - Do NOT infer geopolitical implications not stated - Distinguish between announced policy and rumored policy - If severity is unclear, default to "low" - confidence: 0.0-1.0 your confidence in this classification',
|
||||
'qwen3.5:9b',
|
||||
'Classify this global news article as a macro event. Fill every field. RULES: - Only extract facts EXPLICITLY stated in the article - Do NOT infer geopolitical implications not stated - Distinguish between announced policy and rumored policy - If severity is unclear, default to "low" - If the article is about a SINGLE COMPANY (not a sector or market), set severity to "low" and confidence below 0.3 - Only tag event_types DIRECTLY described, do NOT infer secondary effects - severity "critical" is reserved for events affecting multiple countries or entire global markets - confidence: 0.0-1.0 your confidence in this classification',
|
||||
'event-classification-v1',
|
||||
'1.0.0',
|
||||
'system'
|
||||
@@ -56,7 +56,7 @@ SELECT * FROM (VALUES
|
||||
'thesis-rewriter',
|
||||
'Rewrites deterministic trade thesis summaries into clear, professional analyst prose. Optional layer — system falls back to deterministic thesis if this fails.',
|
||||
'ollama',
|
||||
'llama3.1:8b',
|
||||
'qwen3.5:9b',
|
||||
'You are a concise financial analyst. You rewrite structured trade thesis summaries into clear, professional prose suitable for an internal research note. STRICT RULES: 1. Do NOT add any information not present in the input. 2. Do NOT fabricate numbers, dates, company names. 3. Keep under 150 words. 4. Preserve all factual claims, risk notes, evidence counts. 5. Neutral, professional tone. 6. Return ONLY the rewritten thesis text.',
|
||||
'thesis-rewrite-v1',
|
||||
'1.0.0',
|
||||
|
||||
Reference in New Issue
Block a user