download vast.ai's root certificate in order to make pyworker requests

This commit is contained in:
Nader Arbabian
2025-07-31 12:47:12 -07:00
parent e0be45f39a
commit 9773e5f67b
5 changed files with 34 additions and 3 deletions
+7 -2
View File
@@ -6,6 +6,7 @@ from urllib.parse import urljoin
from typing import Dict, Any, Optional, Iterator, Union, List
import requests
from utils.endpoint_util import Endpoint
from utils.ssl import get_cert_file_path
from .data_types.client import CompletionConfig, ChatCompletionConfig
logging.basicConfig(
@@ -90,9 +91,13 @@ class APIClient:
# Make the request using the specified method
if method.upper() == "POST":
response = requests.post(url, json=req_data, stream=stream)
response = requests.post(
url, json=req_data, stream=stream, verify=get_cert_file_path()
)
elif method.upper() == "GET":
response = requests.get(url, params=req_data, stream=stream)
response = requests.get(
url, params=req_data, stream=stream, verify=get_cert_file_path()
)
else:
raise ValueError(f"Unsupported HTTP method: {method}")