feat: Yahoo Finance SSH proxy + Xiaomi MiMo LLM support
CI / tests (py3.10) (push) Has been cancelled
CI / tests (py3.11) (push) Has been cancelled
CI / tests (py3.12) (push) Has been cancelled
CI / tests (py3.13) (push) Has been cancelled
CI / clean-install smoke (push) Has been cancelled
CI / ruff (strict, full repo) (push) Has been cancelled
CI / tests (py3.10) (push) Has been cancelled
CI / tests (py3.11) (push) Has been cancelled
CI / tests (py3.12) (push) Has been cancelled
CI / tests (py3.13) (push) Has been cancelled
CI / clean-install smoke (push) Has been cancelled
CI / ruff (strict, full repo) (push) Has been cancelled
- Add SSH proxy via foreign server for Yahoo Finance bypass - Add fallback in load_ohlcv and get_YFin_data_online - Add LLM JSON decode retry (3 attempts) in NormalizedChatOpenAI - Add yahoo_proxy.py utility module - Add test_smoke.py and patches/
This commit is contained in:
1 parent
01477f9afb
commit
51d057e2c9
7 files changed
+824
-26
No files matched your search
@@ -33,7 +33,21 @@ class NormalizedChatOpenAI(ChatOpenAI):
|
||||
"""
|
||||
|
||||
def invoke(self, input, config=None, **kwargs):
|
||||
return normalize_content(super().invoke(input, config, **kwargs))
|
||||
import json as _json
|
||||
import time as _time
|
||||
import logging as _logging
|
||||
_logger = _logging.getLogger(__name__)
|
||||
max_retries = 3
|
||||
for attempt in range(max_retries):
|
||||
try:
|
||||
return normalize_content(super().invoke(input, config, **kwargs))
|
||||
except (_json.JSONDecodeError, Exception) as e:
|
||||
if 'JSONDecodeError' in type(e).__name__ or 'Expecting value' in str(e):
|
||||
if attempt < max_retries - 1:
|
||||
_logger.warning(f"LLM returned invalid JSON, retrying ({attempt+1}/{max_retries}): {e}")
|
||||
_time.sleep(2 * (attempt + 1))
|
||||
continue
|
||||
raise
|
||||
|
||||
def with_structured_output(self, schema, *, method=None, **kwargs):
|
||||
caps = get_capabilities(self.model_name)
|
||||
|
||||
Reference in new issue
Block a user