mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-29 08:44:59 +00:00
defer import of httpx
This commit is contained in:
parent
5e0ff7627e
commit
2dc6735ab4
3 changed files with 6 additions and 3 deletions
|
@ -5,7 +5,6 @@ import sys
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
|
||||||
import git
|
import git
|
||||||
import httpx
|
|
||||||
from dotenv import load_dotenv
|
from dotenv import load_dotenv
|
||||||
from prompt_toolkit.enums import EditingMode
|
from prompt_toolkit.enums import EditingMode
|
||||||
|
|
||||||
|
@ -293,6 +292,8 @@ def main(argv=None, input=None, output=None, force_git_root=None, return_coder=F
|
||||||
args = parser.parse_args(argv)
|
args = parser.parse_args(argv)
|
||||||
|
|
||||||
if not args.verify_ssl:
|
if not args.verify_ssl:
|
||||||
|
import httpx
|
||||||
|
|
||||||
litellm.client_session = httpx.Client(verify=False)
|
litellm.client_session = httpx.Client(verify=False)
|
||||||
|
|
||||||
if args.gui and not return_coder:
|
if args.gui and not return_coder:
|
||||||
|
|
|
@ -3,7 +3,6 @@
|
||||||
import re
|
import re
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
import httpx
|
|
||||||
import playwright
|
import playwright
|
||||||
import pypandoc
|
import pypandoc
|
||||||
from bs4 import BeautifulSoup
|
from bs4 import BeautifulSoup
|
||||||
|
@ -111,6 +110,8 @@ class Scraper:
|
||||||
return PLAYWRIGHT_INFO
|
return PLAYWRIGHT_INFO
|
||||||
|
|
||||||
def scrape_with_httpx(self, url):
|
def scrape_with_httpx(self, url):
|
||||||
|
import httpx
|
||||||
|
|
||||||
headers = {"User-Agent": f"Mozilla./5.0 ({aider_user_agent})"}
|
headers = {"User-Agent": f"Mozilla./5.0 ({aider_user_agent})"}
|
||||||
try:
|
try:
|
||||||
with httpx.Client(headers=headers) as client:
|
with httpx.Client(headers=headers) as client:
|
||||||
|
|
|
@ -2,7 +2,6 @@ import hashlib
|
||||||
import json
|
import json
|
||||||
|
|
||||||
import backoff
|
import backoff
|
||||||
import httpx
|
|
||||||
|
|
||||||
from aider.dump import dump # noqa: F401
|
from aider.dump import dump # noqa: F401
|
||||||
from aider.litellm import litellm
|
from aider.litellm import litellm
|
||||||
|
@ -17,6 +16,8 @@ CACHE = None
|
||||||
|
|
||||||
def lazy_litellm_retry_decorator(func):
|
def lazy_litellm_retry_decorator(func):
|
||||||
def wrapper(*args, **kwargs):
|
def wrapper(*args, **kwargs):
|
||||||
|
import httpx
|
||||||
|
|
||||||
def should_giveup(e):
|
def should_giveup(e):
|
||||||
if not hasattr(e, "status_code"):
|
if not hasattr(e, "status_code"):
|
||||||
return False
|
return False
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue