perf: reduce SITREP prompt size + increase timeout for reasoning model
This commit is contained in:
parent
c18194f8ac
commit
ec30c9d7df
1 changed files with 3 additions and 7 deletions
|
|
@ -197,21 +197,17 @@ def build_ai_prompt(all_stories, crypto):
|
|||
for src_name in ['Hacker News', 'r/technology', 'r/programming', 'Lobste.rs']:
|
||||
if src_name in sources:
|
||||
lines.append(f'\n--- {src_name.upper()} ---')
|
||||
for i, s in enumerate(sources[src_name][:25], 1):
|
||||
for i, s in enumerate(sources[src_name][:12], 1):
|
||||
score_str = f" [score:{s.get('score', '?')}]" if s.get('score') else ''
|
||||
url_str = f"\n Link: {s['url']}" if s.get('url') else ''
|
||||
lines.append(f"{i}. {s['title']}{score_str}{url_str}")
|
||||
if s.get('summary'):
|
||||
lines.append(f" Summary: {s['summary'][:150]}")
|
||||
|
||||
lines.append('\n=== CYBERSECURITY FEEDS ===')
|
||||
if 'r/netsec' in sources:
|
||||
lines.append('--- R/NETSEC ---')
|
||||
for i, s in enumerate(sources['r/netsec'][:15], 1):
|
||||
for i, s in enumerate(sources['r/netsec'][:8], 1):
|
||||
url_str = f"\n Link: {s['url']}" if s.get('url') else ''
|
||||
lines.append(f"{i}. {s['title']}{url_str}")
|
||||
if s.get('summary'):
|
||||
lines.append(f" Summary: {s['summary'][:150]}")
|
||||
|
||||
# Also extract security-related stories from other feeds
|
||||
sec_keywords = ['security', 'vulnerability', 'exploit', 'hack', 'breach',
|
||||
|
|
@ -323,7 +319,7 @@ def generate_with_venice(user_prompt):
|
|||
'max_tokens': 8192,
|
||||
'temperature': 0.7
|
||||
},
|
||||
timeout=120
|
||||
timeout=300
|
||||
)
|
||||
resp.raise_for_status()
|
||||
result = resp.json()
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue