mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-30 17:24:59 +00:00
ensure litellm respects --no-verify-ssl
This commit is contained in:
parent
15faf69173
commit
9a2b8bb706
2 changed files with 14 additions and 10 deletions
21
aider/llm.py
21
aider/llm.py
|
@ -11,19 +11,22 @@ os.environ["OR_APP_NAME"] = "Aider"
|
|||
|
||||
|
||||
class LazyLiteLLM:
|
||||
def __init__(self):
|
||||
self._lazy_module = None
|
||||
_lazy_module = None
|
||||
|
||||
def __getattr__(self, name):
|
||||
if self._lazy_module is None:
|
||||
self._lazy_module = importlib.import_module("litellm")
|
||||
|
||||
self._lazy_module.suppress_debug_info = True
|
||||
self._lazy_module.set_verbose = False
|
||||
self._lazy_module.drop_params = True
|
||||
|
||||
self._load_litellm()
|
||||
return getattr(self._lazy_module, name)
|
||||
|
||||
def _load_litellm(self):
|
||||
if self._lazy_module is not None:
|
||||
return
|
||||
|
||||
self._lazy_module = importlib.import_module("litellm")
|
||||
|
||||
self._lazy_module.suppress_debug_info = True
|
||||
self._lazy_module.set_verbose = False
|
||||
self._lazy_module.drop_params = True
|
||||
|
||||
|
||||
litellm = LazyLiteLLM()
|
||||
|
||||
|
|
|
@ -327,7 +327,8 @@ def main(argv=None, input=None, output=None, force_git_root=None, return_coder=F
|
|||
if not args.verify_ssl:
|
||||
import httpx
|
||||
|
||||
litellm.client_session = httpx.Client(verify=False)
|
||||
litellm._load_litellm()
|
||||
litellm._lazy_module.client_session = httpx.Client(verify=False)
|
||||
|
||||
if args.dark_mode:
|
||||
args.user_input_color = "#32FF32"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue