Upload engine/predict_yearly.py with huggingface_hub
Browse files- engine/predict_yearly.py +12 -1
engine/predict_yearly.py
CHANGED
|
@@ -7504,8 +7504,19 @@ Examples:
|
|
| 7504 |
return out
|
| 7505 |
_news_v = "; ".join((a.get("title") or "")[:90] for a in (all_data.get("news") or [])[:8])
|
| 7506 |
try:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 7507 |
all_data["corp_events"] = _corporate_events_brief(
|
| 7508 |
-
ticker, _ovs.get("Name"),
|
| 7509 |
if all_data["corp_events"]:
|
| 7510 |
print(" [events] " + " | ".join(f"{e['date']}: {e['event'][:60]}" for e in all_data["corp_events"][:3]))
|
| 7511 |
except Exception: # noqa: BLE001
|
|
|
|
| 7504 |
return out
|
| 7505 |
_news_v = "; ".join((a.get("title") or "")[:90] for a in (all_data.get("news") or [])[:8])
|
| 7506 |
try:
|
| 7507 |
+
# Event RECALL needs the strongest model first (flash-lite returned an empty
|
| 7508 |
+
# list for Apple's own CEO succession); Claude leads, GPT and Gemini back up.
|
| 7509 |
+
def _events_call(system, user):
|
| 7510 |
+
out = _dpv._call_claude_json(system, user)
|
| 7511 |
+
if not (out or {}).get("events"):
|
| 7512 |
+
out2 = _dpv._call_frontier_json(user, system=system)
|
| 7513 |
+
if (out2 or {}).get("events"):
|
| 7514 |
+
return out2
|
| 7515 |
+
if out is None:
|
| 7516 |
+
out = _dpv._call_gemini_json(system, user)
|
| 7517 |
+
return out
|
| 7518 |
all_data["corp_events"] = _corporate_events_brief(
|
| 7519 |
+
ticker, _ovs.get("Name"), _events_call)
|
| 7520 |
if all_data["corp_events"]:
|
| 7521 |
print(" [events] " + " | ".join(f"{e['date']}: {e['event'][:60]}" for e in all_data["corp_events"][:3]))
|
| 7522 |
except Exception: # noqa: BLE001
|